[PATCH] scsi: IPS, IBMMCA: Use hex_asc_hi and hex_asc_lo

From: Uros Bizjak
Date: Fri Aug 13 2010 - 08:57:13 EST


Trivial substitution for private implementations, compile tested on i386.

Signed-off-by: Uros Bizjak <ubizjak@xxxxxxxxx>

diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index 9a4b69d..c152eca 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -1002,12 +1002,11 @@ static char *ti_p(int dev)
/* interpreter for logical device numbers (ldn) */
static char *ti_l(int val)
{
- const char hex[16] = "0123456789abcdef";
static char answer[2];

answer[1] = (char) (0x0);
if (val <= MAX_LOG_DEV)
- answer[0] = hex[val];
+ answer[0] = hex_asc_lo(val);
else
answer[0] = '-';
return (char *) &answer;
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index f83a116..3c25573 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -2315,9 +2315,6 @@ ips_get_bios_version(ips_ha_t * ha, int intr)
uint8_t minor;
uint8_t subminor;
uint8_t *buffer;
- char hexDigits[] =
- { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C',
- 'D', 'E', 'F' };

METHOD_TRACE("ips_get_bios_version", 1);

@@ -2448,13 +2445,13 @@ ips_get_bios_version(ips_ha_t * ha, int intr)
}
}

- ha->bios_version[0] = hexDigits[(major & 0xF0) >> 4];
+ ha->bios_version[0] = hex_asc_hi(major);
ha->bios_version[1] = '.';
- ha->bios_version[2] = hexDigits[major & 0x0F];
- ha->bios_version[3] = hexDigits[subminor];
+ ha->bios_version[2] = hex_asc_lo(major);
+ ha->bios_version[3] = hex_asc_lo(subminor);
ha->bios_version[4] = '.';
- ha->bios_version[5] = hexDigits[(minor & 0xF0) >> 4];
- ha->bios_version[6] = hexDigits[minor & 0x0F];
+ ha->bios_version[5] = hex_asc_hi(minor);
+ ha->bios_version[6] = hex_asc_lo(minor);
ha->bios_version[7] = 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/