Commit 24f8929f authored by Pedro Demarchi Gomes's avatar Pedro Demarchi Gomes Committed by Ulf Hansson
Browse files

mmc: use octal file permissions instead of symbolic



As stated in Documentation/dev-tools/checkpatch.rst, octal file
permissions are preferred over symbolic constants because they are
easier to read and understand. Replace symbolic permissions with
their octal equivalents.

Signed-off-by: default avatarPedro Demarchi Gomes <pedrodemargomes@gmail.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent db7e0ad6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -349,10 +349,10 @@ static umode_t mmc_disk_attrs_is_visible(struct kobject *kobj,
	if (a == &dev_attr_ro_lock_until_next_power_on.attr &&
	    (md->area_type & MMC_BLK_DATA_AREA_BOOT) &&
	    md->queue.card->ext_csd.boot_ro_lockable) {
		mode = S_IRUGO;
		mode = 0444;
		if (!(md->queue.card->ext_csd.boot_ro_lock &
				EXT_CSD_BOOT_WP_B_PWR_WP_DIS))
			mode |= S_IWUSR;
			mode |= 0200;
	}

	mmc_blk_put(md);
@@ -3191,7 +3191,7 @@ static void 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);
	}
}
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *a
	struct mmc_card *card = mmc_dev_to_card(dev);				\
	return sysfs_emit(buf, fmt, args);					\
}										\
static DEVICE_ATTR(name, S_IRUGO, mmc_##name##_show, NULL)
static DEVICE_ATTR(name, 0444, mmc_##name##_show, NULL)

struct mmc_card *mmc_alloc_card(struct mmc_host *host,
				const struct device_type *type);
+2 −2
Original line number Diff line number Diff line
@@ -831,7 +831,7 @@ static ssize_t mmc_fwrev_show(struct device *dev,
				  card->ext_csd.fwrev);
}

static DEVICE_ATTR(fwrev, S_IRUGO, mmc_fwrev_show, NULL);
static DEVICE_ATTR(fwrev, 0444, mmc_fwrev_show, NULL);

static ssize_t mmc_dsr_show(struct device *dev,
			    struct device_attribute *attr,
@@ -847,7 +847,7 @@ static ssize_t mmc_dsr_show(struct device *dev,
		return sysfs_emit(buf, "0x%x\n", 0x404);
}

static DEVICE_ATTR(dsr, S_IRUGO, mmc_dsr_show, NULL);
static DEVICE_ATTR(dsr, 0444, mmc_dsr_show, NULL);

static struct attribute *mmc_std_attrs[] = {
	&dev_attr_cid.attr,
+2 −2
Original line number Diff line number Diff line
@@ -3212,12 +3212,12 @@ static int mmc_test_register_dbgfs_file(struct mmc_card *card)

	mutex_lock(&mmc_test_lock);

	ret = __mmc_test_register_dbgfs_file(card, "test", S_IWUSR | S_IRUGO,
	ret = __mmc_test_register_dbgfs_file(card, "test", 0644,
		&mmc_test_fops_test);
	if (ret)
		goto err;

	ret = __mmc_test_register_dbgfs_file(card, "testlist", S_IRUGO,
	ret = __mmc_test_register_dbgfs_file(card, "testlist", 0444,
		&mtf_testlist_fops);
	if (ret)
		goto err;
+1 −1
Original line number Diff line number Diff line
@@ -744,7 +744,7 @@ static ssize_t mmc_dsr_show(struct device *dev, struct device_attribute *attr,
	return sysfs_emit(buf, "0x%x\n", 0x404);
}

static DEVICE_ATTR(dsr, S_IRUGO, mmc_dsr_show, NULL);
static DEVICE_ATTR(dsr, 0444, mmc_dsr_show, NULL);

MMC_DEV_ATTR(vendor, "0x%04x\n", card->cis.vendor);
MMC_DEV_ATTR(device, "0x%04x\n", card->cis.device);
Loading