svn commit: r315711 - head/sbin/camcontrol
Alexander Motin
mav at FreeBSD.org
Wed Mar 22 13:53:23 UTC 2017
Author: mav
Date: Wed Mar 22 13:53:21 2017
New Revision: 315711
URL: https://svnweb.freebsd.org/changeset/base/315711
Log:
Fix printing bits above first eight.
Reported by: Coverity
CID: 1372596
MFC after: 1 week
Modified:
head/sbin/camcontrol/camcontrol.c
Modified: head/sbin/camcontrol/camcontrol.c
==============================================================================
--- head/sbin/camcontrol/camcontrol.c Wed Mar 22 13:16:04 2017 (r315710)
+++ head/sbin/camcontrol/camcontrol.c Wed Mar 22 13:53:21 2017 (r315711)
@@ -5321,7 +5321,7 @@ static void
cpi_print(struct ccb_pathinq *cpi)
{
char adapter_str[1024];
- int i;
+ uint64_t i;
snprintf(adapter_str, sizeof(adapter_str),
"%s%d:", cpi->dev_name, cpi->unit_number);
@@ -5329,7 +5329,7 @@ cpi_print(struct ccb_pathinq *cpi)
fprintf(stdout, "%s SIM/HBA version: %d\n", adapter_str,
cpi->version_num);
- for (i = 1; i < 0xff; i = i << 1) {
+ for (i = 1; i < UINT8_MAX; i = i << 1) {
const char *str;
if ((i & cpi->hba_inquiry) == 0)
@@ -5369,7 +5369,7 @@ cpi_print(struct ccb_pathinq *cpi)
fprintf(stdout, "%s\n", str);
}
- for (i = 1; i < 0xff; i = i << 1) {
+ for (i = 1; i < UINT32_MAX; i = i << 1) {
const char *str;
if ((i & cpi->hba_misc) == 0)
@@ -5416,7 +5416,7 @@ cpi_print(struct ccb_pathinq *cpi)
fprintf(stdout, "%s\n", str);
}
- for (i = 1; i < 0xff; i = i << 1) {
+ for (i = 1; i < UINT16_MAX; i = i << 1) {
const char *str;
if ((i & cpi->target_sprt) == 0)
More information about the svn-src-all
mailing list