summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorBenjamin Romer <benjamin.romer@unisys.com>2014-12-05 22:09:02 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-10 01:32:33 (GMT)
commitab12d8a00abefaa86edba121cc20db86f26ed7d3 (patch)
treeaaaf1cf43353b6ab6f94e4a5e99e607a044e77cd /drivers/staging
parent2b6040c51f7d031d83355df2454d4b80e7779885 (diff)
downloadlinux-ab12d8a00abefaa86edba121cc20db86f26ed7d3.tar.xz
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: Bryan Thompson <bryan.thompson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/unisys/uislib/uislib.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
index 614919c8..908ec49 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -1187,31 +1187,29 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf,
debug_buf, total_bytes);
}
-static struct device_info *
-find_dev(u32 busNo, u32 devNo)
+static struct device_info *find_dev(u32 bus_no, u32 dev_no)
{
struct bus_info *bus;
struct device_info *dev = NULL;
read_lock(&bus_list_lock);
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 */
- if (devNo >= bus->device_count) {
- LOGERR("%s bad busNo, devNo=%d,%d",
+ if (dev_no >= bus->device_count) {
+ LOGERR("%s bad bus_no, dev_no=%d,%d",
__func__,
- (int)(busNo), (int)(devNo));
- goto Away;
+ (int)bus_no, (int)dev_no);
+ break;
}
- dev = bus->device[devNo];
+ dev = bus->device[dev_no];
if (!dev)
- LOGERR("%s bad busNo, devNo=%d,%d",
+ LOGERR("%s bad bus_no, dev_no=%d,%d",
__func__,
- (int)(busNo), (int)(devNo));
- goto Away;
+ (int)bus_no, (int)dev_no);
+ break;
}
}
-Away:
read_unlock(&bus_list_lock);
return dev;
}