public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Peter Huewe <peterhuewe@gmx.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Joe Perches <joe@perches.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging/udlfb: Fix sparse warning 'Using plain integer as NULL pointer'
Date: Wed, 8 Dec 2010 01:40:40 +0300	[thread overview]
Message-ID: <20101207224039.GP10623@bicker> (raw)
In-Reply-To: <1291760201-18531-1-git-send-email-peterhuewe@gmx.de>

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

      reply	other threads:[~2010-12-07 22:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 22:16 [PATCH] staging/udlfb: Fix sparse warning 'Using plain integer as NULL pointer' Peter Huewe
2010-12-07 22:40 ` Dan Carpenter [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101207224039.GP10623@bicker \
    --to=error27@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox