Re: [PATCH] pata-rb532-cf: fix signature of the xfer function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

Phil Sutter wrote:

Per definition, this function should return the number of bytes
consumed. Also take care of the unlikely case when buflen is not a
multiple of four; while transferring, the division cuts the remaining
bytes, so alter the return value accordingly.

Signed-off-by: Phil Sutter <n0-1@xxxxxxxxxxx>

Acked-by: Sergei Shtyltov <sshtylyov@xxxxxxxxxxxxx>

  Except it should've been the first patch in the series.

diff --git a/drivers/ata/pata_rb532_cf.c b/drivers/ata/pata_rb532_cf.c
index b919012..95a0d66 100644
--- a/drivers/ata/pata_rb532_cf.c
+++ b/drivers/ata/pata_rb532_cf.c
@@ -75,7 +75,7 @@ static void rb532_pata_exec_command(struct ata_port *ap,
 	rb532_pata_finish_io(ap);
 }
-static void rb532_pata_data_xfer(struct ata_device *adev,
+static unsigned int rb532_pata_data_xfer(struct ata_device *adev,
 		unsigned char *buf, unsigned int buflen, int write_data)
 {
 	struct ata_port *ap = adev->link->ap;
@@ -87,6 +87,7 @@ static void rb532_pata_data_xfer(struct ata_device *adev,
 		readsl(ioaddr, buf, buflen / sizeof(u32));
rb532_pata_finish_io(adev->link->ap);
+	return buflen - (buflen % sizeof(u32));

Unneeded parens -- multiplication/division/modulo has natural priority over addition/subtraction.

WBR, Sergei


--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux