serial: 8250_pci: remove redundant assignment to tmp after the mask operation
Subsystems (2)
PATCH 1/1 serial: 8250_pci: remove redundant assignment to tmp after the mask operation
The variable tmp is being masked with a bitmask and the value is being written to port base + 0x3c. However, the masked value is being written back to tmp and tmp is never used after this. The assignmentment is redundant, replace the &= operator with just &.
Signed-off-by Colin Ian King <[email protected]>
--- drivers/tty/serial/8250/8250_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_pci.c +1 -1
@@ -1278,7 +1278,7 @@ static int pci_quatech_init(struct pci_dev *dev)outl (inl (base +0x38 ) |0x00002000 , base +0x38 ); tmp =inl (base +0x3c );outl (tmp |0x01000000 , base +0x3c ); -outl (tmp &= ~0x01000000 , base +0x3c ); +outl (tmp & ~0x01000000 , base +0x3c ); } }return 0 ;
Signature · 1 line
2.33.1
Quoted 4 lines · Colin Ian King
The variable tmp is being masked with a bitmask and the value is being written to port base +
0x3c. However, the masked value is being written back to tmp and tmp is never used after this. The assignmentment is redundant, replace the &= operator with just &.
Make sense (maybe you can replace all those 0x00...BIT...00 by BIT() and GENMASK() later on).
Reviewesd-by Andy Shevchenko <[email protected]>
Quoted 21 lines
Signed-off-by Colin Ian King <[email protected]>--- drivers/tty/serial/8250/8250_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/serial/8250/8250_pci.c +1
-1@@ -1278,7 +1278,7 @@ static int pci_quatech_init(struct pci_dev *dev)outl (inl (base +0x38 ) |0x00002000 , base +0x38 ); tmp =inl (base +0x3c );outl (tmp |0x01000000 , base +0x3c ); -outl (tmp &= ~0x01000000 , base +0x3c ); +outl (tmp & ~0x01000000 , base +0x3c ); } }return 0 ;Signature · 1 line
2.33.1
Signature · 2 lines
With Best Regards, Andy Shevchenko