Re: [PATCH] atheros/atlx: Simplify bit manipulations

2015-01-24 Thread David Miller
From: Rasmus Villemoes Date: Fri, 23 Jan 2015 12:06:52 +0100 > The code 'if (foo & X) foo &= ~X;' is semantically equivalent to > simply 'foo &= ~X;', but gcc generates about four instructions for the > former, one for the latter. Similarly, if X consists of a single bit, > 'if (!(foo & X)) X |=

Re: [PATCH] atheros/atlx: Simplify bit manipulations

2015-01-23 Thread Francois Romieu
Rasmus Villemoes : [...] > diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c > b/drivers/net/ethernet/atheros/atlx/atl2.c > index 84a09e8ddd9c..46d1b959daa8 100644 > --- a/drivers/net/ethernet/atheros/atlx/atl2.c > +++ b/drivers/net/ethernet/atheros/atlx/atl2.c > @@ -1278,14 +1278,10 @@ stati

[PATCH] atheros/atlx: Simplify bit manipulations

2015-01-23 Thread Rasmus Villemoes
The code 'if (foo & X) foo &= ~X;' is semantically equivalent to simply 'foo &= ~X;', but gcc generates about four instructions for the former, one for the latter. Similarly, if X consists of a single bit, 'if (!(foo & X)) X |= X;' can be replaced by 'foo |= X;'. In the atl2 case, gcc does know ho