Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1603634ybm; Sat, 30 May 2020 14:27:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3A8qy6CsSdMAc/qUVkK4vlmz7ppuu3YG6t+6uMd2JaIPlx4y12WXbBZJjz4jIJ7O3vSJ6 X-Received: by 2002:a17:906:5906:: with SMTP id h6mr12802409ejq.262.1590874022586; Sat, 30 May 2020 14:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590874022; cv=none; d=google.com; s=arc-20160816; b=VLSiRnj0TvhDhZ7XLH/m/SOgWdiivbS9ktbDME7qwu/9uxgDiIh0WQGjMquLB9WEhA 3up/kXFjOQpEuI8YVD+vQL3CCzKm1x4ofnYTHwYfEwpx4Tv7E4whHAARsRgSGD/V97FN wqG7QrhxeB33M9sr2fbszuQFsNsBWmg5iNEQ2JbK3zTsUuDcgdNlkJayzNWhoKbRzNv6 jGThaX7+Y/Di8rVQdSaZNARTleXQ3uXev7uFKXxtJnVU82xEPBoztDSSWbBPtmEyW6L5 3wlOag4LXE9MbmpfMGIfv27G0gjy4NZZlgyDOW5KDSmEfhlM7nrmDtW59v9eM89pizm/ 7nMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=QmoOwPdh/Yl0z/r64VCHCnCtjbrPdNoeXim/FncXpAc=; b=itp88r6Uvkxx/sH7H57LdBSOkmFQl5OQ6a4B0j8qIEM2N82L0YQDF4jI0Hu5x3wbtb UjNkCBrQEMGDFhcxqjNQ7xEIEYEpm/2samKG8NUV0EiiLA+74/aGkETajKkCnALiWXTn Bk7WscaUSfz6DaPOppujj8ptGQoiMyI3es8saYpJuW44sTlRI/LGlrHEB5DExnrHFa6w fo7rZt5kkrnNgcjjDOVpnl69Baj0wQh5Yja6Q9XEBVGYXwzAYan9m/Lw08HdWpUxOM/c 4jgS+J/EC8WM/6oUNDmK4CM2gbE3ssLjHLRzOv+pc84KZx38TL5dAY19Ba5HO3NLG1+P e9tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NzvdWBfY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si5035939edp.600.2020.05.30.14.26.39; Sat, 30 May 2020 14:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NzvdWBfY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729354AbgE3VW3 (ORCPT + 99 others); Sat, 30 May 2020 17:22:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728999AbgE3VW2 (ORCPT ); Sat, 30 May 2020 17:22:28 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75F0BC03E969 for ; Sat, 30 May 2020 14:22:27 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id n24so5582435ejd.0 for ; Sat, 30 May 2020 14:22:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QmoOwPdh/Yl0z/r64VCHCnCtjbrPdNoeXim/FncXpAc=; b=NzvdWBfYHs81uoSKig5N1GjDzcPaZ2kmA/RsrJ+LNhPnApVvHVgXKqX4JtRNq7wiZG KsS3JM+nMSx1x2v0Zd8Mze/jofq/xzFx57vBwcmqcD76yIb6f2Yi0oHAYrmkeiFlg4Ld JnEf8DM6aKJXuhGkEjjdHBP9lblPiWv0yh15zAUjT5k8iVlq0qfI/5hZ3mLvpc4aQVtH bpSP/ORJkheDxrHolOsG1xNQI/A2wymwbddq9qJnvIdU9eH9WaqnJZTMo85S2stNrRl6 bs9y6qI1aajckXZWZBe4gjGixnpTsw8wK6efnWihhnYLa9iurgSWXczjQ9wLdJVrbYBv 71kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=QmoOwPdh/Yl0z/r64VCHCnCtjbrPdNoeXim/FncXpAc=; b=dxzAd+R8E0B52PMecJKf+OF13rOJ3z+FiZe0uGx6VDmrvzL8pySu0ni7dvd+nhSyDe 1F9Qhj45pXBKAdthbuMybH/B+AzIkJOsLblL4ljCKJmAHeg73mqgowR8J3/Xmu9QkUI0 OIUY/SYVYw7qzxd2tyX+Vjy03lOboO0KQBQhU9PrMALVrcUgUiXL/oWP1/80AgxjGzQA oTxtVEgkDryqhSklewKcOoJI/qI5Ws/vs8w+QSmXFRfVNoCOLLg0gXgWGXl75o8wVDfn pyw7BxvRv5ztmnseT/05nWDsLuZeToXgYG8RMouWlTEr1n5gU44OXwQ/f6xd1X6/XGTH Qn9Q== X-Gm-Message-State: AOAM530aIj+FHNHwqeP+l9+RGmXvnZPwh1OUZX2W3vc+TyaBCQzPTUIn vJZ44A/0mWbVxk2pG1M8prs= X-Received: by 2002:a17:906:c344:: with SMTP id ci4mr12482495ejb.331.1590873746285; Sat, 30 May 2020 14:22:26 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 93sm10950559edy.49.2020.05.30.14.22.25 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 May 2020 14:22:25 -0700 (PDT) Date: Sat, 30 May 2020 21:22:25 +0000 From: Wei Yang To: Wei Yang Cc: akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, christian.brauner@ubuntu.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bitops: use the same mechanism for get_count_order[_long] Message-ID: <20200530212225.l2zbkq5mrvkabxik@master> Reply-To: Wei Yang References: <20200525215958.21653-1-richard.weiyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200525215958.21653-1-richard.weiyang@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Andrew, Would you mind picking up this one? The test module doesn't show any warning after this on applied. On Mon, May 25, 2020 at 09:59:58PM +0000, Wei Yang wrote: >These two functions share the same logic. > >Signed-off-by: Wei Yang >--- > include/linux/bitops.h | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > >diff --git a/include/linux/bitops.h b/include/linux/bitops.h >index 5b5609e81a84..80703ef27aee 100644 >--- a/include/linux/bitops.h >+++ b/include/linux/bitops.h >@@ -188,12 +188,10 @@ static inline unsigned fls_long(unsigned long l) > > static inline int get_count_order(unsigned int count) > { >- int order; >+ if (count == 0) >+ return -1; > >- order = fls(count) - 1; >- if (count & (count - 1)) >- order++; >- return order; >+ return fls(--count); > } > > /** >-- >2.23.0 -- Wei Yang Help you, Help me