parport: avoid assignment in if
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Wed, 28 Oct 2015 09:11:40 +0000 (14:41 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 4 Jan 2016 00:32:59 +0000 (16:32 -0800)
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>
drivers/parport/share.c

index b68f19480dcfdaf54c74e644004c0e0ce7c769c7..3308427ed9f7a04bb50119882a2130f6e7ee13ed 100644 (file)
@@ -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;