[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DM2PR03MB4142B3022ACA285C0DC261D9C9C0@DM2PR03MB414.namprd03.prod.outlook.com>
Date: Mon, 13 Jul 2015 07:43:59 +0000
From: Manoil Claudiu <claudiu.manoil@...escale.com>
To: David Miller <davem@...emloft.net>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net-next 2/4] gianfar: Fix and cleanup rxbd status
handling
> -----Original Message-----
> From: David Miller [mailto:davem@...emloft.net]
> Sent: Saturday, July 11, 2015 4:25 AM
> To: Manoil Claudiu-B08782
> Cc: netdev@...r.kernel.org
> Subject: Re: [PATCH net-next 2/4] gianfar: Fix and cleanup rxbd status
> handling
>
> From: Claudiu Manoil <claudiu.manoil@...escale.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 majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists