diff mbox

[2/2] net: ipv4: Use BIT macro.

Message ID 58dc0820.8943620a.67760.546e@mx.google.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Varsha Rao March 29, 2017, 7:16 p.m. UTC
Replace bitwise left shift by one operations with BIT() macro. This patch
fixes the checkpatch issue.

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
 net/ipv4/tcp_bbr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Eric Dumazet March 29, 2017, 8:16 p.m. UTC | #1
On Thu, 2017-03-30 at 00:46 +0530, Varsha Rao wrote:
> Replace bitwise left shift by one operations with BIT() macro. This patch
> fixes the checkpatch issue.
> 
> Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
> ---
>  net/ipv4/tcp_bbr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
> index 4da4bc1..9f2c869 100644
> --- a/net/ipv4/tcp_bbr.c
> +++ b/net/ipv4/tcp_bbr.c
> @@ -71,10 +71,10 @@
>   * an issue. The upper bound isn't an issue with existing technologies.
>   */
>  #define BW_SCALE 24
> -#define BW_UNIT (1 << BW_SCALE)
> +#define BW_UNIT BIT(BW_SCALE)
>  
>  #define BBR_SCALE 8	/* scaling factor for fractions in BBR (e.g. gains) */
> -#define BBR_UNIT (1 << BBR_SCALE)
> +#define BBR_UNIT BIT(BBR_SCALE)
>  
>  /* BBR has the following modes for deciding how fast to send: */
>  enum bbr_mode {

Well, no.  BIT() is using unsigned long.

#define BIT(nr)    (1UL << (nr))


This change might have unintended effects.

Maybe checkpatch should be fixed.
diff mbox

Patch

diff --git a/net/ipv4/tcp_bbr.c b/net/ipv4/tcp_bbr.c
index 4da4bc1..9f2c869 100644
--- a/net/ipv4/tcp_bbr.c
+++ b/net/ipv4/tcp_bbr.c
@@ -71,10 +71,10 @@ 
  * an issue. The upper bound isn't an issue with existing technologies.
  */
 #define BW_SCALE 24
-#define BW_UNIT (1 << BW_SCALE)
+#define BW_UNIT BIT(BW_SCALE)
 
 #define BBR_SCALE 8	/* scaling factor for fractions in BBR (e.g. gains) */
-#define BBR_UNIT (1 << BBR_SCALE)
+#define BBR_UNIT BIT(BBR_SCALE)
 
 /* BBR has the following modes for deciding how fast to send: */
 enum bbr_mode {