Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Aug 2016 18:29:16 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r303754 - in head/sys: dev/cxgbe net sys x86/iommu
Message-ID:  <201608041829.u74ITGIb052246@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Thu Aug  4 18:29:16 2016
New Revision: 303754
URL: https://svnweb.freebsd.org/changeset/base/303754

Log:
  Add __printflike() to bus_describe_intr() to enable -Wformat checks.
  
  Fix a few places that were passing a raw string as the format to use
  a "%s" format string instead.
  
  MFC after:	2 months

Modified:
  head/sys/dev/cxgbe/t4_main.c
  head/sys/net/iflib.c
  head/sys/sys/bus.h
  head/sys/x86/iommu/intel_drv.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Thu Aug  4 17:55:23 2016	(r303753)
+++ head/sys/dev/cxgbe/t4_main.c	Thu Aug  4 18:29:16 2016	(r303754)
@@ -4364,7 +4364,7 @@ t4_alloc_irq(struct adapter *sc, struct 
 		    "failed to setup interrupt for rid %d, name %s: %d\n",
 		    rid, name, rc);
 	} else if (name)
-		bus_describe_intr(sc->dev, irq->res, irq->tag, name);
+		bus_describe_intr(sc->dev, irq->res, irq->tag, "%s", name);
 
 	return (rc);
 }

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Thu Aug  4 17:55:23 2016	(r303753)
+++ head/sys/net/iflib.c	Thu Aug  4 18:29:16 2016	(r303754)
@@ -1210,7 +1210,7 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t 
 					  rid, name ? name : "unknown", rc);
 		return (rc);
 	} else if (name)
-		bus_describe_intr(dev, res, tag, name);
+		bus_describe_intr(dev, res, tag, "%s", name);
 
 	irq->ii_tag = tag;
 	return (0);

Modified: head/sys/sys/bus.h
==============================================================================
--- head/sys/sys/bus.h	Thu Aug  4 17:55:23 2016	(r303753)
+++ head/sys/sys/bus.h	Thu Aug  4 18:29:16 2016	(r303754)
@@ -534,7 +534,7 @@ int	bus_setup_intr(device_t dev, struct 
 int	bus_teardown_intr(device_t dev, struct resource *r, void *cookie);
 int	bus_bind_intr(device_t dev, struct resource *r, int cpu);
 int	bus_describe_intr(device_t dev, struct resource *irq, void *cookie,
-			  const char *fmt, ...);
+			  const char *fmt, ...) __printflike(4, 5);
 int	bus_set_resource(device_t dev, int type, int rid,
 			 rman_res_t start, rman_res_t count);
 int	bus_get_resource(device_t dev, int type, int rid,

Modified: head/sys/x86/iommu/intel_drv.c
==============================================================================
--- head/sys/x86/iommu/intel_drv.c	Thu Aug  4 17:55:23 2016	(r303753)
+++ head/sys/x86/iommu/intel_drv.c	Thu Aug  4 18:29:16 2016	(r303754)
@@ -306,7 +306,7 @@ dmar_alloc_irq(device_t dev, struct dmar
 		    dmd->name, error);
 		goto err4;
 	}
-	bus_describe_intr(dev, dmd->irq_res, dmd->intr_handle, dmd->name);
+	bus_describe_intr(dev, dmd->irq_res, dmd->intr_handle, "%s", dmd->name);
 	error = PCIB_MAP_MSI(pcib, dev, dmd->irq, &msi_addr, &msi_data);
 	if (error != 0) {
 		device_printf(dev, "cannot map %s interrupt, %d\n",



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