[PATCH 9/9] Staging: bcm: Fix one white space and two initialization errors in InterfaceDld.c

Kevin McKinney klmckinney1 at gmail.com
Mon Oct 17 20:37:54 UTC 2011


Hi Dan,

On Mon, Oct 17, 2011 at 4:29 PM, Dan Carpenter <dan.carpenter at oracle.com> wrote:
> On Mon, Oct 17, 2011 at 04:15:17PM -0400, Kevin McKinney wrote:
>> This patch fixes one white space issue and two
>> initialization errors in file, InterfaceDld.c,
>> found by checkpatch.pl.
>>
>> Signed-off-by: Kevin McKinney <klmckinney1 at gmail.com>
>> ---
>>  drivers/staging/bcm/InterfaceDld.c |   11 +++++++----
>>  1 files changed, 7 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/bcm/InterfaceDld.c b/drivers/staging/bcm/InterfaceDld.c
>> index 6f58fb5..7ac52ad 100644
>> --- a/drivers/staging/bcm/InterfaceDld.c
>> +++ b/drivers/staging/bcm/InterfaceDld.c
>> @@ -38,17 +38,18 @@ int InterfaceFileDownload(PVOID arg, struct file *flp, unsigned int on_chip_loc)
>>       return errno;
>>  }
>>
>> -int InterfaceFileReadbackFromChip(PVOID arg, struct file *flp,       unsigned int on_chip_loc)
>> +int InterfaceFileReadbackFromChip(PVOID arg, struct file *flp, unsigned int on_chip_loc)
>>  {
>>       char *buff, *buff_readback;
>>       unsigned int reg = 0;
>>       mm_segment_t oldfs = {0};
>>       int errno = 0, len = 0, is_config_file = 0;
>>       loff_t pos = 0;
>> -     static int fw_down = 0;
>> +     static int fw_down;
>>       INT Status = STATUS_SUCCESS;
>>       PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)arg;
>>
>> +     fw_down = 0;
>
> This will break things.
>
> Check patch is complaining because static variables are initialized
> to zero by default, so the extra initializer servers no purpose.
> fw_down is supposed to count things, but your patch always sets it
> to zero.
>
> http://en.wikipedia.org/wiki/Static_variable
>
Okay, fixing now..  I did not realize fw_down would be set to zero
multiple times.  I will submit a new set of patches.  Thanks for
catching this error...

Thanks,
Kevin
>
>



More information about the devel mailing list