From: "Ewan D. Milne" <emilne@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Adaptec OEM Raid Solutions <aacraid@adaptec.com>
Subject: Re: [PATCH v3 4/6] [SCSI] ips: don't use custom hex_asc_upper[] table
Date: Mon, 24 Oct 2016 08:34:52 -0400 [thread overview]
Message-ID: <1477312492.17595.3.camel@localhost.localdomain> (raw)
In-Reply-To: <20161022173231.170417-5-andriy.shevchenko@linux.intel.com>
On Sat, 2016-10-22 at 20:32 +0300, Andy Shevchenko wrote:
> From: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> We have table of the HEX characters in the kernel. Replace custom by a generic
> one.
>
> Cc: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---
> drivers/scsi/ips.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
> index 02cb76f..3419e1b 100644
> --- a/drivers/scsi/ips.c
> +++ b/drivers/scsi/ips.c
> @@ -2241,9 +2241,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);
>
> @@ -2374,13 +2371,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_upper_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_upper_lo(major);
> + ha->bios_version[3] = hex_asc_upper_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_upper_hi(minor);
> + ha->bios_version[6] = hex_asc_upper_lo(minor);
> ha->bios_version[7] = 0;
> }
>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
next prev parent reply other threads:[~2016-10-24 12:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-22 17:32 [PATCH v3 0/6] scsi: collection of clean ups Andy Shevchenko
2016-10-22 17:32 ` [PATCH v3 1/6] scsi: fnic: use kernel's '%pM' format option to print MAC Andy Shevchenko
2016-10-24 12:29 ` Ewan D. Milne
2016-10-22 17:32 ` [PATCH v3 2/6] fusion: print lan address via %pMR Andy Shevchenko
2016-10-24 12:32 ` Ewan D. Milne
2016-10-22 17:32 ` [PATCH v3 3/6] scsi: qla4xxx: print MAC and SID via %p[mM][R] Andy Shevchenko
2016-10-24 12:34 ` Ewan D. Milne
2016-10-22 17:32 ` [PATCH v3 4/6] [SCSI] ips: don't use custom hex_asc_upper[] table Andy Shevchenko
2016-10-24 12:34 ` Ewan D. Milne [this message]
2016-10-22 17:32 ` [PATCH v3 5/6] scsi: replace custom approach to hexdump small buffers Andy Shevchenko
2016-10-24 12:35 ` Ewan D. Milne
2016-10-22 17:32 ` [PATCH v3 6/6] cciss: replace custom function to hexdump Andy Shevchenko
2016-10-25 2:12 ` [PATCH v3 0/6] scsi: collection of clean ups Martin K. Petersen
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=1477312492.17595.3.camel@localhost.localdomain \
--to=emilne@redhat.com \
--cc=aacraid@adaptec.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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;
as well as URLs for NNTP newsgroup(s).