public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Devin Heitmueller <dheitmueller@hauppauge.com>
To: Peter Huewe <peterhuewe@gmx.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
	Sri Deevi <Srinivasa.Deevi@conexant.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] video/cx231xx:  Fix sparse warning: Using plain integer as NULL pointer
Date: Tue, 25 Jan 2011 16:23:11 -0500	[thread overview]
Message-ID: <4D3F3F3F.2020308@hauppauge.com> (raw)
In-Reply-To: <1295987932-19785-1-git-send-email-peterhuewe@gmx.de>

On 01/25/2011 03:38 PM, Peter Huewe wrote:
>
> This patch fixes the warning "Using plain integer as NULL pointer",
> generated by sparse, by replacing the offending 0s with NULL.
>
> KernelVersion: linus' tree-c723fdab
>
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> ---
>  drivers/media/video/cx231xx/cx231xx-417.c   |    4 ++--
>  drivers/media/video/cx231xx/cx231xx-cards.c |   16 ++++++++--------
>  2 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/media/video/cx231xx/cx231xx-417.c 
> b/drivers/media/video/cx231xx/cx231xx-417.c
> index fc9526a..f8f0e59 100644
> --- a/drivers/media/video/cx231xx/cx231xx-417.c
> +++ b/drivers/media/video/cx231xx/cx231xx-417.c
> @@ -942,13 +942,13 @@ static int cx231xx_load_firmware(struct cx231xx 
> *dev)
>
>         p_current_fw = vmalloc(1884180 * 4);
>         p_fw = p_current_fw;
> -       if (p_current_fw == 0) {
> +       if (p_current_fw == NULL) {
>                 dprintk(2, "FAIL!!!\n");
>                 return -1;
>         }
>
>         p_buffer = vmalloc(4096);
> -       if (p_buffer == 0) {
> +       if (p_buffer == NULL) {
>                 dprintk(2, "FAIL!!!\n");
>                 return -1;
>         }
> diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c 
> b/drivers/media/video/cx231xx/cx231xx-cards.c
> index 588f3e8..5b9b5f4 100644
> --- a/drivers/media/video/cx231xx/cx231xx-cards.c
> +++ b/drivers/media/video/cx231xx/cx231xx-cards.c
> @@ -357,19 +357,19 @@ struct cx231xx_board cx231xx_boards[] = {
>                         .type = CX231XX_VMUX_TELEVISION,
>                         .vmux = CX231XX_VIN_3_1,
>                         .amux = CX231XX_AMUX_VIDEO,
> -                       .gpio = 0,
> +                       .gpio = NULL,
>                 }, {
>                         .type = CX231XX_VMUX_COMPOSITE1,
>                         .vmux = CX231XX_VIN_2_1,
>                         .amux = CX231XX_AMUX_LINE_IN,
> -                       .gpio = 0,
> +                       .gpio = NULL,
>                 }, {
>                         .type = CX231XX_VMUX_SVIDEO,
>                         .vmux = CX231XX_VIN_1_1 |
>                                 (CX231XX_VIN_1_2 << 8) |
>                                 CX25840_SVIDEO_ON,
>                         .amux = CX231XX_AMUX_LINE_IN,
> -                       .gpio = 0,
> +                       .gpio = NULL,
>                 } },
>         },
>         [CX231XX_BOARD_HAUPPAUGE_USBLIVE2] = {
> @@ -386,14 +386,14 @@ struct cx231xx_board cx231xx_boards[] = {
>                         .type = CX231XX_VMUX_COMPOSITE1,
>                         .vmux = CX231XX_VIN_2_1,
>                         .amux = CX231XX_AMUX_LINE_IN,
> -                       .gpio = 0,
> +                       .gpio = NULL,
>                 }, {
>                         .type = CX231XX_VMUX_SVIDEO,
>                         .vmux = CX231XX_VIN_1_1 |
>                                 (CX231XX_VIN_1_2 << 8) |
>                                 CX25840_SVIDEO_ON,
>                         .amux = CX231XX_AMUX_LINE_IN,
> -                       .gpio = 0,
> +                       .gpio = NULL,
>                 } },
>         },
>         [CX231XX_BOARD_PV_PLAYTV_USB_HYBRID] = {
> @@ -420,19 +420,19 @@ struct cx231xx_board cx231xx_boards[] = {
>                         .type = CX231XX_VMUX_TELEVISION,
>                         .vmux = CX231XX_VIN_3_1,
>                         .amux = CX231XX_AMUX_VIDEO,
> -                       .gpio = 0,
> +                       .gpio = NULL,
>                 }, {
>                         .type = CX231XX_VMUX_COMPOSITE1,
>                         .vmux = CX231XX_VIN_2_1,
>                         .amux = CX231XX_AMUX_LINE_IN,
> -                       .gpio = 0,
> +                       .gpio = NULL,
>                 }, {
>                         .type = CX231XX_VMUX_SVIDEO,
>                         .vmux = CX231XX_VIN_1_1 |
>                                 (CX231XX_VIN_1_2 << 8) |
>                                 CX25840_SVIDEO_ON,
>                         .amux = CX231XX_AMUX_LINE_IN,
> -                       .gpio = 0,
> +                       .gpio = NULL,
>                 } },
>         },
>  };
> -- 
> 1.7.2.2
>
Reviewed-by: Devin Heitmueller <dheitmueller@hauppauge.com>

-- 
Devin Heitmueller
Senior Software Engineer
Hauppauge Computer Works


  reply	other threads:[~2011-01-25 21:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25 20:38 [PATCH] video/cx231xx: Fix sparse warning: Using plain integer as NULL pointer Peter Huewe
2011-01-25 21:23 ` Devin Heitmueller [this message]
2011-01-25 21:38 ` Sri Deevi

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=4D3F3F3F.2020308@hauppauge.com \
    --to=dheitmueller@hauppauge.com \
    --cc=Srinivasa.Deevi@conexant.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=peterhuewe@gmx.de \
    --cc=sfr@canb.auug.org.au \
    /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