X-GM-THRID: 6202847107501522944 X-Received: by 10.112.158.202 with SMTP id ww10mr119241lbb.13.1444217622318; Wed, 07 Oct 2015 04:33:42 -0700 (PDT) X-BeenThere: outreachy-kernel@googlegroups.com Received: by 10.180.106.73 with SMTP id gs9ls302697wib.2.canary; Wed, 07 Oct 2015 04:33:41 -0700 (PDT) X-Received: by 10.181.29.103 with SMTP id jv7mr274993wid.0.1444217621776; Wed, 07 Oct 2015 04:33:41 -0700 (PDT) Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr. [192.134.164.83]) by gmr-mx.google.com with ESMTPS id w4si101617wiz.0.2015.10.07.04.33.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Oct 2015 04:33:41 -0700 (PDT) Received-SPF: neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) client-ip=192.134.164.83; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.134.164.83 is neither permitted nor denied by domain of julia.lawall@lip6.fr) smtp.mailfrom=julia.lawall@lip6.fr X-IronPort-AV: E=Sophos;i="5.17,648,1437429600"; d="scan'208";a="181540109" Received: from 089-101-192072.ntlworld.ie (HELO hadrien.local) ([89.101.192.72]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 07 Oct 2015 13:33:41 +0200 Date: Wed, 7 Oct 2015 12:33:32 +0100 (IST) From: Julia Lawall X-X-Sender: jll@hadrien To: Shivani Bhardwaj cc: outreachy-kernel@googlegroups.com Subject: Re: [Outreachy kernel] [PATCH] Staging: most: video: Changed the return value integer to NULL In-Reply-To: <20151007113026.GA51614@ubuntu> Message-ID: References: <20151007101433.GA50144@ubuntu> <20151007113026.GA51614@ubuntu> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Wed, 7 Oct 2015, Shivani Bhardwaj wrote: > On Wed, Oct 07, 2015 at 12:15:11PM +0100, Julia Lawall wrote: > > On Wed, 7 Oct 2015, Shivani Bhardwaj wrote: > > > > > Fixed the sparse warning : Using plain integer as NULL pointer, by > > > changing the return value of function *get_aim_dev(struct, int) from 0 > > > to NULL. > > > > If you want, you could try doing this sort of thing with Coccinelle. An > > easy case is the assignment case. The following would find an assignment > > where the type is a pointer and the value is 0: > > > > @@ > > type T; > > T *x; > > @@ > > > > x = > > - 0 > > + NULL > > > > This makes a rule where T is an arbitrary type and x is an expression that > > has type pointer to type T. Then it searches for an assignment where > > there is this pointer typed expression on the left side and 0 on the right > > side, and then makes the change. > > > > The function return case is a bit more complicated, because you have to > > find the function return type and the return statement, which are not > > right next to each other. But it can be done as well. > > > > You can find out more at the Coccinelle web site: coccinelle.lip6.fr. > > There are some tutorials at the papers and slides link. > > > > julia > > > Thanks, Julia! Is this patch not acceptable? The patch looks fine :) It was just something else to try. julia > > > > > > Signed-off-by: Shivani Bhardwaj > > > --- > > > drivers/staging/most/aim-v4l2/video.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/staging/most/aim-v4l2/video.c b/drivers/staging/most/aim-v4l2/video.c > > > index d968791..8333245 100644 > > > --- a/drivers/staging/most/aim-v4l2/video.c > > > +++ b/drivers/staging/most/aim-v4l2/video.c > > > @@ -430,7 +430,7 @@ static struct most_video_dev *get_aim_dev( > > > } > > > } > > > spin_unlock(&list_lock); > > > - return 0; > > > + return NULL; > > > } > > > > > > static int aim_rx_data(struct mbo *mbo) > > > -- > > > 2.1.0 > > > > > > -- > > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > > > To post to this group, send email to outreachy-kernel@googlegroups.com. > > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151007101433.GA50144%40ubuntu. > > > For more options, visit https://groups.google.com/d/optout. > > > > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To post to this group, send email to outreachy-kernel@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20151007113026.GA51614%40ubuntu. > For more options, visit https://groups.google.com/d/optout. >