From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751099AbdEBN23 (ORCPT ); Tue, 2 May 2017 09:28:29 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:33567 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750713AbdEBN21 (ORCPT ); Tue, 2 May 2017 09:28:27 -0400 Date: Tue, 2 May 2017 21:28:23 +0800 From: Wei Yang To: Wei Yang Cc: shli@fb.com, neilb@suse.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS Message-ID: <20170502132823.GB7654@WeideMacBook-Pro.local> Reply-To: Wei Yang References: <20170318003743.24639-1-richard.weiyang@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WYTEVAkct0FjGQmd" Content-Disposition: inline In-Reply-To: <20170318003743.24639-1-richard.weiyang@gmail.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --WYTEVAkct0FjGQmd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, masters Not sure this one is acceptable? On Sat, Mar 18, 2017 at 08:37:43AM +0800, Wei Yang wrote: >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 >=20 > /* >--=20 >2.11.0 --=20 Wei Yang Help you, Help me --WYTEVAkct0FjGQmd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJZCIl3AAoJEKcLNpZP5cTdev8P/RPDPiVuH6i1cBxuM5zGlOWe mRmTZdoxBV72UcudFKI9jr51kNlOZO7Am8F4TgGuF8YFwtcy1wvX6DeOlPG5gmG/ 9dxETwD+BjQZv6qm/vCaswPFhLM9n0X8M+yxS2q3dyOOIVF5FAgxYGnVKFM+nUsz Ldl4rqQOomKCqLBHGTf8d1aiNwCcnDdyIB55eOlRf9ywkc9kF4lb1W5ffwcSpRT2 jDsmryVi64IblFJUxK2XW4HtDAoA1rLX/ja+pVtgbE/kIawb7+6RX7IALNBgzCso 548k+RhBDK9JBa5us8EhBXbefddmILhCnarIJc1ohGQWMiLHYx5L1bdACMH3e8N9 wZU2HXlb+OUrGPkfC2DeI4kO1R20vQeAVUoN9wHs2inpwnxsWc0Ws4gekzZVF4sv pHn3Nk+bJtNvVN5okCR0//bS5gLkMv6neL/HRAVCzQ0hw3jbVOuiMJ79rDIw05YV G4g4rhtakAGpcWF3t9jfSe7ythGhbfPBfKXFJFSie01Xr4/6NQ42Axr0bhqIkGp6 YJWoHzAztsJivhP6h3fxKOgMXLlgf8t5BQ3MVtj8B7n84aRpRkVCF227tesHhfXz rg2XuR2lHyb2yH1Tj/ayJRxjyVJx0rAh0gIbzXDsaNALE1B8koQn4f9gIn4fgQ8n vLBxGEAitk5D1NmX5vxf =KAf0 -----END PGP SIGNATURE----- --WYTEVAkct0FjGQmd--