Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (8725): drx397xD.c sparse annotations

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Harvey Harrison and committed by
Mauro Carvalho Chehab
95908ece 06a3f584

+9 -9
+7 -7
drivers/media/dvb/frontends/drx397xD.c
··· 235 235 } 236 236 237 237 /* Function is not endian safe, use the RD16 wrapper below */ 238 - static int _read16(struct drx397xD_state *s, u32 i2c_adr) 238 + static int _read16(struct drx397xD_state *s, __le32 i2c_adr) 239 239 { 240 240 int rc; 241 241 u8 a[4]; 242 - u16 v; 242 + __le16 v; 243 243 struct i2c_msg msg[2] = { 244 244 { 245 245 .addr = s->config.demod_address, ··· 249 249 }, { 250 250 .addr = s->config.demod_address, 251 251 .flags = I2C_M_RD, 252 - .buf = (u8 *) &v, 252 + .buf = (u8 *)&v, 253 253 .len = sizeof(v) 254 254 } 255 255 }; 256 256 257 - *(u32 *) a = i2c_adr; 257 + *(__le32 *) a = i2c_adr; 258 258 259 259 rc = i2c_transfer(s->i2c, msg, 2); 260 260 if (rc != 2) ··· 264 264 } 265 265 266 266 /* Function is not endian safe, use the WR16.. wrappers below */ 267 - static int _write16(struct drx397xD_state *s, u32 i2c_adr, u16 val) 267 + static int _write16(struct drx397xD_state *s, __le32 i2c_adr, __le16 val) 268 268 { 269 269 u8 a[6]; 270 270 int rc; ··· 275 275 .len = sizeof(a) 276 276 }; 277 277 278 - *(u32 *) a = i2c_adr; 279 - *(u16 *) &a[4] = val; 278 + *(__le32 *)a = i2c_adr; 279 + *(__le16 *)&a[4] = val; 280 280 281 281 rc = i2c_transfer(s->i2c, &msg, 1); 282 282 if (rc != 1)
+2 -2
drivers/media/dvb/frontends/drx397xD.h
··· 28 28 #define DRX_F_OFFSET 36000000 29 29 30 30 #define I2C_ADR_C0(x) \ 31 - ( (u32)cpu_to_le32( \ 31 + ( cpu_to_le32( \ 32 32 (u32)( \ 33 33 (((u32)(x) & (u32)0x000000ffUL) ) | \ 34 34 (((u32)(x) & (u32)0x0000ff00UL) << 16) | \ ··· 38 38 ) 39 39 40 40 #define I2C_ADR_E0(x) \ 41 - ( (u32)cpu_to_le32( \ 41 + ( cpu_to_le32( \ 42 42 (u32)( \ 43 43 (((u32)(x) & (u32)0x000000ffUL) ) | \ 44 44 (((u32)(x) & (u32)0x0000ff00UL) << 16) | \