Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp911001ybs; Mon, 25 May 2020 02:18:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCDZYgvbdSGFxcb/oI3sOfKqzNESU9Gk3vW11VCC2wmTZnw07YepgKWOIjy2Sd5tcEwUDN X-Received: by 2002:a17:906:4113:: with SMTP id j19mr17611536ejk.144.1590398281031; Mon, 25 May 2020 02:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590398281; cv=none; d=google.com; s=arc-20160816; b=cCkkTCIx4ZUdpiSmctAEJnhGt3pGeWEpOTbzDuXrQDfhR8ZDlr1qviQk2f09GfngoX qqbfJKWD5PoSmhyIUXA5rQKuORpXemDq9PyiEzCojmsFtazXnO2tu7qJRQozDhk4XRoe Z1YGrelEafOJugVKahav2fuSd3jE3YaMu/OH7FAay15CrTwOk56ZtyKY8zpl+1eXh9GL e7G/y3QDC66KxI8W9+ulIPnTW/vy99e9hFfe2P+DcdYMyDMiGl6LV/auC/1OQ7WuqcXd ERMO3Lwy5Kjy0thGmLL11ODlWlVG1xiYzXNX0dQunsFL5B8OW84BnHLZbIWluH3uDSiE /emw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=3m8nYGt/lbIthSBi7Ary6nmXZW7Hcy3x8AzfhX+qSZA=; b=m2Gb85ToOG76gKV1CauzgE5DhMl0HwXqzmYXKnB7zpQlCcxK56z1ts5WVxkaL+ZV6v BnwV6PI2puDuLZDplR7ORrBk8o1EXQlMJQ5IW+MX5dCOXiqvW8vd159xxAXgGQAkcmQT q14vyTmzTgdLhyHNRAQ2WKttqz6ikhjkepu5fQ8Fcrl/EujHWAZUcWPXu/sN/tsBO5K5 Uz2VcyKDYuCYRFWIsyEzxLJMOCWOUFu4nxKev1NFrhiNxthQD77xs/G9exsUEv5IUV1V h3kpYTVj/KtFL74gJNFEvh6LCZ3uHAr8hddZYbN7PappylAmdutV73JMMrRkJ0bvD+G3 sx0g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s20si9273266eju.605.2020.05.25.02.17.37; Mon, 25 May 2020 02:18:01 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389239AbgEYJO5 (ORCPT + 99 others); Mon, 25 May 2020 05:14:57 -0400 Received: from mga03.intel.com ([134.134.136.65]:57779 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbgEYJO5 (ORCPT ); Mon, 25 May 2020 05:14:57 -0400 IronPort-SDR: pzA+Xej8jR30BLyJ3+ot7KUZJgJTCMuYKk8Eis02aoVtRu7KqiLOqCjPb/XNOU6je4VwYeY2zB SIjAd7JHG4lQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 May 2020 02:14:56 -0700 IronPort-SDR: gDYKHAOYkqlgCwaaP/c2zfF1dgDOsfr6KryjH0LorQZAhaWgqVSWimpZPXJivcXEWN22KjDDbz 5cQvKdAMKegw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,432,1583222400"; d="scan'208";a="309965022" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by FMSMGA003.fm.intel.com with ESMTP; 25 May 2020 02:14:55 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jd9CE-008kwV-PI; Mon, 25 May 2020 12:14:58 +0300 Date: Mon, 25 May 2020 12:14:58 +0300 From: Andy Shevchenko To: Wei Yang Cc: akpm@linux-foundation.org, christian.brauner@ubuntu.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] bitops: simplify get_count_order_long() Message-ID: <20200525091458.GK1634618@smile.fi.intel.com> References: <20200524123551.9469-1-richard.weiyang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200524123551.9469-1-richard.weiyang@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 24, 2020 at 12:35:51PM +0000, Wei Yang wrote: > These two cases could be unified into one. Care to provide a test case which supports your change? > Signed-off-by: Wei Yang > --- > include/linux/bitops.h | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/include/linux/bitops.h b/include/linux/bitops.h > index 9acf654f0b19..5b5609e81a84 100644 > --- a/include/linux/bitops.h > +++ b/include/linux/bitops.h > @@ -206,10 +206,7 @@ static inline int get_count_order_long(unsigned long l) > { > if (l == 0UL) > return -1; > - else if (l & (l - 1UL)) > - return (int)fls_long(l); > - else > - return (int)fls_long(l) - 1; > + return (int)fls_long(--l); > } -- With Best Regards, Andy Shevchenko