public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Aviral Gupta <shiv14112001@gmail.com>
To: ulf.hansson@linaro.org, adrian.hunter@intel.com, axboe@kernel.dk,
	beanhuo@micron.com, satyat@google.com, avri.altman@wdc.com,
	richard.peng@oppo.com, guoqing.jiang@cloud.ionos.com
Cc: Aviral Gupta <shiv14112001@gmail.com>,
	linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: [PATCH] This patch fixes the warning generated due to use of symbolic
Date: Mon, 24 May 2021 21:27:06 +0530	[thread overview]
Message-ID: <20210524155705.5138-1-shiv14112001@gmail.com> (raw)

It's better to use octal permissons instead of symbolic ones because  peoples are more
familiar with octal permissons.
WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
+	md->force_ro.attr.mode = S_IRUGO | S_IWUSR;

WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
+			mode = S_IRUGO;

WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
+			mode = S_IRUGO | S_IWUSR;

WARNING: Symbolic permissions 'S_IRUSR' are not preferred. Consider using octal permissions '0400'.
+			debugfs_create_file("ext_csd", S_IRUSR, root, card,

Signed-off-by: Aviral Gupta <shiv14112001@gmail.com>
---
 drivers/mmc/core/block.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 266d62f9dbc8..1b5b0ad41b28 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -2693,7 +2693,7 @@ static int mmc_add_disk(struct mmc_blk_data *md)
 	md->force_ro.store = force_ro_store;
 	sysfs_attr_init(&md->force_ro.attr);
 	md->force_ro.attr.name = "force_ro";
-	md->force_ro.attr.mode = S_IRUGO | S_IWUSR;
+	md->force_ro.attr.mode = 0644;
 	ret = device_create_file(disk_to_dev(md->disk), &md->force_ro);
 	if (ret)
 		goto force_ro_fail;
@@ -2703,9 +2703,9 @@ static int mmc_add_disk(struct mmc_blk_data *md)
 		umode_t mode;
 
 		if (card->ext_csd.boot_ro_lock & EXT_CSD_BOOT_WP_B_PWR_WP_DIS)
-			mode = S_IRUGO;
+			mode = 0444;
 		else
-			mode = S_IRUGO | S_IWUSR;
+			mode = 0644;
 
 		md->power_ro_lock.show = power_ro_lock_show;
 		md->power_ro_lock.store = power_ro_lock_store;
@@ -2851,7 +2851,7 @@ static int mmc_blk_add_debugfs(struct mmc_card *card, struct mmc_blk_data *md)
 
 	if (mmc_card_mmc(card)) {
 		md->ext_csd_dentry =
-			debugfs_create_file("ext_csd", S_IRUSR, root, card,
+			debugfs_create_file("ext_csd", 0400, root, card,
 					    &mmc_dbg_ext_csd_fops);
 		if (!md->ext_csd_dentry)
 			return -EIO;
-- 
2.25.1


             reply	other threads:[~2021-05-24 16:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 15:57 Aviral Gupta [this message]
2021-05-24 16:07 ` [PATCH] This patch fixes the warning generated due to use of symbolic Greg KH
2021-05-24 16:19 ` Pavel Skripkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210524155705.5138-1-shiv14112001@gmail.com \
    --to=shiv14112001@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=beanhuo@micron.com \
    --cc=guoqing.jiang@cloud.ionos.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=richard.peng@oppo.com \
    --cc=satyat@google.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox