From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755077AbbFERSF (ORCPT ); Fri, 5 Jun 2015 13:18:05 -0400 Received: from smtprelay0033.hostedemail.com ([216.40.44.33]:58845 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751939AbbFERSC (ORCPT ); Fri, 5 Jun 2015 13:18:02 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3871:3872:3873:3874:4250:4321:4605:5007:6119:6261:7875:7903:10004:10400:10848:11026:11232:11233:11473:11658:11914:12043:12295:12438:12517:12519:12740:13069:13076:13311:13357:21060:21080:21088,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: cloth33_62e8c023ba810 X-Filterd-Recvd-Size: 2794 Message-ID: <1433524678.2658.70.camel@perches.com> Subject: Re: [PATCH 1/9] input: goodix: fix alignment issues From: Joe Perches To: Dmitry Torokhov Cc: Irina Tirdea , Bastien Nocera , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 05 Jun 2015 10:17:58 -0700 In-Reply-To: <20150605164901.GE26708@dtor-ws> References: <1432817265-23891-1-git-send-email-irina.tirdea@intel.com> <1432817265-23891-2-git-send-email-irina.tirdea@intel.com> <20150605164901.GE26708@dtor-ws> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 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 Fri, 2015-06-05 at 09:49 -0700, Dmitry Torokhov wrote: > Hi Irina, > > On Thu, May 28, 2015 at 03:47:37PM +0300, Irina Tirdea wrote: > > Fix alignment to match open parenthesis detected by > > running checkpatch.pl --strict. > > Mixed bag of changes here, but that's checkpatch for you. Yup, checkpatch output is definitely a mix of automated semi-competence and brain-deadness. > > diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c [] > > @@ -112,7 +112,7 @@ static int goodix_ts_read_input_report(struct goodix_ts_data *ts, u8 *data) > > data += 1 + GOODIX_CONTACT_SIZE; > > error = goodix_i2c_read(ts->client, > > GOODIX_READ_COOR_ADDR + > > - 1 + GOODIX_CONTACT_SIZE, > > + 1 + GOODIX_CONTACT_SIZE, > > Bad - makes 1 + GOODIX_CONTACT_SIZE look like extra argument, not > continuation of expression. There's no great way to do this. Parentheses around the longer expression work. error = goodix_i2c_read(ts->client, (GOODIX_READ_COOR_ADDR + 1 + GOODIX_CONTACT_SIZE), Exceeding 80 columns may be better. Leaving it alone would be OK too. Maybe starting with 1 to be more similar to the below would be better. > > @@ -157,7 +157,8 @@ static void goodix_process_events(struct goodix_ts_data *ts) > > > > for (i = 0; i < touch_num; i++) > > goodix_ts_report_touch(ts, > > - &point_data[1 + GOODIX_CONTACT_SIZE * i]); > > + &point_data[1 + > > + GOODIX_CONTACT_SIZE * i]); > > No, this is plain ugly. Sometimes it's better to exceed 80 columns or maybe use temporaries. Something like: u8 *tmp = point_data + 1; ... for (i = 0; i < touch_num; i++, tmp += GOODIX_CONTACT_SIZE) goodix_ts_report_touch(ts, tmp);