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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> ---
>  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

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux