Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1144725pxb; Wed, 10 Feb 2021 00:48:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGBmo+zNUrQoTsUqLz3qjAInViVuiPdIsLZf68nfIORKGzS21opQ67y+8pR3fCGrhFtYDB X-Received: by 2002:aa7:c64a:: with SMTP id z10mr2143232edr.61.1612946897563; Wed, 10 Feb 2021 00:48:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612946897; cv=none; d=google.com; s=arc-20160816; b=Si/4V4rns5nHc6OWpGuAuK8bZPCDjTlDN6lSzWuruEHp7NRHdsNYb1O1OL2vzDwIKR H0RE1E3hwxy05sOKSBop5zRWo7ltauccQmAkEZstgyXOUX6I9iu8+vDwRRyAvGINVq/a Y+DT0y3GUWa5exURI1wj1pLOQ8VWZt18Jx8H1tUjFNpCiQ3s6eMLlHqGV7OgHy5q4TYM prZSeeyLxxOsYddG6pj9ldCFmz6ilOR3SEHU4F2E4nmhKK2OAWTHBI4MRVJtxWIm378G g4bPxbo79cEW2dM6Sbi0n++fWFi0Obqy418mTtaYw3nfRtV86CbUP5VjTGpbobO1CN4n ZxoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:to:from:subject:message-id; bh=uUpCRalcyoX6+9MjKtdAHQMYcpkZKWLBKhH2lP5QbBs=; b=mNvLM6G/+IfvK6PBB7SvCpdXmnZCaziHjzpP4yj+2v3v+yghJvG4Q3kpjI4tFoC9d9 WgWaHWMkajMDRI8f3zTZXMs56QhctLUjUXE8JanNWkvKd4O4qsQLS1BMrphTpmhPSZN0 InuAgEA57FucQXdDxt/k5ynYUZemPkyjcllfjrP8FA5cpZhtgKrigZE8CVZtaVhEbbAj Tk/w99gYV68FbnLjWEd0vGv2wXWZ8lYICUAeSuDla1zouMIQo90+iy/nHqpc+hpIvRK0 REZ0qdeNb12xVhOcoYKQ+rZpI+rUaqKRKBndPxEbBCV5oRIPzUjMIQVGHzYTn+cJCTl9 lGzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a11si1129266edm.151.2021.02.10.00.47.54; Wed, 10 Feb 2021 00:48:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbhBJIe0 (ORCPT + 99 others); Wed, 10 Feb 2021 03:34:26 -0500 Received: from smtprelay0031.hostedemail.com ([216.40.44.31]:33310 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229797AbhBJIbP (ORCPT ); Wed, 10 Feb 2021 03:31:15 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id A4164182E668C; Wed, 10 Feb 2021 08:30:24 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:2:41:355:379:599:800:960:973:982:988:989:1260:1261:1277:1311:1313:1314:1345:1359:1381:1437:1515:1516:1518:1535:1593:1594:1605:1606:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3622:3653:3865:3867:3868:3871:3873:4118:4321:4605:5007:6737:7652:10004:10848:11026:11232:11473:11658:11914:12043:12048:12296:12297:12438:12555:12679:12740:12895:12986:13439:13894:14096:14097:14659:21080:21433:21451:21611:21627:21939:21990:30054: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:1,LUA_SUMMARY:none X-HE-Tag: game81_0e0f4882760e X-Filterd-Recvd-Size: 7147 Received: from [192.168.1.159] (unknown [47.151.137.21]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Wed, 10 Feb 2021 08:30:22 +0000 (UTC) Message-ID: <87437daafdd86fa5c765ff9b17b6c7b097f0c317.camel@perches.com> Subject: Re: [PATCH v2 1/2] pinctrl: use to octal permissions for debugfs files From: Joe Perches To: Drew Fustini , Linus Walleij , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Tony Lindgren , Andy Shevchenko , Alexandre Belloni , Geert Uytterhoeven , Pantelis Antoniou , Jason Kridner , Robert Nelson Date: Wed, 10 Feb 2021 00:30:21 -0800 In-Reply-To: <20210210074946.155417-2-drew@beagleboard.org> References: <20210210074946.155417-1-drew@beagleboard.org> <20210210074946.155417-2-drew@beagleboard.org> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2021-02-09 at 23:49 -0800, Drew Fustini wrote: > Switch over pinctrl debugfs files to use octal permissions as they are > preferred over symbolic permissions. Refer to commit f90774e1fd27 > ("checkpatch: look for symbolic permissions and suggest octal instead"). > > Signed-off-by: Drew Fustini > --- > ?drivers/pinctrl/core.c | 6 +++--- > ?drivers/pinctrl/pinconf.c | 4 ++-- > ?drivers/pinctrl/pinmux.c | 4 ++-- > ?3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c > index 3663d87f51a0..c9c28f653799 100644 > --- a/drivers/pinctrl/core.c > +++ b/drivers/pinctrl/core.c > @@ -1914,11 +1914,11 @@ static void pinctrl_init_debugfs(void) > ? return; > ? } > ? > > - debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO, > + debugfs_create_file("pinctrl-devices", 0400, > ? debugfs_root, NULL, &pinctrl_devices_fops); NAK. You've changed the permission levels. S_IRUGO is 0444 not 0400. And you have to keep the S_IFREG or'd along with the octal. include/linux/stat.h:#define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) checkpatch does this conversion using this command line: $ ./scripts/checkpatch.pl -f --show-types --terse drivers/pinctrl/*.[ch] --types=SYMBOLIC_PERMS --fix-inplace drivers/pinctrl/core.c:1893: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. drivers/pinctrl/core.c:1895: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. drivers/pinctrl/core.c:1897: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. drivers/pinctrl/core.c:1919: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. drivers/pinctrl/core.c:1921: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. drivers/pinctrl/core.c:1923: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. total: 0 errors, 6 warnings, 2302 lines checked drivers/pinctrl/pinconf.c:373: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. drivers/pinctrl/pinconf.c:375: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. total: 0 errors, 2 warnings, 379 lines checked drivers/pinctrl/pinmux.c:679: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. drivers/pinctrl/pinmux.c:681: WARNING:SYMBOLIC_PERMS: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'. total: 0 errors, 2 warnings, 854 lines checked $ git diff --stat -p drivers/pinctrl/ drivers/pinctrl/core.c | 12 ++++++------ drivers/pinctrl/pinconf.c | 4 ++-- drivers/pinctrl/pinmux.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 7d3370289938..6992b805ae41 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c @@ -1890,11 +1890,11 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev) dev_name(pctldev->dev)); return; } - debugfs_create_file("pins", S_IFREG | S_IRUGO, + debugfs_create_file("pins", S_IFREG | 0444, device_root, pctldev, &pinctrl_pins_fops); - debugfs_create_file("pingroups", S_IFREG | S_IRUGO, + debugfs_create_file("pingroups", S_IFREG | 0444, device_root, pctldev, &pinctrl_groups_fops); - debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO, + debugfs_create_file("gpio-ranges", S_IFREG | 0444, device_root, pctldev, &pinctrl_gpioranges_fops); if (pctldev->desc->pmxops) pinmux_init_device_debugfs(device_root, pctldev); @@ -1916,11 +1916,11 @@ static void pinctrl_init_debugfs(void) return; } - debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO, + debugfs_create_file("pinctrl-devices", S_IFREG | 0444, debugfs_root, NULL, &pinctrl_devices_fops); - debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO, + debugfs_create_file("pinctrl-maps", S_IFREG | 0444, debugfs_root, NULL, &pinctrl_maps_fops); - debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO, + debugfs_create_file("pinctrl-handles", S_IFREG | 0444, debugfs_root, NULL, &pinctrl_fops); } diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index 02c075cc010b..f9ee12b50428 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c @@ -370,9 +370,9 @@ DEFINE_SHOW_ATTRIBUTE(pinconf_groups); void pinconf_init_device_debugfs(struct dentry *devroot, struct pinctrl_dev *pctldev) { - debugfs_create_file("pinconf-pins", S_IFREG | S_IRUGO, + debugfs_create_file("pinconf-pins", S_IFREG | 0444, devroot, pctldev, &pinconf_pins_fops); - debugfs_create_file("pinconf-groups", S_IFREG | S_IRUGO, + debugfs_create_file("pinconf-groups", S_IFREG | 0444, devroot, pctldev, &pinconf_groups_fops); } diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 36a11c9e893a..ea7559a25fed 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -676,9 +676,9 @@ DEFINE_SHOW_ATTRIBUTE(pinmux_pins); void pinmux_init_device_debugfs(struct dentry *devroot, struct pinctrl_dev *pctldev) { - debugfs_create_file("pinmux-functions", S_IFREG | S_IRUGO, + debugfs_create_file("pinmux-functions", S_IFREG | 0444, devroot, pctldev, &pinmux_functions_fops); - debugfs_create_file("pinmux-pins", S_IFREG | S_IRUGO, + debugfs_create_file("pinmux-pins", S_IFREG | 0444, devroot, pctldev, &pinmux_pins_fops); }