Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp1997247lfo; Sat, 28 May 2022 13:10:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjzKtmrs76Yq0SU9hmVFizlgiwEJu5f1eO6kR9hL6B8w8tmir5CqTO3hGx2+h19dRHgMsc X-Received: by 2002:a17:902:a981:b0:156:229d:6834 with SMTP id bh1-20020a170902a98100b00156229d6834mr47563987plb.128.1653768654160; Sat, 28 May 2022 13:10:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653768654; cv=none; d=google.com; s=arc-20160816; b=M6TtyLzWde5HGTsNOP1SRGf31n89CcddQx9QpRFrSB8sPKLayZt6TfDaDjxB5avF+B gkAvvsu5y2q4KcBcAorYe+b2bGsjNWyHB91Teas3AHhuSHWkAypm5oYmeDxZM+i/WJAh I1VymnehSanY4QFsGvnJVhgBuDuFYr4LpO6MJONXpMOjrPEMBDlHgTsondoRg8tydYj9 QSxswGcWM3rbov7dsgYKpqmqvkn2FHWY+2NsT0mCFeYYzUrm8WEPa+mDDSWEuh1W5fHQ QMzta+F1jQqbYsJHtBD646TzR3qopjyUgNIBnRH6oDRmkT0sgrowRd95KXDiZR4WLloz yRkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=xp7eu17HisUXQ8QM1A5/89VKTgSwsfa4ULVuwTMuJyk=; b=yFdppSAdbzSmXGkKWrlbJgB+d97R3faXU8pvkafffsijyQsr+U8T7vZ5yYO1vnxC1g biyy4PjAQe79ZmY2QZf88+ASfQ1pmg0V4yQ6w1yAa2hJdAsyuNzfClrHE/27E0y1g7ye Pu6UGVin1i0FVgJOtfnvMDOOoLVl91iPZDgljdJQDG2iCA6AMO74bOLPwbmQwIkCveMx 9IEDBEcc3YldaE5uV8bXgPzyiSHyukfmB7b/fpe4C0Ee2AMKxdF9c63BPKcJWHb93YLw y5lKsdfG7Eak1D3nyF1IbMv3NWKMORdWuEDqOg3OtIhzrGoC/YRnzC22xIme3Gmo9EDp cTCg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a186-20020a624dc3000000b0050dfdded307si9961802pfb.31.2022.05.28.13.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:10:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C604D12FEFF; Sat, 28 May 2022 12:24:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231491AbiE1RhN convert rfc822-to-8bit (ORCPT + 99 others); Sat, 28 May 2022 13:37:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236088AbiE1RhL (ORCPT ); Sat, 28 May 2022 13:37:11 -0400 Received: from relay5.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CA39E93; Sat, 28 May 2022 10:37:10 -0700 (PDT) Received: from omf19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 15D0160F8D; Sat, 28 May 2022 17:37:09 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf19.hostedemail.com (Postfix) with ESMTPA id F17FB2002B; Sat, 28 May 2022 17:36:58 +0000 (UTC) Message-ID: <083c936b74c2a2aef678e7b89be22e00c596144f.camel@perches.com> Subject: Re: [PATCH 1/1] iio: Prefer octal over symbolic permissions. From: Joe Perches To: Jonathan Cameron , Joe Simmons-Talbott Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 28 May 2022 10:36:57 -0700 In-Reply-To: <20220528183405.22b55033@jic23-huawei> References: <20220527185651.465204-1-joetalbott@gmail.com> <20220528183405.22b55033@jic23-huawei> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.44.1-0ubuntu1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Rspamd-Server: rspamout08 X-Rspamd-Queue-Id: F17FB2002B X-Stat-Signature: efa8a1fko9joascwid7grn1mu5qj3w7e X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1/npUr6jS/AkRCw99c0tVLfC7u6v3NQBKs= X-HE-Tag: 1653759418-698807 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2022-05-28 at 18:34 +0100, Jonathan Cameron wrote: > On Fri, 27 May 2022 14:56:52 -0400 > Joe Simmons-Talbott wrote: > > As reported by checkpatch.pl use ocatl permissions rather than symbolic > > permissions. [] > Why the resend? Given change of description, I'm guessing this is v2 > because of feedback on a similar patch elsewhere. If so, please > put the version number in the patch log and provide a changelog > below the --- > > Hmm. I guess I don't really mind cleaning this up though it is > some churn in core code which is usually something we try to avoid > for fairly trivial style reasons. > > One request inline (though I suspect it applies in several places, > I just haven't checked ;) [] > > diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c [] > > @@ -1391,17 +1391,17 @@ static ssize_t direction_show(struct device *dev, > > } > > } > > > > -static DEVICE_ATTR(length, S_IRUGO | S_IWUSR, iio_buffer_read_length, > > +static DEVICE_ATTR(length, 0644, iio_buffer_read_length, > > iio_buffer_write_length); > > static struct device_attribute dev_attr_length_ro = __ATTR(length, > > - S_IRUGO, iio_buffer_read_length, NULL); > > -static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, > > + 0444, iio_buffer_read_length, NULL); > > +static DEVICE_ATTR(enable, 0644, > > iio_buffer_show_enable, iio_buffer_store_enable); > > -static DEVICE_ATTR(watermark, S_IRUGO | S_IWUSR, > > +static DEVICE_ATTR(watermark, 0644, > > iio_buffer_show_watermark, iio_buffer_store_watermark); > > static struct device_attribute dev_attr_watermark_ro = __ATTR(watermark, > > - S_IRUGO, iio_buffer_show_watermark, NULL); > > -static DEVICE_ATTR(data_available, S_IRUGO, > > + 0444, iio_buffer_show_watermark, NULL); > > +static DEVICE_ATTR(data_available, 0444, > > iio_dma_show_data_available, NULL); > > a side effect of this change a slight shortening of how long the above > two lines will be if combined into one. It's now sub 80 chars > I think, so please make them a single line. Also check for similar > cases elsewhere. another possibility it to rename the function to _show and change static DEVICE_ATTR(foo, 0444, , NULL) to static DEVICE_ATTR_RO() and also use DEVICE_ATTR_RW with appropriate function renaming where feasible.