Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751248AbdCRBKJ (ORCPT ); Fri, 17 Mar 2017 21:10:09 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35569 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751087AbdCRBKI (ORCPT ); Fri, 17 Mar 2017 21:10:08 -0400 From: Wei Yang To: shli@fb.com, neilb@suse.com Cc: linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS Date: Sat, 18 Mar 2017 08:37:43 +0800 Message-Id: <20170318003743.24639-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 789 Lines: 25 The second parameter is the number of bits for type "long", which is already defined in header file. This patch replace the calculation with macro to make it more readable. Signed-off-by: Wei Yang --- include/linux/bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bitops.h b/include/linux/bitops.h index a83c822c35c2..923fe72d31e3 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -10,7 +10,7 @@ #define BIT_ULL_MASK(nr) (1ULL << ((nr) % BITS_PER_LONG_LONG)) #define BIT_ULL_WORD(nr) ((nr) / BITS_PER_LONG_LONG) #define BITS_PER_BYTE 8 -#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) +#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_LONG) #endif /* -- 2.11.0