ata: pata_legacy: fix pdc20230_set_piomode()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Fri, 28 Oct 2022 21:07:06 +0000 (00:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Nov 2022 14:47:20 +0000 (15:47 +0100)
commite7cc20ec80b7bf1dbad736d0a62aaa2e7adc78c0
treeb642baa48802c15dccb21e697f7ace535d1669a5
parentea6237229ea0ebed3d32ce412c9cd973ab9b5a45
ata: pata_legacy: fix pdc20230_set_piomode()

[ Upstream commit 171a93182eccd6e6835d2c86b40787f9f832efaa ]

Clang gives a warning when compiling pata_legacy.c with 'make W=1' about
the 'rt' local variable in pdc20230_set_piomode() being set but unused.
Quite obviously, there is an outb() call missing to write back the updated
variable. Moreover, checking the docs by Petr Soucek revealed that bitwise
AND should have been done with a negated timing mask and the master/slave
timing masks were swapped while updating...

Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.")
Reported-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/ata/pata_legacy.c