Commit 4113dcbd authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] MOD_INC_USE_COUNT removals

	ia64/kernel/efivar.c: missing ->owner in procfs entry
	ia64/kernel/palinfo.c: missing ->owner in procfs entry
	ia64/kernel/salinfo.c: missing ->owner in procfs entry
	ppc/8xx_io/cs4218_tdm.c: gratitious MOD_..._USE_COUNT in
->open()/->release() (file_operations->owner was already set)
parent 9b857a70
...@@ -195,6 +195,7 @@ efivar_create_proc_entry(unsigned long variable_name_size, ...@@ -195,6 +195,7 @@ efivar_create_proc_entry(unsigned long variable_name_size,
if (!new_efivar->entry) return 1; if (!new_efivar->entry) return 1;
new_efivar->entry->owner = THIS_MODULE;
new_efivar->entry->data = new_efivar; new_efivar->entry->data = new_efivar;
new_efivar->entry->read_proc = efivar_read; new_efivar->entry->read_proc = efivar_read;
new_efivar->entry->write_proc = efivar_write; new_efivar->entry->write_proc = efivar_write;
...@@ -224,7 +225,6 @@ efivar_read(char *page, char **start, off_t off, int count, int *eof, void *data ...@@ -224,7 +225,6 @@ efivar_read(char *page, char **start, off_t off, int count, int *eof, void *data
if (!page || !data) return -EINVAL; if (!page || !data) return -EINVAL;
spin_lock(&efivars_lock); spin_lock(&efivars_lock);
MOD_INC_USE_COUNT;
memcpy(var_data, &efi_var->var, len); memcpy(var_data, &efi_var->var, len);
...@@ -235,7 +235,6 @@ efivar_read(char *page, char **start, off_t off, int count, int *eof, void *data ...@@ -235,7 +235,6 @@ efivar_read(char *page, char **start, off_t off, int count, int *eof, void *data
&var_data->DataSize, &var_data->DataSize,
var_data->Data); var_data->Data);
MOD_DEC_USE_COUNT;
spin_unlock(&efivars_lock); spin_unlock(&efivars_lock);
return proc_calc_metrics(page, start, off, count, eof, len); return proc_calc_metrics(page, start, off, count, eof, len);
...@@ -269,15 +268,10 @@ efivar_write(struct file *file, const char *buffer, ...@@ -269,15 +268,10 @@ efivar_write(struct file *file, const char *buffer,
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
MOD_INC_USE_COUNT;
var_data = kmalloc(size, GFP_KERNEL); var_data = kmalloc(size, GFP_KERNEL);
if (!var_data) { if (!var_data)
MOD_DEC_USE_COUNT;
return -ENOMEM; return -ENOMEM;
}
if (copy_from_user(var_data, buffer, size)) { if (copy_from_user(var_data, buffer, size)) {
MOD_DEC_USE_COUNT;
kfree(var_data); kfree(var_data);
return -EFAULT; return -EFAULT;
} }
...@@ -313,7 +307,6 @@ efivar_write(struct file *file, const char *buffer, ...@@ -313,7 +307,6 @@ efivar_write(struct file *file, const char *buffer,
if (status != EFI_SUCCESS) { if (status != EFI_SUCCESS) {
printk(KERN_WARNING "set_variable() failed: status=%lx\n", status); printk(KERN_WARNING "set_variable() failed: status=%lx\n", status);
kfree(var_data); kfree(var_data);
MOD_DEC_USE_COUNT;
spin_unlock(&efivars_lock); spin_unlock(&efivars_lock);
return -EIO; return -EIO;
} }
...@@ -335,7 +328,6 @@ efivar_write(struct file *file, const char *buffer, ...@@ -335,7 +328,6 @@ efivar_write(struct file *file, const char *buffer,
} }
kfree(var_data); kfree(var_data);
MOD_DEC_USE_COUNT;
spin_unlock(&efivars_lock); spin_unlock(&efivars_lock);
return size; return size;
} }
......
...@@ -893,7 +893,6 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi ...@@ -893,7 +893,6 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi
int len=0; int len=0;
pal_func_cpu_u_t *f = (pal_func_cpu_u_t *)&data; pal_func_cpu_u_t *f = (pal_func_cpu_u_t *)&data;
MOD_INC_USE_COUNT;
/* /*
* in SMP mode, we may need to call another CPU to get correct * in SMP mode, we may need to call another CPU to get correct
* information. PAL, by definition, is processor specific * information. PAL, by definition, is processor specific
...@@ -911,8 +910,6 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi ...@@ -911,8 +910,6 @@ palinfo_read_entry(char *page, char **start, off_t off, int count, int *eof, voi
if (len>count) len = count; if (len>count) len = count;
if (len<0) len = 0; if (len<0) len = 0;
MOD_DEC_USE_COUNT;
return len; return len;
} }
...@@ -947,8 +944,12 @@ palinfo_init(void) ...@@ -947,8 +944,12 @@ palinfo_init(void)
for (j=0; j < NR_PALINFO_ENTRIES; j++) { for (j=0; j < NR_PALINFO_ENTRIES; j++) {
f.func_id = j; f.func_id = j;
*pdir++ = create_proc_read_entry (palinfo_entries[j].name, 0, cpu_dir, *pdir = create_proc_read_entry(
palinfo_read_entry, (void *)f.value); palinfo_entries[j].name, 0, cpu_dir,
palinfo_read_entry, (void *)f.value);
if (*pdir)
(*pdir)->owner = THIS_MODULE;
pdir++;
} }
*pdir++ = cpu_dir; *pdir++ = cpu_dir;
} }
......
...@@ -56,8 +56,11 @@ salinfo_init(void) ...@@ -56,8 +56,11 @@ salinfo_init(void)
for (i=0; i < NR_SALINFO_ENTRIES; i++) { for (i=0; i < NR_SALINFO_ENTRIES; i++) {
/* pass the feature bit in question as misc data */ /* pass the feature bit in question as misc data */
*sdir++ = create_proc_read_entry (salinfo_entries[i].name, 0, salinfo_dir, *sdir = create_proc_read_entry (salinfo_entries[i].name, 0, salinfo_dir,
salinfo_read, (void *)salinfo_entries[i].feature); salinfo_read, (void *)salinfo_entries[i].feature);
if (*sdir)
*sdir->owner = THIS_MODULE;
sdir++;
} }
*sdir++ = salinfo_dir; *sdir++ = salinfo_dir;
...@@ -84,8 +87,6 @@ salinfo_read(char *page, char **start, off_t off, int count, int *eof, void *dat ...@@ -84,8 +87,6 @@ salinfo_read(char *page, char **start, off_t off, int count, int *eof, void *dat
{ {
int len = 0; int len = 0;
MOD_INC_USE_COUNT;
len = sprintf(page, (sal_platform_features & (unsigned long)data) ? "1\n" : "0\n"); len = sprintf(page, (sal_platform_features & (unsigned long)data) ? "1\n" : "0\n");
if (len <= off+count) *eof = 1; if (len <= off+count) *eof = 1;
...@@ -96,8 +97,6 @@ salinfo_read(char *page, char **start, off_t off, int count, int *eof, void *dat ...@@ -96,8 +97,6 @@ salinfo_read(char *page, char **start, off_t off, int count, int *eof, void *dat
if (len>count) len = count; if (len>count) len = count;
if (len<0) len = 0; if (len<0) len = 0;
MOD_DEC_USE_COUNT;
return len; return len;
} }
......
...@@ -1629,7 +1629,6 @@ static ssize_t sound_copy_translate_read(const u_char *userPtr, ...@@ -1629,7 +1629,6 @@ static ssize_t sound_copy_translate_read(const u_char *userPtr,
static int mixer_open(struct inode *inode, struct file *file) static int mixer_open(struct inode *inode, struct file *file)
{ {
MOD_INC_USE_COUNT;
mixer.busy = 1; mixer.busy = 1;
return 0; return 0;
} }
...@@ -1638,7 +1637,6 @@ static int mixer_open(struct inode *inode, struct file *file) ...@@ -1638,7 +1637,6 @@ static int mixer_open(struct inode *inode, struct file *file)
static int mixer_release(struct inode *inode, struct file *file) static int mixer_release(struct inode *inode, struct file *file)
{ {
mixer.busy = 0; mixer.busy = 0;
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
...@@ -2050,7 +2048,6 @@ static int sq_open(struct inode *inode, struct file *file) ...@@ -2050,7 +2048,6 @@ static int sq_open(struct inode *inode, struct file *file)
{ {
int rc = 0; int rc = 0;
MOD_INC_USE_COUNT;
if (file->f_mode & FMODE_WRITE) { if (file->f_mode & FMODE_WRITE) {
if (sq.busy) { if (sq.busy) {
rc = -EBUSY; rc = -EBUSY;
...@@ -2131,7 +2128,6 @@ static int sq_open(struct inode *inode, struct file *file) ...@@ -2131,7 +2128,6 @@ static int sq_open(struct inode *inode, struct file *file)
WAKE_UP(read_sq.open_queue); WAKE_UP(read_sq.open_queue);
} }
err_out: err_out:
MOD_DEC_USE_COUNT;
return rc; return rc;
} }
...@@ -2183,7 +2179,6 @@ static int sq_release(struct inode *inode, struct file *file) ...@@ -2183,7 +2179,6 @@ static int sq_release(struct inode *inode, struct file *file)
sq_release_read_buffers(); sq_release_read_buffers();
sq_release_buffers(); sq_release_buffers();
MOD_DEC_USE_COUNT;
if (file->f_mode & FMODE_READ) { if (file->f_mode & FMODE_READ) {
read_sq.busy = 0; read_sq.busy = 0;
...@@ -2372,7 +2367,6 @@ static int state_open(struct inode *inode, struct file *file) ...@@ -2372,7 +2367,6 @@ static int state_open(struct inode *inode, struct file *file)
if (state.busy) if (state.busy)
return -EBUSY; return -EBUSY;
MOD_INC_USE_COUNT;
state.ptr = 0; state.ptr = 0;
state.busy = 1; state.busy = 1;
...@@ -2428,7 +2422,6 @@ static int state_open(struct inode *inode, struct file *file) ...@@ -2428,7 +2422,6 @@ static int state_open(struct inode *inode, struct file *file)
static int state_release(struct inode *inode, struct file *file) static int state_release(struct inode *inode, struct file *file)
{ {
state.busy = 0; state.busy = 0;
MOD_DEC_USE_COUNT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment