From d161a13f974c72fd7ff0069d39a3ae57cb5694ff Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sun, 24 Jul 2011 03:36:29 -0400 Subject: switch procfs to umode_t use both proc_dir_entry ->mode and populating functions Signed-off-by: Al Viro --- drivers/acpi/battery.c | 2 +- drivers/message/i2o/i2o_proc.c | 2 +- drivers/misc/sgi-gru/gruprocfs.c | 2 +- drivers/platform/x86/asus_acpi.c | 4 ++-- drivers/platform/x86/thinkpad_acpi.c | 4 ++-- drivers/scsi/sg.c | 7 +++---- 6 files changed, 10 insertions(+), 11 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 7711d94..86933ca 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -873,7 +873,7 @@ DECLARE_FILE_FUNCTIONS(alarm); static const struct battery_file { struct file_operations ops; - mode_t mode; + umode_t mode; const char *name; } acpi_battery_file[] = { FILE_DESCRIPTION_RO(info), diff --git a/drivers/message/i2o/i2o_proc.c b/drivers/message/i2o/i2o_proc.c index 07dbeaf..6d115c7 100644 --- a/drivers/message/i2o/i2o_proc.c +++ b/drivers/message/i2o/i2o_proc.c @@ -56,7 +56,7 @@ /* Structure used to define /proc entries */ typedef struct _i2o_proc_entry_t { char *name; /* entry name */ - mode_t mode; /* mode */ + umode_t mode; /* mode */ const struct file_operations *fops; /* open function */ } i2o_proc_entry; diff --git a/drivers/misc/sgi-gru/gruprocfs.c b/drivers/misc/sgi-gru/gruprocfs.c index 7768b87..950dbe9 100644 --- a/drivers/misc/sgi-gru/gruprocfs.c +++ b/drivers/misc/sgi-gru/gruprocfs.c @@ -324,7 +324,7 @@ static const struct file_operations gru_fops = { static struct proc_entry { char *name; - int mode; + umode_t mode; const struct file_operations *fops; struct proc_dir_entry *entry; } proc_files[] = { diff --git a/drivers/platform/x86/asus_acpi.c b/drivers/platform/x86/asus_acpi.c index d9312b3..6f966d6 100644 --- a/drivers/platform/x86/asus_acpi.c +++ b/drivers/platform/x86/asus_acpi.c @@ -1053,7 +1053,7 @@ static const struct file_operations disp_proc_fops = { }; static int -asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode, +asus_proc_add(char *name, const struct file_operations *proc_fops, umode_t mode, struct acpi_device *device) { struct proc_dir_entry *proc; @@ -1072,7 +1072,7 @@ asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode, static int asus_hotk_add_fs(struct acpi_device *device) { struct proc_dir_entry *proc; - mode_t mode; + umode_t mode; if ((asus_uid == 0) && (asus_gid == 0)) { mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP; diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 7b82868..455e152 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -297,7 +297,7 @@ struct ibm_init_struct { char param[32]; int (*init) (struct ibm_init_struct *); - mode_t base_procfs_mode; + umode_t base_procfs_mode; struct ibm_struct *data; }; @@ -8542,7 +8542,7 @@ static int __init ibm_init(struct ibm_init_struct *iibm) "%s installed\n", ibm->name); if (ibm->read) { - mode_t mode = iibm->base_procfs_mode; + umode_t mode = iibm->base_procfs_mode; if (!mode) mode = S_IRUGO; diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 441a1c5..02d9998 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -2325,16 +2325,15 @@ static struct sg_proc_leaf sg_proc_leaf_arr[] = { static int sg_proc_init(void) { - int k, mask; int num_leaves = ARRAY_SIZE(sg_proc_leaf_arr); - struct sg_proc_leaf * leaf; + int k; sg_proc_sgp = proc_mkdir(sg_proc_sg_dirname, NULL); if (!sg_proc_sgp) return 1; for (k = 0; k < num_leaves; ++k) { - leaf = &sg_proc_leaf_arr[k]; - mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; + struct sg_proc_leaf *leaf = &sg_proc_leaf_arr[k]; + umode_t mask = leaf->fops->write ? S_IRUGO | S_IWUSR : S_IRUGO; proc_create(leaf->name, mask, sg_proc_sgp, leaf->fops); } return 0; -- cgit v1.1