From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luc Van Oostenryck Subject: Re: sparse problem with Linux kernel v5.5 Date: Fri, 7 Feb 2020 13:43:05 +0100 Message-ID: <20200207124305.islfnt5kissyv6b6@ltop.local> References: <6ee65b69-9ffc-78c6-66b7-3ce586687d74@infradead.org> <20200206114619.bfszxgs6jmdgroo6@ltop.local> <3b68ba4b-f16a-8404-4e07-27788ebbfce3@infradead.org> <20200206200610.7ktqp2yzriw7zurx@ltop.local> <20200207082954.majgsx5trepwb46n@kafai-mbp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Return-path: Received: from mail-wm1-f68.google.com ([209.85.128.68]:35241 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbgBGMnJ (ORCPT ); Fri, 7 Feb 2020 07:43:09 -0500 Received: by mail-wm1-f68.google.com with SMTP id b17so2654990wmb.0 for ; Fri, 07 Feb 2020 04:43:08 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Cc: Martin KaFai Lau , Linus Torvalds , Alexei Starovoitov , Randy Dunlap , Linux-Sparse , Arthur Fabre On Fri, Feb 07, 2020 at 12:34:02PM +0100, Uwe Kleine-König wrote: > On 2/7/20 9:29 AM, Martin KaFai Lau wrote: > > I believe x == 1 needs an extra case since ilog2(0) won't work. > > > > Since this function (map creation) is not on the fast path, > > I currently opt for Linus's suggestion which its code is more > > self-explanatory. > > If you put my suggestion in a macro that is called for example > > ilog2_roundup() > > you might have both: easier code and self-explanation. This is, essentially, the same as the existing order_base_2(). Best regards, -- Luc