From: Harvey Harrison <harvey.harrison@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/4] scsi: use the common hex_asc array rather than a private one
Date: Thu, 01 May 2008 13:51:08 -0700 [thread overview]
Message-ID: <1209675068.24729.166.camel@brick> (raw)
Also use the hi/lo helpers.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
drivers/scsi/ibmmca.c | 3 +--
drivers/scsi/ultrastor.c | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index 4d15a62..6765a05 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[val];
else
answer[0] = '-';
return (char *) &answer;
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 27aa40f..25828ce 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -876,8 +876,8 @@ static int ultrastor_abort(struct scsi_cmnd *SCpnt)
for (i = 0; i < 16; i++)
{
unsigned char p = inb(port0 + i);
- out[28 + i * 3] = "0123456789abcdef"[p >> 4];
- out[29 + i * 3] = "0123456789abcdef"[p & 15];
+ out[28 + i * 3] = hex_asc_hi(p);
+ out[29 + i * 3] = hex_asc_lo(p);
out[30 + i * 3] = ' ';
}
out[28 + i * 3] = '\n';
--
1.5.5.1.305.g7c84
reply other threads:[~2008-05-01 20:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1209675068.24729.166.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox