Commit a86581829fdd646655116f89cb8af2f22b5fbf9e
Committed by
Greg Kroah-Hartman
1 parent
a5e4b81e27
Exists in
master
and in
6 other branches
Staging: bcm: Fix three initialization errors in InterfaceDld.c
This patch fixes three initialization errors. One is an incorrect initialization of a static variable. The other two are incorrect initializations in an if statement. These errors were found by checkpatch.pl. Signed-off-by: Kevin McKinney <klmckinney1@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 5 additions and 4 deletions Side-by-side Diff
drivers/staging/bcm/InterfaceDld.c
... | ... | @@ -59,7 +59,7 @@ |
59 | 59 | mm_segment_t oldfs = {0}; |
60 | 60 | int errno = 0, len = 0, is_config_file = 0; |
61 | 61 | loff_t pos = 0; |
62 | - static int fw_down = 0; | |
62 | + static int fw_down; | |
63 | 63 | INT Status = STATUS_SUCCESS; |
64 | 64 | PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)arg; |
65 | 65 | |
66 | 66 | |
... | ... | @@ -136,9 +136,9 @@ |
136 | 136 | B_UINT32 value = 0; |
137 | 137 | |
138 | 138 | if (Adapter->pstargetparams == NULL) { |
139 | - if ((Adapter->pstargetparams = kmalloc(sizeof(STARGETPARAMS), GFP_KERNEL)) == NULL) { | |
139 | + Adapter->pstargetparams = kmalloc(sizeof(STARGETPARAMS), GFP_KERNEL); | |
140 | + if (Adapter->pstargetparams == NULL) | |
140 | 141 | return -ENOMEM; |
141 | - } | |
142 | 142 | } |
143 | 143 | |
144 | 144 | if (psFwInfo->u32FirmwareLength != sizeof(STARGETPARAMS)) |
... | ... | @@ -317,7 +317,8 @@ |
317 | 317 | break; |
318 | 318 | } |
319 | 319 | |
320 | - if (STATUS_SUCCESS != (retval = bcm_compare_buff_contents(readbackbuff, mappedbuffer, len))) | |
320 | + retval = bcm_compare_buff_contents(readbackbuff, mappedbuffer, len); | |
321 | + if (STATUS_SUCCESS != retval) | |
321 | 322 | break; |
322 | 323 | |
323 | 324 | u32StartingAddress += len; |