Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755293AbdCaSuc (ORCPT ); Fri, 31 Mar 2017 14:50:32 -0400 Received: from smtprelay0013.hostedemail.com ([216.40.44.13]:35462 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753555AbdCaSua (ORCPT ); Fri, 31 Mar 2017 14:50:30 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:2:41:69:355:379:541:599:800:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1535:1593:1594:1605:1606:1730:1747:1777:1792:1801:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3622:3865:3868:3870:3871:3873:3874:4117:4321:4605:5007:7514:9121:9149:10004:10848:11026:11232:11233:11473:11658:11914:12043:12296:12438:12555:12663:12683:12740:12760:12895:13138:13161:13229:13231:13439:13972:14659:21080:21433:21451:30003:30012:30029:30054:30060:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: fruit38_20ea08f3ec657 X-Filterd-Recvd-Size: 6713 Message-ID: <1490986224.27353.20.camel@perches.com> Subject: Re: [PATCH 1/3] iio: health: afe440x: Remove code in comments From: Joe Perches To: SIMRAN SINGHAL Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Linux Kernel Mailing List Date: Fri, 31 Mar 2017 11:50:24 -0700 In-Reply-To: References: <1490978804-25549-1-git-send-email-singhalsimran0@gmail.com> <1490978804-25549-2-git-send-email-singhalsimran0@gmail.com> <1490985230.27353.18.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.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 Content-Length: 5441 Lines: 109 On Sat, 2017-04-01 at 00:13 +0530, SIMRAN SINGHAL wrote: > On Sat, Apr 1, 2017 at 12:03 AM, Joe Perches wrote: > > On Fri, 2017-03-31 at 22:16 +0530, simran singhal wrote: > > > Commenting out code is a bad idea. > > > As comments are for explaining what code is about. > > > > patch doesn't match commit message. > > In commit message I am clearly saying commenting out the code is a bad Idea. > As comments are for explaining what code is about. > And that's what I am doing in the patch deleting the commented codes. > > My subject also says "Remove code in comments" > > Than what is not matching? Read your own patch. You are removing #defines not comments. If the whole thing is in comments, then the #defines immediately above what you are removing should also be deleted. > > > > > Signed-off-by: simran singhal > > > --- > > > drivers/iio/health/afe440x.h | 58 -------------------------------------------- > > > 1 file changed, 58 deletions(-) > > > > > > diff --git a/drivers/iio/health/afe440x.h b/drivers/iio/health/afe440x.h > > > index 1a0f247..71e2f0e 100644 > > > --- a/drivers/iio/health/afe440x.h > > > +++ b/drivers/iio/health/afe440x.h > > > @@ -88,56 +88,11 @@ > > > #define AFE440X_CONTROL0_WRITE 0x0 > > > #define AFE440X_CONTROL0_READ 0x1 > > > > > > -#define AFE440X_INTENSITY_CHAN(_index, _mask) \ > > > - { \ > > > - .type = IIO_INTENSITY, \ > > > - .channel = _index, \ > > > - .address = _index, \ > > > - .scan_index = _index, \ > > > - .scan_type = { \ > > > - .sign = 's', \ > > > - .realbits = 24, \ > > > - .storagebits = 32, \ > > > - .endianness = IIO_CPU, \ > > > - }, \ > > > - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ > > > - _mask, \ > > > - .indexed = true, \ > > > - } > > > - > > > -#define AFE440X_CURRENT_CHAN(_index) \ > > > - { \ > > > - .type = IIO_CURRENT, \ > > > - .channel = _index, \ > > > - .address = _index, \ > > > - .scan_index = -1, \ > > > - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ > > > - BIT(IIO_CHAN_INFO_SCALE), \ > > > - .indexed = true, \ > > > - .output = true, \ > > > - } > > > - > > > struct afe440x_val_table { > > > int integer; > > > int fract; > > > }; > > > > > > -#define AFE440X_TABLE_ATTR(_name, _table) \ > > > -static ssize_t _name ## _show(struct device *dev, \ > > > - struct device_attribute *attr, char *buf) \ > > > -{ \ > > > - ssize_t len = 0; \ > > > - int i; \ > > > - \ > > > - for (i = 0; i < ARRAY_SIZE(_table); i++) \ > > > - len += scnprintf(buf + len, PAGE_SIZE - len, "%d.%06u ", \ > > > - _table[i].integer, \ > > > - _table[i].fract); \ > > > - \ > > > - buf[len - 1] = '\n'; \ > > > - \ > > > - return len; \ > > > -} \ > > > static DEVICE_ATTR_RO(_name) > > > > > > struct afe440x_attr { > > > @@ -147,17 +102,4 @@ struct afe440x_attr { > > > unsigned int table_size; > > > }; > > > > > > -#define to_afe440x_attr(_dev_attr) \ > > > - container_of(_dev_attr, struct afe440x_attr, dev_attr) > > > - > > > -#define AFE440X_ATTR(_name, _field, _table) \ > > > - struct afe440x_attr afe440x_attr_##_name = { \ > > > - .dev_attr = __ATTR(_name, (S_IRUGO | S_IWUSR), \ > > > - afe440x_show_register, \ > > > - afe440x_store_register), \ > > > - .field = _field, \ > > > - .val_table = _table, \ > > > - .table_size = ARRAY_SIZE(_table), \ > > > - } > > > - > > > #endif /* _AFE440X_H */