Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers: pnp: proc.c: Removed unnecessary varibles

de, e are two variables of the type 'struct proc_dir_entry'
which can be removed to save memory. This also fixes a coding style
issue reported by checkpatch where we are suggested to make assignment
outside the if statement.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Anupama K Patil <anupamakpatil123@gmail.com>
Link: https://lore.kernel.org/r/20210422180322.7wlyg63kv3n2k6id@ubuntu
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Anupama K Patil and committed by
Greg Kroah-Hartman
17e336db ca263dd8

+6 -7
+6 -7
drivers/pnp/isapnp/proc.c
··· 57 57 static int isapnp_proc_attach_device(struct pnp_dev *dev) 58 58 { 59 59 struct pnp_card *bus = dev->card; 60 - struct proc_dir_entry *de, *e; 61 60 char name[16]; 62 61 63 - if (!(de = bus->procdir)) { 62 + if (!bus->procdir) { 64 63 sprintf(name, "%02x", bus->number); 65 - de = bus->procdir = proc_mkdir(name, isapnp_proc_bus_dir); 66 - if (!de) 64 + bus->procdir = proc_mkdir(name, isapnp_proc_bus_dir); 65 + if (!bus->procdir) 67 66 return -ENOMEM; 68 67 } 69 68 sprintf(name, "%02x", dev->number); 70 - e = dev->procent = proc_create_data(name, S_IFREG | S_IRUGO, de, 69 + dev->procent = proc_create_data(name, S_IFREG | S_IRUGO, bus->procdir, 71 70 &isapnp_proc_bus_proc_ops, dev); 72 - if (!e) 71 + if (!dev->procent) 73 72 return -ENOMEM; 74 - proc_set_size(e, 256); 73 + proc_set_size(dev->procent, 256); 75 74 return 0; 76 75 } 77 76