Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1200413

Re: [PATCHv5 2/5] Staging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings

From Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCHv5 2/5] Staging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings
Date 2015-08-05 07:30 +0200
Message-ID <pTZr4-89-5@gated-at.bofh.it> (permalink)
References <pTPrH-23h-3@gated-at.bofh.it> <pTPrH-23h-5@gated-at.bofh.it> <pTPrH-23h-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Aug 04, 2015 at 08:44:52PM +0200, Adrian Remonda wrote:
> This patch fixes the warning generated by sparse: "Using plain integer
> as NULL pointer" by replacing the offending 0 with NULL.
> 
> Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
> ---
>  drivers/staging/most/mostcore/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
> index b8871364169c..383e06968b41 100644
> --- a/drivers/staging/most/mostcore/core.c
> +++ b/drivers/staging/most/mostcore/core.c
> @@ -982,7 +982,7 @@ static ssize_t store_add_link(struct most_aim_obj *aim_obj,
>  	if (ret)
>  		return ret;
>  
> -	if (mdev_devnod == 0 || *mdev_devnod == 0) {
> +	if (mdev_devnod == NULL || *mdev_devnod == 0) {
Usually we write the NULL test as:
if (!mdev_devnod || *mdev_devnod == 0)

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv5 0/5] Staging: most: several warnings fix reported by sparse Adrian Remonda <adrianremonda@gmail.com> - 2015-08-04 20:50 +0200
  [PATCHv5 5/5] Staging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings Adrian Remonda <adrianremonda@gmail.com> - 2015-08-04 20:50 +0200
  [PATCHv5 3/5] Staging: most: hdm-usb/hdm_usb.c. Fix "missing static keyword" warnings Adrian Remonda <adrianremonda@gmail.com> - 2015-08-04 20:50 +0200
    [PATCHv5 4/5] Staging: most: hdm-dim2/dim2_hal.c. Fix "Using plain integer as NULL pointer" warnings Adrian Remonda <adrianremonda@gmail.com> - 2015-08-04 20:50 +0200
    Re: [PATCHv5 3/5] Staging: most: hdm-usb/hdm_usb.c. Fix "missing  static keyword" warnings Christian Gromm <christian.gromm@microchip.com> - 2015-08-05 22:10 +0200
  [PATCHv5 2/5] Staging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings Adrian Remonda <adrianremonda@gmail.com> - 2015-08-04 20:50 +0200
    Re: [PATCHv5 2/5] Staging: most: mostcore/core.c. Fix "Using plain  integer as NULL pointer" warnings Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-05 07:30 +0200
  [PATCHv5 1/5] Staging: most: mostcore/core.c. Fix "missing static keyword" warnings Adrian Remonda <adrianremonda@gmail.com> - 2015-08-04 20:50 +0200
    Re: [PATCHv5 1/5] Staging: most: mostcore/core.c. Fix "missing  static keyword" warnings Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2015-08-05 07:30 +0200

csiph-web