lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20101207224039.GP10623@bicker>
Date:	Wed, 8 Dec 2010 01:40:40 +0300
From:	Dan Carpenter <error27@...il.com>
To:	Peter Huewe <peterhuewe@....de>
Cc:	Greg Kroah-Hartman <gregkh@...e.de>, Joe Perches <joe@...ches.com>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging/udlfb: Fix sparse warning 'Using plain integer
 as NULL pointer'

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ