Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757331AbcLRRka (ORCPT ); Sun, 18 Dec 2016 12:40:30 -0500 Received: from smtprelay0010.hostedemail.com ([216.40.44.10]:37389 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753253AbcLRRk3 (ORCPT ); Sun, 18 Dec 2016 12:40:29 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:69:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3871:3872:4321:5007:6119:7808:7903:8957:10004:10400:10848:11026:11232:11658:11914:12043:12438:12555:12679:12683:12740:12760:12895:13161:13229:13439:14096:14097:14181:14659:14721:21080:21324:21433:21451,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:4,LUA_SUMMARY:none X-HE-Tag: tiger87_784df8c999212 X-Filterd-Recvd-Size: 2990 Message-ID: <1482082825.2431.5.camel@perches.com> Subject: Re: [PATCH] staging: emxx_udc: Fix CamelCase styling issue From: Joe Perches To: Afonso Bordado , gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Sun, 18 Dec 2016 09:40:25 -0800 In-Reply-To: <20161218164650.pgrls6ead7jfgyj4@AYYLMAO> References: <20161218164650.pgrls6ead7jfgyj4@AYYLMAO> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2165 Lines: 60 On Sun, 2016-12-18 at 16:46 +0000, Afonso Bordado wrote: > Converts from CamelCase to the recommended style. > > Signed-off-by: Afonso Bordado > --- > drivers/staging/emxx_udc/emxx_udc.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c > index 3f42fa8..cf5cdd8 100644 > --- a/drivers/staging/emxx_udc/emxx_udc.c > +++ b/drivers/staging/emxx_udc/emxx_udc.c > @@ -553,25 +553,25 @@ static void _nbu2ss_dma_unmap_single( > > /*-------------------------------------------------------------------------*/ > /* Endpoint 0 OUT Transfer (PIO) */ > -static int EP0_out_PIO(struct nbu2ss_udc *udc, u8 *pBuf, u32 length) > +static int EP0_out_PIO(struct nbu2ss_udc *udc, u8 *p_buf, u32 length) > { > u32 i; > int nret = 0; > - u32 iWordLength = 0; > - union usb_reg_access *pBuf32 = (union usb_reg_access *)pBuf; > + u32 i_word_length = 0; > + union usb_reg_access *p_buf32 = (union usb_reg_access *)p_buf; > > /*------------------------------------------------------------*/ > /* Read Length */ > - iWordLength = length / sizeof(u32); > + i_word_length = length / sizeof(u32); > > /*------------------------------------------------------------*/ > /* PIO Read */ > - if (iWordLength) { > - for (i = 0; i < iWordLength; i++) { > - pBuf32->dw = _nbu2ss_readl(&udc->p_regs->EP0_READ); > - pBuf32++; > + if (i_word_length) { > + for (i = 0; i < i_word_length; i++) { > + p_buf32->dw = _nbu2ss_readl(&udc->p_regs->EP0_READ); > + p_buf32++; > } > - nret = iWordLength * sizeof(u32); > + nret = i_word_length * sizeof(u32); > } > > return nret; Instead of merely converting Hungarian CamelCase to lowercase with underscores where word transitions occurred, try reading the code and making sense of what it does to perhaps find a better variable name instead. Maybe eliminate the variable altogether. iWordLength could be reads or numreads btw: what happens if length is not a multiple of sizeof(u32)? nret is more commonly ret p_buf is also not common linux naming, buf is more common.