提交 0296951a 编写于 作者: G Greg Kroah-Hartman

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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: NFelipe Balbi <balbi@ti.com>
上级 925f0042
...@@ -675,7 +675,8 @@ static int mon_bin_open(struct inode *inode, struct file *file) ...@@ -675,7 +675,8 @@ static int mon_bin_open(struct inode *inode, struct file *file)
int rc; int rc;
mutex_lock(&mon_lock); 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); mutex_unlock(&mon_lock);
return -ENODEV; return -ENODEV;
} }
...@@ -1018,8 +1019,8 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg ...@@ -1018,8 +1019,8 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg
return -EINVAL; return -EINVAL;
size = CHUNK_ALIGN(arg); size = CHUNK_ALIGN(arg);
if ((vec = kzalloc(sizeof(struct mon_pgmap) * (size/CHUNK_SIZE), vec = kzalloc(sizeof(struct mon_pgmap) * (size / CHUNK_SIZE), GFP_KERNEL);
GFP_KERNEL)) == NULL) { if (vec == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册