On Fri, 2015-11-06 at 14:57 +0300, Sergei Shtylyov wrote: 
> Hello.
> 
> On 11/6/2015 12:25 AM, Michael Chan wrote:
> 
> > Assign the return value from bitmap_find_free_region() to an integer
> > variable and check for negative error codes first, before assigning
> > the bit ID to the unsigned sw_id field.
> >
> > Reported-by: Dan Carpenter <[email protected]>
> > Cc: Dan Carpenter <[email protected]>
> > Signed-off-by: Michael Chan <[email protected]>
> > ---
> >   drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 +++++----
> >   1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c 
> > b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > index a62deff..db15c5e 100644
> > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
> > @@ -5307,7 +5307,7 @@ static int bnxt_rx_flow_steer(struct net_device *dev, 
> > const struct sk_buff *skb,
> >     struct bnxt_ntuple_filter *fltr, *new_fltr;
> >     struct flow_keys *fkeys;
> >     struct ethhdr *eth = (struct ethhdr *)skb_mac_header(skb);
> > -   int rc = 0, idx;
> > +   int rc = 0, idx, bit_id;
> 
>     I'd use the already declared 'rc' variable.
> 

I agree with you.  Normally, rc should only contain 0 or negative error
codes and is returned to the caller.  In this particular case, the
caller expects negative or non negative values and we could have used
rc.

Perhaps I'll make the change in the next round of patches.  Thanks.

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

Reply via email to