From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933584AbcJMQ6E (ORCPT ); Thu, 13 Oct 2016 12:58:04 -0400 Received: from smtprelay0143.hostedemail.com ([216.40.44.143]:60404 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933013AbcJMQ55 (ORCPT ); Thu, 13 Oct 2016 12:57:57 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:967:973:982:988:989:1260:1263:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1543:1593:1594:1605:1711:1730:1747:1777:1792:2393:2525:2553:2560:2563:2682:2685:2828:2859:2903:2911:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:4425:4605:5007:6117:6119:7903:8985:9010:9025:9388:10004:10400:10471:10848:11026:11232:11320:11658:11914:12043:12296:12438:12555:12682:12731:12737:12740:12776:12933:12937:13255:13439:13894:14106:14181:14659:14721:14849:21080:21324:30029:30030:30054:30056:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: body57_71b4b07bb7844 X-Filterd-Recvd-Size: 4209 Message-ID: <1476377780.2164.17.camel@perches.com> Subject: Re: Re: [PATCH] staging:vt6656:baseband.h: fix function definition argument without identifier name issue From: Joe Perches To: Greg KH , Julia Lawall Cc: Mikhail Golubev , Andrew Morton , devel@driverdev.osuosl.org, forest@alittletooquiet.net, linux-kernel@vger.kernel.org Date: Thu, 13 Oct 2016 09:56:20 -0700 In-Reply-To: <20161013164927.GA15120@kroah.com> References: <1476359418-12842-1-git-send-email-golubev.mikhail@gmail.com> <20161013120602.GA13968@kroah.com> <20161013142345.GA17219@mike-ubuntu> <20161013145752.GB20947@kroah.com> <1476376643.2164.14.camel@perches.com> <20161013164927.GA15120@kroah.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.0-2ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-10-13 at 18:49 +0200, Greg KH wrote: > On Thu, Oct 13, 2016 at 09:37:23AM -0700, Joe Perches wrote: > > On Thu, 2016-10-13 at 16:57 +0200, Greg KH wrote: > > > On Thu, Oct 13, 2016 at 05:23:45PM +0300, Mikhail Golubev wrote: > > > > On Thu, Oct 13, 2016 at 02:06:02PM +0200, Greg KH wrote: > > > > > On Thu, Oct 13, 2016 at 02:50:18PM +0300, Mikhail Golubev wrote: > > > > > > Function definitions arguments should also have an identifier name as reported by checkpatch.pl. > > > > [] > > > > > > diff --git a/drivers/staging/vt6656/baseband.h b/drivers/staging/vt6656/baseband.h > > > > [] > > > > > > @@ -86,15 +86,15 @@ struct vnt_phy_field { > > > > > > unsigned int vnt_get_frame_time(u8 preamble_type, u8 pkt_type, > > > > > > unsigned int frame_length, u16 tx_rate);p > > > > > > > > > > > > -void vnt_get_phy_field(struct vnt_private *, u32 frame_length, > > > > > > - u16 tx_rate, u8 pkt_type, struct vnt_phy_field *); > > > > > > - > > > > > > -void vnt_set_short_slot_time(struct vnt_private *); > > > > > > -void vnt_set_vga_gain_offset(struct vnt_private *, u8); > > > > > > -void vnt_set_antenna_mode(struct vnt_private *, u8); > > > > > > -int vnt_vt3184_init(struct vnt_private *); > > > > > > -void vnt_set_deep_sleep(struct vnt_private *); > > > > > > -void vnt_exit_deep_sleep(struct vnt_private *); > > > > > > -void vnt_update_pre_ed_threshold(struct vnt_private *, int scanning); > > > > > > +void vnt_get_phy_field(struct vnt_private *priv, u32 frame_length, > > > > > > + u16 tx_rate, u8 pkt_type, struct vnt_phy_field *phy); > > > > > > + > > > > > > > > > > Really? Since when is this a coding style requirement? > > > > > > > > This requirement is really new. It was proposed by Joe Perches at 26 Sep 2016: > > > > [PATCH] checkpatch: Add warning for unnamed function definition. > > > > > > > > Should this type of warnings be fixed here? > > > > > > Ugh, Joe, why did you add this option? > > > > > > 1. Most all kernel prototypes use named arguments. > > 2. It helps make header files easier to read/lookup with grep. > > > > int func(int, int, int) > > vs > > int func(int weight, int density, int mass) > > > > which is easier for humans to use? > > > Yes, which is why I use that format, but is it something we are now > going to suddenly require? > > Also, this is going to take a lot more work to review patches like this, > to match up the variable names to ensure that the developer got it > right... Coccinelle to the rescue... http://www.spinics.net/lists/linux-kernel-janitors/msg28450.html Julia Lawall wrote a script for that. Unfortunately, it doesn't currently span .h and .c files --- @r@ identifier f; position p; type T, t; parameter list[n] ps; @@ T f@p(ps,t,...); @s@ identifier r.f,x; type r.T, r.t; parameter list[r.n] ps; @@ T f(ps,t x,...) { ... } @@ identifier r.f, s.x; position r.p; type r.T, r.t; parameter list[r.n] ps; @@ T f@p(ps,t + x   ,...);