9902 mac: mac_soft_ring_poll should use size_t
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Ryan Zezeski <ryan.zeseski@joyent.com>
Approved by: Dan McDonald <danmcd@joyent.com>
diff --git a/usr/src/uts/common/io/mac/mac_soft_ring.c b/usr/src/uts/common/io/mac/mac_soft_ring.c
index 2e056c8..dc8cfdd 100644
--- a/usr/src/uts/common/io/mac/mac_soft_ring.c
+++ b/usr/src/uts/common/io/mac/mac_soft_ring.c
@@ -152,8 +152,8 @@
     processorid_t cpuid, mac_direct_rx_t rx_func, void *x_arg1,
     mac_resource_handle_t x_arg2)
 {
-	mac_soft_ring_t 	*ringp;
-	char 			name[S_RING_NAMELEN];
+	mac_soft_ring_t		*ringp;
+	char			name[S_RING_NAMELEN];
 
 	bzero(name, 64);
 	ringp = kmem_cache_alloc(mac_soft_ring_cache, KM_SLEEP);
@@ -354,7 +354,7 @@
 	mblk_t		*mp;
 	void		*arg1;
 	mac_resource_handle_t arg2;
-	timeout_id_t 	tid;
+	timeout_id_t	tid;
 	mac_direct_rx_t	proc;
 	size_t		sz;
 	int		cnt;
@@ -536,7 +536,7 @@
  * setup.
  */
 mblk_t *
-mac_soft_ring_poll(mac_soft_ring_t *ringp, int bytes_to_pickup)
+mac_soft_ring_poll(mac_soft_ring_t *ringp, size_t bytes_to_pickup)
 {
 	mblk_t	*head, *tail;
 	mblk_t	*mp;
@@ -648,10 +648,10 @@
 static void
 mac_tx_soft_ring_drain(mac_soft_ring_t *ringp)
 {
-	mblk_t 			*mp;
-	void 			*arg1;
-	void 			*arg2;
-	mblk_t 			*tail;
+	mblk_t			*mp;
+	void			*arg1;
+	void			*arg2;
+	mblk_t			*tail;
 	uint_t			saved_pkt_count, saved_size;
 	mac_tx_stats_t		stats;
 	mac_soft_ring_set_t	*mac_srs = ringp->s_ring_set;
diff --git a/usr/src/uts/common/sys/mac.h b/usr/src/uts/common/sys/mac.h
index f3e22d6..0907d6d 100644
--- a/usr/src/uts/common/sys/mac.h
+++ b/usr/src/uts/common/sys/mac.h
@@ -397,7 +397,7 @@
 typedef void		(*mac_notify_t)(void *, mac_notify_type_t);
 typedef void		(*mac_rx_t)(void *, mac_resource_handle_t, mblk_t *,
 			    boolean_t);
-typedef	mblk_t		*(*mac_receive_t)(void *, int);
+typedef	mblk_t		*(*mac_receive_t)(void *, size_t);
 
 /*
  * MAC resource types
@@ -634,7 +634,7 @@
 extern int			mac_type(mac_handle_t);
 extern int			mac_nativetype(mac_handle_t);
 
-extern void 			mac_unicst_update(mac_handle_t,
+extern void			mac_unicst_update(mac_handle_t,
 				    const uint8_t *);
 extern void			mac_capab_update(mac_handle_t);
 extern int			mac_pdata_update(mac_handle_t, void *,
diff --git a/usr/src/uts/common/sys/mac_soft_ring.h b/usr/src/uts/common/sys/mac_soft_ring.h
index e96c41a..581e18d 100644
--- a/usr/src/uts/common/sys/mac_soft_ring.h
+++ b/usr/src/uts/common/sys/mac_soft_ring.h
@@ -183,7 +183,7 @@
 	 */
 	mac_direct_rx_t		sr_func;	/* srs_lock */
 	void			*sr_arg1;	/* srs_lock */
-	mac_resource_handle_t 	sr_arg2;	/* srs_lock */
+	mac_resource_handle_t	sr_arg2;	/* srs_lock */
 	mac_rx_func_t		sr_lower_proc;	/* Atomically changed */
 	uint32_t		sr_poll_pkt_cnt;
 	uint32_t		sr_poll_thres;
@@ -386,7 +386,7 @@
 /*
  * type flags - combination allowed to process and drain the queue
  */
-#define	ST_RING_WORKER_ONLY  	0x0001	/* Worker thread only */
+#define	ST_RING_WORKER_ONLY	0x0001	/* Worker thread only */
 #define	ST_RING_ANY		0x0002	/* Any thread can process the queue */
 #define	ST_RING_TCP		0x0004
 #define	ST_RING_UDP		0x0008
@@ -540,7 +540,7 @@
 }
 
 #define	MAC_COUNT_CHAIN(mac_srs, head, tail, cnt, sz)	{	\
-	mblk_t 		*tmp;		       			\
+	mblk_t		*tmp;					\
 	boolean_t	bw_ctl = B_FALSE;			\
 								\
 	ASSERT((head) != NULL);					\
@@ -579,12 +579,12 @@
 	ASSERT(MUTEX_HELD(&(mac_srs)->srs_lock));			\
 									\
 	srs_rx->sr_poll_pkt_cnt -= cnt;					\
-	if ((srs_rx->sr_poll_pkt_cnt <= srs_rx->sr_poll_thres) && 	\
-		(((mac_srs)->srs_state &				\
-		(SRS_POLLING|SRS_PROC|SRS_GET_PKTS)) == SRS_POLLING))	\
+	if ((srs_rx->sr_poll_pkt_cnt <= srs_rx->sr_poll_thres) &&	\
+	    (((mac_srs)->srs_state &					\
+	    (SRS_POLLING|SRS_PROC|SRS_GET_PKTS)) == SRS_POLLING))	\
 	{								\
 		(mac_srs)->srs_state |= (SRS_PROC|SRS_GET_PKTS);	\
-		cv_signal(&(mac_srs)->srs_cv); 				\
+		cv_signal(&(mac_srs)->srs_cv);				\
 		srs_rx->sr_below_hiwat++;				\
 	}								\
 }
@@ -639,7 +639,7 @@
 
 extern void mac_soft_ring_worker_wakeup(mac_soft_ring_t *);
 extern void mac_soft_ring_blank(void *, time_t, uint_t, int);
-extern mblk_t *mac_soft_ring_poll(mac_soft_ring_t *, int);
+extern mblk_t *mac_soft_ring_poll(mac_soft_ring_t *, size_t);
 extern void mac_soft_ring_destroy(mac_soft_ring_t *);
 extern void mac_soft_ring_dls_bypass(void *, mac_direct_rx_t, void *);