Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Mar 2017 14:58:15 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r316138 - stable/10/sbin/camcontrol
Message-ID:  <201703291458.v2TEwFwP025027@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Mar 29 14:58:15 2017
New Revision: 316138
URL: https://svnweb.freebsd.org/changeset/base/316138

Log:
  MFC r315711: Fix printing bits above first eight.

Modified:
  stable/10/sbin/camcontrol/camcontrol.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sbin/camcontrol/camcontrol.c
==============================================================================
--- stable/10/sbin/camcontrol/camcontrol.c	Wed Mar 29 14:57:41 2017	(r316137)
+++ stable/10/sbin/camcontrol/camcontrol.c	Wed Mar 29 14:58:15 2017	(r316138)
@@ -5156,7 +5156,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);
@@ -5164,7 +5164,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)
@@ -5204,7 +5204,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)
@@ -5239,7 +5239,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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703291458.v2TEwFwP025027>