Patchwork tx493xide: use min_t() macro instead of min()

login
register
mail settings
Submitter Atsushi Nemoto
Date June 1, 2010, 3:28 p.m.
Message ID <1275406118-14581-1-git-send-email-anemo@mba.ocn.ne.jp>
Download mbox | patch
Permalink /patch/54230/
State Accepted
Delegated to: David Miller
Headers show

Comments

Atsushi Nemoto - June 1, 2010, 3:28 p.m.
This fixes a warning ("comparison of distinct pointer types lacks a
cast") introduced by the commit
040f6b4f14adb2ca5babb84e9fb2ebc6661e0be2 ("tx493xide: use ->pio_mode
value to determine pair device speed").

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 drivers/ide/tx4938ide.c |    2 +-
 drivers/ide/tx4939ide.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
David Miller - June 4, 2010, 11:19 p.m.
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Wed,  2 Jun 2010 00:28:38 +0900

> This fixes a warning ("comparison of distinct pointer types lacks a
> cast") introduced by the commit
> 040f6b4f14adb2ca5babb84e9fb2ebc6661e0be2 ("tx493xide: use ->pio_mode
> value to determine pair device speed").
> 
> Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

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

Patch

diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c
index 1d80f1f..7002765 100644
--- a/drivers/ide/tx4938ide.c
+++ b/drivers/ide/tx4938ide.c
@@ -64,7 +64,7 @@  static void tx4938ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
 
 	pair = ide_get_pair_dev(drive);
 	if (pair)
-		safe = min(safe, pair->pio_mode - XFER_PIO_0);
+		safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0);
 	tx4938ide_tune_ebusc(pdata->ebus_ch, pdata->gbus_clock, safe);
 }
 
diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c
index 3c73677..bed3e39 100644
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -114,7 +114,7 @@  static void tx4939ide_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
 
 	pair = ide_get_pair_dev(drive);
 	if (pair)
-		safe = min(safe, pair->pio_mode - XFER_PIO_0);
+		safe = min_t(u8, safe, pair->pio_mode - XFER_PIO_0);
 	/*
 	 * Update Command Transfer Mode for master/slave and Data
 	 * Transfer Mode for this drive.