From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751556AbdEBVpU (ORCPT ); Tue, 2 May 2017 17:45:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:53370 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751074AbdEBVpT (ORCPT ); Tue, 2 May 2017 17:45:19 -0400 From: NeilBrown To: Wei Yang , Wei Yang Date: Wed, 03 May 2017 07:45:12 +1000 Cc: shli@fb.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bitops.h: use BITS_PER_LONG to simplify BITS_TO_LONGS In-Reply-To: <20170502132823.GB7654@WeideMacBook-Pro.local> References: <20170318003743.24639-1-richard.weiyang@gmail.com> <20170502132823.GB7654@WeideMacBook-Pro.local> Message-ID: <878tmfq6fr.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, May 02 2017, Wei Yang wrote: > Hi, masters > > Not sure this one is acceptable? You'd have better luck getting a response if you post things like this to akpm - he tends to collect miscellaneous bits and pieces. I don't think the patch makes more that a tiny improvement and I wouldn't bother with it, but maybe Andrew will. NeilBrown > > 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 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAlkI/egACgkQOeye3VZi gbl09BAAwmBREJQWHy+YUlK6E6KfXU4nuBbNz/ftpKn4HnJwGFxhjMbPFP1VCWPR R6HolbX2qJZucEWxOedjygmigi8/zlwgjWvbuu+wJ6sYPrK9BLqP0VTVoz5u5aZX Y2HFgsH53WfPITPyOxWsf+dzZWrnM9tWXdv77WkBeFdQMAU65U30A+WvTrQTbJWp i5AZpjJyxDGHf0D1Q/Cr6zRzf8Inm+daGfYBpwqaH1HPDB6v4R7t6bO/Xyt7PaT+ 6fw/I+ZUIFVrSJtpstyBT+V/cGfHDxZF4VJmtuCuZOav/GTkhzZodJ+ebNmGstR5 4mdzL4zMJ2b4shYDRdWnhDP/5WwpQbL+Jh1ZH0B3wKNeyeu512Csj6S9pbT6Gckv 2KDUpF/JBqvrYFUJS68OztOxm/b+EQNt0mZjDJW+zIGv5iNprhEZHVFi9PbxgC5X 2BCoZhIANnn58QMa9ay3xvdiNr3c2GPjI7p0QlXoKQ2/OJ+Di9E7CchD/uBHpDOv 79wFeUwKV36dopWdfK+km+1Y3M57JpTma4Ud3ANi3Ns7IG7bmW8zenC00tjFn4qK dGDljpCX7vFpS+2EiOpMwVN8uyu1wgRzIYDwPIUpCsZRc8tQcn4Abnyhtved0BS8 NRyzXnq/ry33J8KD4JXjbGaaCW4ecUpn7TDl5hWo0+osM+Y+IZ4= =xFrt -----END PGP SIGNATURE----- --=-=-=--