i2c.c: Fixed coding style issue for if statement
Subsystems (3)
PATCH 2/2 i2c.c: Fixed coding style issue for if statement
From: "santosh.anbu" <[email protected]>
Fixed coding style issue
Signed-off-by santosh.anbu <[email protected]>
--- drivers/gpu/drm/nouveau/core/subdev/bios/i2c.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/gpu/drm/nouveau/core/subdev/bios/i2c.c +8 -4
@@ -114,15 +114,19 @@ dcb_i2c_parse(struct nouveau_bios *bios, u8 idx, struct dcb_i2c_entry *info)if (idx ==0 ) { info->drive =nv_ro08 (bios, ent +4 ); -if (!info->drive) info->drive =0x3f ; +if (!info->drive) + info->drive =0x3f ; info->sense =nv_ro08 (bios, ent +5 ); -if (!info->sense) info->sense =0x3e ; +if (!info->sense) + info->sense =0x3e ; }else if (idx ==1 ) { info->drive =nv_ro08 (bios, ent +6 ); -if (!info->drive) info->drive =0x37 ; +if (!info->drive) + info->drive =0x37 ; info->sense =nv_ro08 (bios, ent +7 ); -if (!info->sense) info->sense =0x36 ; +if (!info->sense) + info->sense =0x36 ; } info->type =DCB_I2C_NV04_BIT ;
Signature · 1 line
1.8.1.2
Quoted 1 line · santosh.anbu
From: "santosh.anbu" <[email protected]>
[]
Quoted 18 lines
drivers/gpu/drm/nouveau/core/subdev/bios/i2c.c +4
-2@@ -114,15 +114,19 @@ dcb_i2c_parse(struct nouveau_bios *bios, u8 idx, struct dcb_i2c_entry *info)if (idx ==0 ) { info->drive =nv_ro08 (bios, ent +4 ); -if (!info->drive) info->drive =0x3f ; +if (!info->drive) + info->drive =0x3f ; info->sense =nv_ro08 (bios, ent +5 ); -if (!info->sense) info->sense =0x3e ; +if (!info->sense) + info->sense =0x3e ; }else if (idx ==1 ) { info->drive =nv_ro08 (bios, ent +6 );
drivers/gpu/drm/nouveau/core/subdev/bios/i2c.c dcb_i2c_parse(struct nouveau_bios *bios, u8 idx, struct dcb_i2c_entry *info) · line 132
Quoted 10 lines
drivers/gpu/drm/nouveau/core/subdev/bios/i2c.c +4
-2-if (!info->drive) info->drive =0x37 ; +if (!info->drive) + info->drive =0x37 ; info->sense =nv_ro08 (bios, ent +7 ); -if (!info->sense) info->sense =0x36 ; +if (!info->sense) + info->sense =0x36 ; } info->type =DCB_I2C_NV04_BIT ;
Perhaps this is better handled with a new function like
int nv_ro08_default(bios, address, default)
{
int val = nv_ro08(bios, address);
if (val == 0)
val = default;
return val;
}