]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scsi: ppa: Fix accidentally reversed conditions for 16-bit and 32-bit EPP
authorAlex Henrie <alexhenrie24@gmail.com>
Thu, 31 Aug 2023 05:19:42 +0000 (23:19 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 5 Sep 2023 09:26:49 +0000 (05:26 -0400)
The conditions were correct in the ppa_in() function but not in the
ppa_out() function.

Fixes: 68a4f84a17c1 ("scsi: ppa: Add a module parameter for the transfer mode")
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Link: https://lore.kernel.org/r/20230831051945.515476-1-alexhenrie24@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ppa.c

index 19f0b93fa3d85a283bcfb77125def4d38845e3cd..d592ee9170c11f373971028a804f44a6ba6042b7 100644 (file)
@@ -307,9 +307,9 @@ static int ppa_out(ppa_struct *dev, char *buffer, int len)
        case PPA_EPP_8:
                epp_reset(ppb);
                w_ctr(ppb, 0x4);
-               if (dev->mode == PPA_EPP_32 && !(((long) buffer | len) & 0x01))
+               if (dev->mode == PPA_EPP_32 && !(((long) buffer | len) & 0x03))
                        outsl(ppb + 4, buffer, len >> 2);
-               else if (dev->mode == PPA_EPP_16 && !(((long) buffer | len) & 0x03))
+               else if (dev->mode == PPA_EPP_16 && !(((long) buffer | len) & 0x01))
                        outsw(ppb + 4, buffer, len >> 1);
                else
                        outsb(ppb + 4, buffer, len);