diff mbox

ata: sata_mv: fix mis-conversion in mv_write_cached_reg()

Message ID 1465318149-21029-1-git-send-email-ben.dooks@codethink.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Dooks June 7, 2016, 4:49 p.m. UTC
Fix the signed issue in mv_write_cached_reg() where the laddr
is assigned from a (long)addr instead of (unsigned long)addr.

Fixes the following warnings:

drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
Cc: Tejun Heo <tj@kernel.org>
Cc: linux-ide@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/ata/sata_mv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tejun Heo June 17, 2016, 4:15 p.m. UTC | #1
On Tue, Jun 07, 2016 at 05:49:09PM +0100, Ben Dooks wrote:
> Fix the signed issue in mv_write_cached_reg() where the laddr
> is assigned from a (long)addr instead of (unsigned long)addr.
> 
> Fixes the following warnings:
> 
> drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
> drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
> drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
> drivers/ata/sata_mv.c:989:26: warning: cast removes address space of expression
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>

Applied to libata/for-4.7-fixes.

Thanks.
diff mbox

Patch

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index bd74ee5..745489a 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -986,7 +986,7 @@  static inline void mv_write_cached_reg(void __iomem *addr, u32 *old, u32 new)
 		 * Looks like a lot of fuss, but it avoids an unnecessary
 		 * +1 usec read-after-write delay for unaffected registers.
 		 */
-		laddr = (long)addr & 0xffff;
+		laddr = (unsigned long)addr & 0xffff;
 		if (laddr >= 0x300 && laddr <= 0x33c) {
 			laddr &= 0x000f;
 			if (laddr == 0x4 || laddr == 0xc) {