summaryrefslogtreecommitdiff
path: root/drivers/parport/share.c
diff options
context:
space:
mode:
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>2015-10-28 12:11:40 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-01-04 03:32:59 +0300
commite0a7f1f04cd9bb13df7503ba7156ff0a37c9f460 (patch)
tree79bba5716874a0570db82cd2ca4f2bc8da45a86e /drivers/parport/share.c
parente732b93c3276548bfa903d79c2083b2c8dc552af (diff)
downloadlinux-e0a7f1f04cd9bb13df7503ba7156ff0a37c9f460.tar.xz
parport: avoid assignment in if
It is not an usual practise to assign some value to a variable in the if test condition. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/parport/share.c')
-rw-r--r--drivers/parport/share.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index b68f19480dcf..3308427ed9f7 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -1120,7 +1120,8 @@ int parport_claim(struct pardevice *dev)
/* Preempt any current device */
write_lock_irqsave(&port->cad_lock, flags);
- if ((oldcad = port->cad) != NULL) {
+ oldcad = port->cad;
+ if (oldcad) {
if (oldcad->preempt) {
if (oldcad->preempt(oldcad->private))
goto blocked;