Commit ab12d8a0 authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor find_dev()

Fix the function definition so that it is a single line. Fix CamelCase
parameter names:

busNo => bus_no
devNo => dev_no

Get rid of the goto and just break out of the for loop, since that does
the exact same thing.
Signed-off-by: default avatarBryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2b6040c5
...@@ -1187,31 +1187,29 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf, ...@@ -1187,31 +1187,29 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf,
debug_buf, total_bytes); debug_buf, total_bytes);
} }
static struct device_info * static struct device_info *find_dev(u32 bus_no, u32 dev_no)
find_dev(u32 busNo, u32 devNo)
{ {
struct bus_info *bus; struct bus_info *bus;
struct device_info *dev = NULL; struct device_info *dev = NULL;
read_lock(&bus_list_lock); read_lock(&bus_list_lock);
for (bus = bus_list; bus; bus = bus->next) { for (bus = bus_list; bus; bus = bus->next) {
if (bus->bus_no == busNo) { if (bus->bus_no == bus_no) {
/* make sure the device number is valid */ /* make sure the device number is valid */
if (devNo >= bus->device_count) { if (dev_no >= bus->device_count) {
LOGERR("%s bad busNo, devNo=%d,%d", LOGERR("%s bad bus_no, dev_no=%d,%d",
__func__, __func__,
(int)(busNo), (int)(devNo)); (int)bus_no, (int)dev_no);
goto Away; break;
} }
dev = bus->device[devNo]; dev = bus->device[dev_no];
if (!dev) if (!dev)
LOGERR("%s bad busNo, devNo=%d,%d", LOGERR("%s bad bus_no, dev_no=%d,%d",
__func__, __func__,
(int)(busNo), (int)(devNo)); (int)bus_no, (int)dev_no);
goto Away; break;
} }
} }
Away:
read_unlock(&bus_list_lock); read_unlock(&bus_list_lock);
return dev; return dev;
} }
......
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