Re: [PATCH] staging/udlfb: Fix sparse warning 'Using plain integer as NULL pointer'

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

 



On Tue, Dec 07, 2010 at 11:16:41PM +0100, Peter Huewe wrote:
>  	while ((pixel_end > pixel) &&
>  	       (cmd_buffer_end - MIN_RLX_CMD_BYTES > cmd)) {
> -		uint8_t *raw_pixels_count_byte = 0;
> -		uint8_t *cmd_pixels_count_byte = 0;
> -		const uint16_t *raw_pixel_start = 0;
> -		const uint16_t *cmd_pixel_start, *cmd_pixel_end = 0;
> +		uint8_t *raw_pixels_count_byte = NULL;
> +		uint8_t *cmd_pixels_count_byte = NULL;
> +		const uint16_t *raw_pixel_start = NULL;
> +		const uint16_t *cmd_pixel_start, *cmd_pixel_end = NULL;
>  

It would be better to delete these.  The assignments are pointless and
may well end up generating warnings in future versions of gcc.  (Maybe
it already does with beta versions of gcc?)

> -		struct fb_videomode fb_vmode = {0};
> +		struct fb_videomode fb_vmode = {NULL};

Just do this:
		struct fb_videomode fb_vmode = {};

>  	struct usb_device *usbdev;
> -	struct dlfb_data *dev = 0;
> -	struct fb_info *info = 0;
> +	struct dlfb_data *dev = NULL;
> +	struct fb_info *info = NULL;
>  	int retval = -ENOMEM;
>  	int i;

You could leave dev uninitialized here again.

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