> -----Original Message-----
> From: David Miller [mailto:da...@davemloft.net]
> Sent: Saturday, July 11, 2015 4:25 AM
> To: Manoil Claudiu-B08782
> Cc: netdev@vger.kernel.org
> Subject: Re: [PATCH net-next 2/4] gianfar: Fix and cleanup rxbd status
> handling
> 
> From: Claudiu Manoil <claudiu.man...@freescale.com>
> Date: Thu, 9 Jul 2015 19:24:42 +0300
> 
> > @@ -2921,6 +2921,7 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q
> *rx_queue, int rx_work_limit)
> >     i = rx_queue->next_to_clean;
> >
> >     while (rx_work_limit--) {
> > +           unsigned long lstatus;
> >
> >             if (cleaned_cnt >= GFAR_RX_BUFF_ALLOC) {
> >                     gfar_alloc_rx_buffs(rx_queue, cleaned_cnt);
> > @@ -2928,7 +2929,8 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q
> *rx_queue, int rx_work_limit)
> >             }
> >
> >             bdp = &rx_queue->rx_bd_base[i];
> > -           if (be16_to_cpu(bdp->status) & RXBD_EMPTY)
> > +           lstatus = be32_to_cpu(bdp->lstatus);
> > +           if (lstatus & BD_LFLAG(RXBD_EMPTY))
> >                     break;
> >
> >             /* order rx buffer descriptor reads */
> 
> "lstatus" is not an "unsigned long", it's a "u32".
> 
> Don't use ambiguous types for objects with exact known sizes.

I agree, will send v2.  Maybe I thought it would be safe enough
since old "status" was "unsigned short", but I agree about dispelling
the ambiguity by using u32.  Thanks.

Claudiu
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to