Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751734AbbHEF0i (ORCPT ); Wed, 5 Aug 2015 01:26:38 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34406 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750809AbbHEF0h (ORCPT ); Wed, 5 Aug 2015 01:26:37 -0400 Date: Wed, 5 Aug 2015 10:56:30 +0530 From: Sudip Mukherjee To: Adrian Remonda Cc: devel@driverdev.osuosl.org, christian.gromm@microchip.com, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCHv5 2/5] Staging: most: mostcore/core.c. Fix "Using plain integer as NULL pointer" warnings Message-ID: <20150805052630.GB4958@sudip-pc> References: <1438713895-5961-1-git-send-email-adrianremonda@gmail.com> <1438713895-5961-2-git-send-email-adrianremonda@gmail.com> <1438713895-5961-3-git-send-email-adrianremonda@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438713895-5961-3-git-send-email-adrianremonda@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1136 Lines: 29 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 > --- > 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/