lkml.org 
[lkml]   [2010]   [Aug]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] scsi: IPS, IBMMCA: Use hex_asc_hi and hex_asc_lo
From
Trivial substitution for private implementations, compile tested on i386.

Signed-off-by: Uros Bizjak <ubizjak@gmail.com>

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;
}

\
 
 \ /
  Last update: 2010-08-13 14:59    [W:0.339 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site