From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752461AbbDSB2Z (ORCPT ); Sat, 18 Apr 2015 21:28:25 -0400 Received: from smtprelay0097.hostedemail.com ([216.40.44.97]:51843 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751299AbbDSB2Y (ORCPT ); Sat, 18 Apr 2015 21:28:24 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 10,1,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:196:355:379:541:599:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1622:1711:1730:1747:1777:1792:1981:2194:2199:2393:2553:2559:2562:2828:2914:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3871:3872:3873:3874:4321:5007:6119:6261:7875:7903:8603:10004:10400:10450:10455:10848:11026:11232:11658:11914:12043:12296:12438:12517:12519:12679:12740:13069:13161:13229:13255:13311:13357:19904:19999:21080,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 X-HE-Tag: north02_832dae3f57d05 X-Filterd-Recvd-Size: 2843 Message-ID: <1429406900.2947.16.camel@perches.com> Subject: Re: [PATCH 2/2] Staging: dgnc: fixed code style issues, mainly line width issues. From: Joe Perches To: Yorick Rommers Cc: gregkh@linuxfoundation.org, markh@compro.net, lidza.louina@gmail.com, driverdev-devel@linuxdriverproject.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Date: Sat, 18 Apr 2015 18:28:20 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 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 On Sun, 2015-04-19 at 02:04 +0200, Yorick Rommers wrote: > A patch for dgnc_mgmt.c and dgnc_neo.c to fix some code style issues. trivial notes: Try breaking up the patches you send into more discrete chucks that do just one thing, not mostly one thing and some other things. > diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c [] > @@ -148,7 +148,9 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg) > di.info_bdstate = dgnc_Board[brd]->dpastatus; > di.info_ioport = 0; > di.info_physaddr = (ulong) dgnc_Board[brd]->membase; > - di.info_physsize = (ulong) dgnc_Board[brd]->membase - dgnc_Board[brd]->membase_end; It may be better to use a temporary for brd like: struct dgnc_board *bd = dgnc_Board[brd]; as is done a few other places. > + di.info_physsize = > + (ulong) dgnc_Board[brd]->membase - dgnc_Board[brd]->membase_end; so this becomes di.info->physsize = bd->membase - bd->membase_end; though I wonder if this is a defect and size should be bd->membase_end - bd->membase + 1 It doesn't need a cast as membase and membase_end are ulong already. It also seems this physsize variable isn't used. > diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c [] > @@ -79,7 +79,8 @@ struct board_ops dgnc_neo_ops = { > .send_immediate_char = neo_send_immediate_char > }; > > -static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; > +static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, > +0x10, 0x20, 0x40, 0x80 }; That's less attractive then what's already there. The generic kernel form for an array declaration would be: static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; This also would be better as static const. I stopped reading here.