Skip to content

Commit 6a73cf4

Browse files
JoePerchestiwai
authored andcommitted
sound: Use octal not symbolic permissions
Convert the S_<FOO> symbolic permissions to their octal equivalents as using octal and not symbolic permissions is preferred by many as more readable. see: https://lkml.org/lkml/2016/8/2/1945 Done with automated conversion via: $ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace <files...> Miscellanea: o Wrapped one multi-line call to a single line Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 84eaaef commit 6a73cf4

41 files changed

Lines changed: 102 additions & 103 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎sound/core/compress_offload.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ static int snd_compress_proc_init(struct snd_compr *compr)
10011001
compr->card->proc_root);
10021002
if (!entry)
10031003
return -ENOMEM;
1004-
entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
1004+
entry->mode = S_IFDIR | 0555;
10051005
if (snd_info_register(entry) < 0) {
10061006
snd_info_free_entry(entry);
10071007
return -ENOMEM;

‎sound/core/info.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static struct snd_info_entry *create_subdir(struct module *mod,
454454
entry = snd_info_create_module_entry(mod, name, NULL);
455455
if (!entry)
456456
return NULL;
457-
entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
457+
entry->mode = S_IFDIR | 0555;
458458
if (snd_info_register(entry) < 0) {
459459
snd_info_free_entry(entry);
460460
return NULL;
@@ -470,7 +470,7 @@ int __init snd_info_init(void)
470470
snd_proc_root = snd_info_create_entry("asound", NULL);
471471
if (!snd_proc_root)
472472
return -ENOMEM;
473-
snd_proc_root->mode = S_IFDIR | S_IRUGO | S_IXUGO;
473+
snd_proc_root->mode = S_IFDIR | 0555;
474474
snd_proc_root->p = proc_mkdir("asound", NULL);
475475
if (!snd_proc_root->p)
476476
goto error;
@@ -716,7 +716,7 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent)
716716
kfree(entry);
717717
return NULL;
718718
}
719-
entry->mode = S_IFREG | S_IRUGO;
719+
entry->mode = S_IFREG | 0444;
720720
entry->content = SNDRV_INFO_CONTENT_TEXT;
721721
mutex_init(&entry->access);
722722
INIT_LIST_HEAD(&entry->children);

‎sound/core/init.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr,
703703
return count;
704704
}
705705

706-
static DEVICE_ATTR(id, S_IRUGO | S_IWUSR, card_id_show_attr, card_id_store_attr);
706+
static DEVICE_ATTR(id, 0644, card_id_show_attr, card_id_store_attr);
707707

708708
static ssize_t
709709
card_number_show_attr(struct device *dev,
@@ -713,7 +713,7 @@ card_number_show_attr(struct device *dev,
713713
return scnprintf(buf, PAGE_SIZE, "%i\n", card->number);
714714
}
715715

716-
static DEVICE_ATTR(number, S_IRUGO, card_number_show_attr, NULL);
716+
static DEVICE_ATTR(number, 0444, card_number_show_attr, NULL);
717717

718718
static struct attribute *card_dev_attrs[] = {
719719
&dev_attr_id.attr,

‎sound/core/oss/mixer_oss.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,7 @@ static void snd_mixer_oss_proc_init(struct snd_mixer_oss *mixer)
12471247
if (! entry)
12481248
return;
12491249
entry->content = SNDRV_INFO_CONTENT_TEXT;
1250-
entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
1250+
entry->mode = S_IFREG | 0644;
12511251
entry->c.text.read = snd_mixer_oss_proc_read;
12521252
entry->c.text.write = snd_mixer_oss_proc_write;
12531253
entry->private_data = mixer;

‎sound/core/oss/pcm_oss.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3045,7 +3045,7 @@ static void snd_pcm_oss_proc_init(struct snd_pcm *pcm)
30453045
continue;
30463046
if ((entry = snd_info_create_card_entry(pcm->card, "oss", pstr->proc_root)) != NULL) {
30473047
entry->content = SNDRV_INFO_CONTENT_TEXT;
3048-
entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
3048+
entry->mode = S_IFREG | 0644;
30493049
entry->c.text.read = snd_pcm_oss_proc_read;
30503050
entry->c.text.write = snd_pcm_oss_proc_write;
30513051
entry->private_data = pstr;

‎sound/core/pcm.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
530530
pcm->card->proc_root);
531531
if (!entry)
532532
return -ENOMEM;
533-
entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
533+
entry->mode = S_IFDIR | 0555;
534534
if (snd_info_register(entry) < 0) {
535535
snd_info_free_entry(entry);
536536
return -ENOMEM;
@@ -552,7 +552,7 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
552552
if (entry) {
553553
entry->c.text.read = snd_pcm_xrun_debug_read;
554554
entry->c.text.write = snd_pcm_xrun_debug_write;
555-
entry->mode |= S_IWUSR;
555+
entry->mode |= 0200;
556556
entry->private_data = pstr;
557557
if (snd_info_register(entry) < 0) {
558558
snd_info_free_entry(entry);
@@ -590,7 +590,7 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
590590
substream->pstr->proc_root);
591591
if (!entry)
592592
return -ENOMEM;
593-
entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
593+
entry->mode = S_IFDIR | 0555;
594594
if (snd_info_register(entry) < 0) {
595595
snd_info_free_entry(entry);
596596
return -ENOMEM;
@@ -647,7 +647,7 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
647647
entry->private_data = substream;
648648
entry->c.text.read = NULL;
649649
entry->c.text.write = snd_pcm_xrun_injection_write;
650-
entry->mode = S_IFREG | S_IWUSR;
650+
entry->mode = S_IFREG | 0200;
651651
if (snd_info_register(entry) < 0) {
652652
snd_info_free_entry(entry);
653653
entry = NULL;
@@ -1087,7 +1087,7 @@ static ssize_t show_pcm_class(struct device *dev,
10871087
return snprintf(buf, PAGE_SIZE, "%s\n", str);
10881088
}
10891089

1090-
static DEVICE_ATTR(pcm_class, S_IRUGO, show_pcm_class, NULL);
1090+
static DEVICE_ATTR(pcm_class, 0444, show_pcm_class, NULL);
10911091
static struct attribute *pcm_dev_attrs[] = {
10921092
&dev_attr_pcm_class.attr,
10931093
NULL

‎sound/core/pcm_memory.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ static inline void preallocate_info_init(struct snd_pcm_substream *substream)
201201
if ((entry = snd_info_create_card_entry(substream->pcm->card, "prealloc", substream->proc_root)) != NULL) {
202202
entry->c.text.read = snd_pcm_lib_preallocate_proc_read;
203203
entry->c.text.write = snd_pcm_lib_preallocate_proc_write;
204-
entry->mode |= S_IWUSR;
204+
entry->mode |= 0200;
205205
entry->private_data = substream;
206206
if (snd_info_register(entry) < 0) {
207207
snd_info_free_entry(entry);

‎sound/drivers/dummy.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ static void dummy_proc_init(struct snd_dummy *chip)
10421042
if (!snd_card_proc_new(chip->card, "dummy_pcm", &entry)) {
10431043
snd_info_set_text_ops(entry, chip, dummy_proc_read);
10441044
entry->c.text.write = dummy_proc_write;
1045-
entry->mode |= S_IWUSR;
1045+
entry->mode |= 0200;
10461046
entry->private_data = chip;
10471047
}
10481048
}

‎sound/drivers/mts64.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;
4141
static struct platform_device *platform_devices[SNDRV_CARDS];
4242
static int device_count;
4343

44-
module_param_array(index, int, NULL, S_IRUGO);
44+
module_param_array(index, int, NULL, 0444);
4545
MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard.");
46-
module_param_array(id, charp, NULL, S_IRUGO);
46+
module_param_array(id, charp, NULL, 0444);
4747
MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard.");
48-
module_param_array(enable, bool, NULL, S_IRUGO);
48+
module_param_array(enable, bool, NULL, 0444);
4949
MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard.");
5050

5151
MODULE_AUTHOR("Matthias Koenig <mk@phasorlab.de>");

‎sound/drivers/opl4/opl4_proc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ int snd_opl4_create_proc(struct snd_opl4 *opl4)
104104
if (entry) {
105105
if (opl4->hardware < OPL3_HW_OPL4_ML) {
106106
/* OPL4 can access 4 MB external ROM/SRAM */
107-
entry->mode |= S_IWUSR;
107+
entry->mode |= 0200;
108108
entry->size = 4 * 1024 * 1024;
109109
} else {
110110
/* OPL4-ML has 1 MB internal ROM */

0 commit comments

Comments
 (0)