Skip to contentSkip to conversation

make some bitfields unsigned

PATCH In review Dan Carpenter 2 participants 2 messages Nov 16, 2009 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make some bitfields unsigned

This is a clean up and doesn't change the behavior.

Bit fields should always be unsigned. Otherwise pm_suspend_enabled will be -1 when you want it to be 1. The other bad thing is that the sparse checker will complain 36 times if they aren't unsigned.

The other bitfields in that struct are unsigned already.

regards,
dan carpenter

sound/pci/ice1712/ice1712.h +2 -2
@@ -382,8 +382,8 @@
 #ifdef CONFIG_PM
 	int (*pm_suspend)(struct snd_ice1712 *);
 	int (*pm_resume)(struct snd_ice1712 *);
-	int pm_suspend_enabled:1;
-	int pm_saved_is_spdif_master:1;
+	unsigned int pm_suspend_enabled:1;
+	unsigned int pm_saved_is_spdif_master:1;
 	unsigned int pm_saved_spdif_ctrl;
 	unsigned char pm_saved_spdif_cfg;
 	unsigned int pm_saved_route;
#1 lore raw

At Mon, 16 Nov 2009 11:07:17 +0200 (SAST),

Quoted 7 lines · Dan Carpenter

This is a clean up and doesn't change the behavior.

Bit fields should always be unsigned. Otherwise pm_suspend_enabled will be -1 when you want it to be 1. The other bad thing is that the sparse checker will complain 36 times if they aren't unsigned.

Quoted 6 lines

The other bitfields in that struct are unsigned already.

regards,
dan carpenter

Thanks! Applied now.

Takashi

Quoted 15 lines
sound/pci/ice1712/ice1712.h +2 -2
@@ -382,8 +382,8 @@
 #ifdef CONFIG_PM
 	int (*pm_suspend)(struct snd_ice1712 *);
 	int (*pm_resume)(struct snd_ice1712 *);
-	int pm_suspend_enabled:1;
-	int pm_saved_is_spdif_master:1;
+	unsigned int pm_suspend_enabled:1;
+	unsigned int pm_saved_is_spdif_master:1;
 	unsigned int pm_saved_spdif_ctrl;
 	unsigned char pm_saved_spdif_cfg;
 	unsigned int pm_saved_route;