Module Name:    src
Committed By:   christos
Date:           Mon Feb 27 16:16:23 UTC 2017

Modified Files:
        src/sys/dev/pci: pci_subr.c

Log Message:
fix printf formats (clang build)


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/pci/pci_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.161 src/sys/dev/pci/pci_subr.c:1.162
--- src/sys/dev/pci/pci_subr.c:1.161	Mon Feb 27 09:13:56 2017
+++ src/sys/dev/pci/pci_subr.c	Mon Feb 27 11:16:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.161 2017/02/27 14:13:56 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.162 2017/02/27 16:16:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.161 2017/02/27 14:13:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.162 2017/02/27 16:16:23 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -2658,22 +2658,24 @@ pci_conf_print_vc_cap(const pcireg_t *re
 }
 
 static void
-pci_conf_print_pwrbdgt_base_power(uint8_t base, int scale)
+pci_conf_print_pwrbdgt_base_power(uint8_t base, unsigned int scale)
 {
-	int sdiv = 1;
-	const char *s;
-	int i;
-	
 	if (base <= 0xef) {
-		for (i = scale; i > 0; i--)
+		unsigned int sdiv = 1;
+		for (unsigned int i = scale; i > 0; i--)
 			sdiv *= 10;
-		printf("%hhu", base / sdiv);
+
+		printf("%u", base / sdiv);
+
 		if (scale != 0) {
-			printf(".%hhu", base % sdiv);
+			printf(".%u", base % sdiv);
 		}
 		printf ("W\n");
 		return;
 	}
+
+	const char *s;
+
 	switch (base) {
 	case 0xf0:
 		s = "239W < x <= 250W";

Reply via email to