summaryrefslogtreecommitdiffstats
path: root/drivers/usb/mon
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-04-30 11:32:56 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-10 16:01:11 +0200
commit0296951a62bb863008821b33343cff446fce4b84 (patch)
tree685dc889e976723e028cd86690d57f664cbe857e /drivers/usb/mon
parent925f0042cf2058cd3929c9c49593fba7750ffe8d (diff)
downloadlinux-stable-0296951a62bb863008821b33343cff446fce4b84.tar.gz
linux-stable-0296951a62bb863008821b33343cff446fce4b84.tar.bz2
linux-stable-0296951a62bb863008821b33343cff446fce4b84.zip
USB: mon_bin.c: move assignment out of if () block
We should not be doing assignments within an if () block so fix up the code to not do this. change was created using Coccinelle. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/mon')
-rw-r--r--drivers/usb/mon/mon_bin.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
index 9a62e89d6dc0..3598f1a62673 100644
--- a/drivers/usb/mon/mon_bin.c
+++ b/drivers/usb/mon/mon_bin.c
@@ -675,7 +675,8 @@ static int mon_bin_open(struct inode *inode, struct file *file)
int rc;
mutex_lock(&mon_lock);
- if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) {
+ mbus = mon_bus_lookup(iminor(inode));
+ if (mbus == NULL) {
mutex_unlock(&mon_lock);
return -ENODEV;
}
@@ -1018,8 +1019,8 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg
return -EINVAL;
size = CHUNK_ALIGN(arg);
- if ((vec = kzalloc(sizeof(struct mon_pgmap) * (size/CHUNK_SIZE),
- GFP_KERNEL)) == NULL) {
+ vec = kzalloc(sizeof(struct mon_pgmap) * (size / CHUNK_SIZE), GFP_KERNEL);
+ if (vec == NULL) {
ret = -ENOMEM;
break;
}