Skip to contentSkip to conversation

ide: ht6560b: Fix cast to pointer from integer of different size

PATCH Applied Krzysztof Kozlowski 2 participants 4 messages Jan 4, 2020 – Jan 20, 2020 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ide: ht6560b: Fix cast to pointer from integer of different size

Integer passed as pointer to drvdata should be cast to unsigned long to avoid warning (compile testing on alpha architecture):

    drivers/ide/ht6560b.c: In function ‘ht6560b_init_dev’:
    drivers/ide/ht6560b.c:318:27: warning:
        cast to pointer from integer of different size [-Wint-to-pointer-cast]

---

Only compile tested

---
 drivers/ide/ht6560b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ide/ht6560b.c +1 -1
index 0dae65ac7d6d..743bc3693ac8 100644
@@ -310,7 +310,7 @@ static void __init ht6560b_init_dev(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif = drive->hwif;
 	/* Setting default configurations for drives. */
-	int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
+	unsigned long t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
 
 	if (hwif->channel)
 		t |= (HT_SECONDARY_IF << 8);
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 ide: qd65xx: Fix cast to pointer from integer of different size

Integer passed as pointer to drvdata should be cast to unsigned long to avoid warning (compile testing on alpha architecture):

drivers/ide/qd65xx.c: In function ‘qd6580_init_dev’:
drivers/ide/qd65xx.c:312:27: warning:
cast to pointer from integer of different size [-Wint-to-pointer-cast]

---

Only compile tested

---
 drivers/ide/qd65xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ide/qd65xx.c +1 -1
index 6ce318ebd0cc..ab79b6289464 100644
@@ -299,7 +299,7 @@ static void __init qd6500_init_dev(ide_drive_t *drive)
 static void __init qd6580_init_dev(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif = drive->hwif;
-	u16 t1, t2;
+	unsigned long t1, t2;
 	u8 base = (hwif->config_data & 0xff00) >> 8;
 	u8 config = QD_CONFIG(hwif);
 
Signature · 1 line
2.17.1
Applied
#2 lore raw

Re: [PATCH 2/2] ide: qd65xx: Fix cast to pointer from integer of different size

From: Krzysztof Kozlowski <[email protected]>
Date: Sat, 4 Jan 2020 15:33:48 +0100

Quoted 8 lines

Integer passed as pointer to drvdata should be cast to unsigned long to avoid warning (compile testing on alpha architecture):

drivers/ide/qd65xx.c: In function ‘qd6580_init_dev’:
drivers/ide/qd65xx.c:312:27: warning:
cast to pointer from integer of different size [-Wint-to-pointer-cast]

Applied.

Applied
#3 lore raw
In reply to Krzysztof Kozlowski

From: Krzysztof Kozlowski <[email protected]>
Date: Sat, 4 Jan 2020 15:33:47 +0100

Quoted 8 lines

Integer passed as pointer to drvdata should be cast to unsigned long to avoid warning (compile testing on alpha architecture):

    drivers/ide/ht6560b.c: In function ‘ht6560b_init_dev’:
    drivers/ide/ht6560b.c:318:27: warning:
        cast to pointer from integer of different size [-Wint-to-pointer-cast]

Applied.