Skip to content

Commit daadabf

Browse files
anupamakpatilrafaeljw
authored andcommitted
drivers: pnp: isapnp: proc.c: Remove unnecessary local variables
In the PNP code, there are two redundant local variables that can be dropped. This also fixes a coding style issue reported by checkpatch about an assignment made under an if () statement. Reviewed-by: Jaroslav Kysela <[email protected]> Signed-off-by: Anupama K Patil <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent d07f6ca commit daadabf

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/pnp/isapnp/proc.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,20 @@ static const struct proc_ops isapnp_proc_bus_proc_ops = {
5757
static int isapnp_proc_attach_device(struct pnp_dev *dev)
5858
{
5959
struct pnp_card *bus = dev->card;
60-
struct proc_dir_entry *de, *e;
6160
char name[16];
6261

63-
if (!(de = bus->procdir)) {
62+
if (!bus->procdir) {
6463
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)
6766
return -ENOMEM;
6867
}
6968
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,
7170
&isapnp_proc_bus_proc_ops, dev);
72-
if (!e)
71+
if (!dev->procent)
7372
return -ENOMEM;
74-
proc_set_size(e, 256);
73+
proc_set_size(dev->procent, 256);
7574
return 0;
7675
}
7776

0 commit comments

Comments
 (0)