Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jan 2013 18:21:24 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244965 - head/tools/tools/ath/athstats
Message-ID:  <201301021821.r02ILOdA038825@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Wed Jan  2 18:21:24 2013
New Revision: 244965
URL: http://svnweb.freebsd.org/changeset/base/244965

Log:
  Fix up some warnings from clang.
  
  This still triggers a bug in clang..

Modified:
  head/tools/tools/ath/athstats/athstats.c

Modified: head/tools/tools/ath/athstats/athstats.c
==============================================================================
--- head/tools/tools/ath/athstats/athstats.c	Wed Jan  2 18:14:26 2013	(r244964)
+++ head/tools/tools/ath/athstats/athstats.c	Wed Jan  2 18:21:24 2013	(r244965)
@@ -490,7 +490,7 @@ ath_zerostats(struct athstatfoo *wf0)
 	struct athstatfoo_p *wf = (struct athstatfoo_p *) wf0;
 
 	if (ioctl(wf->s, SIOCZATHSTATS, &wf->ifr) < 0)
-		err(-1, wf->ifr.ifr_name);
+		err(-1, "ioctl: %s", wf->ifr.ifr_name);
 }
 
 static void
@@ -498,21 +498,21 @@ ath_collect(struct athstatfoo_p *wf, str
 {
 	wf->ifr.ifr_data = (caddr_t) &stats->ath;
 	if (ioctl(wf->s, SIOCGATHSTATS, &wf->ifr) < 0)
-		err(1, wf->ifr.ifr_name);
+		err(1, "ioctl: %s", wf->ifr.ifr_name);
 #ifdef ATH_SUPPORT_ANI
 	if (wf->optstats & ATHSTATS_ANI) {
 		wf->atd.ad_id = 5;
 		wf->atd.ad_out_data = (caddr_t) &stats->ani_state;
 		wf->atd.ad_out_size = sizeof(stats->ani_state);
 		if (ioctl(wf->s, SIOCGATHDIAG, &wf->atd) < 0) {
-			warn(wf->atd.ad_name);
+			warn("ioctl: %s", wf->atd.ad_name);
 			wf->optstats &= ~ATHSTATS_ANI;
 		}
 		wf->atd.ad_id = 8;
 		wf->atd.ad_out_data = (caddr_t) &stats->ani_stats;
 		wf->atd.ad_out_size = sizeof(stats->ani_stats);
 		if (ioctl(wf->s, SIOCGATHDIAG, &wf->atd) < 0)
-			warn(wf->atd.ad_name);
+			warn("ioctl: %s", wf->atd.ad_name);
 	}
 #endif /* ATH_SUPPORT_ANI */
 }
@@ -574,12 +574,14 @@ ath_get_curstat(struct statfoo *sf, int 
 	switch (s) {
 	case S_INPUT:
 		snprintf(b, bs, "%lu",
-		    (wf->cur.ath.ast_rx_packets - wf->total.ath.ast_rx_packets) -
-		    (wf->cur.ath.ast_rx_mgt - wf->total.ath.ast_rx_mgt));
+		    (unsigned long)
+		    ((wf->cur.ath.ast_rx_packets - wf->total.ath.ast_rx_packets) -
+		    (wf->cur.ath.ast_rx_mgt - wf->total.ath.ast_rx_mgt)));
 		return 1;
 	case S_OUTPUT:
 		snprintf(b, bs, "%lu",
-		    wf->cur.ath.ast_tx_packets - wf->total.ath.ast_tx_packets);
+		    (unsigned long)
+		    (wf->cur.ath.ast_tx_packets - wf->total.ath.ast_tx_packets));
 		return 1;
 	case S_RATE:
 		snprintrate(b, bs, wf->cur.ath.ast_tx_rate);



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