From patchwork Wed Sep 8 02:58:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12480003 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BABBCC433FE for ; Wed, 8 Sep 2021 02:59:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 747F261102 for ; Wed, 8 Sep 2021 02:59:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 747F261102 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1A10094003F; Tue, 7 Sep 2021 22:59:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 15004900003; Tue, 7 Sep 2021 22:59:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0679594003F; Tue, 7 Sep 2021 22:59:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0006.hostedemail.com [216.40.44.6]) by kanga.kvack.org (Postfix) with ESMTP id E7B53900003 for ; Tue, 7 Sep 2021 22:58:59 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id A9FCE181AC9B6 for ; Wed, 8 Sep 2021 02:58:59 +0000 (UTC) X-FDA: 78562899198.28.79B7A77 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf28.hostedemail.com (Postfix) with ESMTP id 6C69590000A2 for ; Wed, 8 Sep 2021 02:58:59 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4348D60E52; Wed, 8 Sep 2021 02:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1631069938; bh=6MnXxYIUWDtg0IGe5IuxtCv8ZrxNDexoYzuAJkxxQp0=; h=Date:From:To:Subject:In-Reply-To:From; b=wMlpbkLaw+1VXQ4aH72u8A4C8ONZGANhnEv9TbxPdK2puUP9FmsZOsAAn4T0oQ3/4 YAnGEjcpJRne6FG5m8d1IuNxq3OItT7dAFWSWJKNI/EUNy8szOKLsMMIkNFSaBY69v DbBKN3ScpoM0uMO5eKvbQx9gcLhlfiVr/y0ZHoog= Date: Tue, 07 Sep 2021 19:58:57 -0700 From: Andrew Morton To: aklimov@redhat.com, akpm@linux-foundation.org, alobakin@pm.me, andriy.shevchenko@linux.intel.com, dennis@kernel.org, jolsa@redhat.com, linux-mm@kvack.org, lkp@intel.com, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, ulf.hansson@linaro.org, will@kernel.org, wsa+renesas@sang-engineering.com, yury.norov@gmail.com Subject: [patch 107/147] bitops: protect find_first_{,zero}_bit properly Message-ID: <20210908025857.8qR6jzQxc%akpm@linux-foundation.org> In-Reply-To: <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=wMlpbkLa; spf=pass (imf28.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6C69590000A2 X-Stat-Signature: 6itgcgwjk8xge665znudsw6yufmwjqnh X-HE-Tag: 1631069939-100730 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Yury Norov Subject: bitops: protect find_first_{,zero}_bit properly Patch series "Resend bitmap patches". This patch (of 17): find_first_bit() and find_first_zero_bit() are not protected with ifdefs as other functions in find.h. It causes build errors on some platforms if CONFIG_GENERIC_FIND_FIRST_BIT is enabled. Link: https://lkml.kernel.org/r/20210814211713.180533-1-yury.norov@gmail.com Link: https://lkml.kernel.org/r/20210814211713.180533-2-yury.norov@gmail.com Fixes: 2cc7b6a44ac2 ("lib: add fast path for find_first_*_bit() and find_last_bit()") Signed-off-by: Yury Norov Reported-by: kernel test robot Tested-by: Wolfram Sang Cc: Alexander Lobakin Cc: Alexey Klimov Cc: Andy Shevchenko Cc: Dennis Zhou Cc: Jiri Olsa Cc: Ulf Hansson Cc: Will Deacon Signed-off-by: Andrew Morton --- include/asm-generic/bitops/find.h | 5 +++++ 1 file changed, 5 insertions(+) --- a/include/asm-generic/bitops/find.h~bitops-protect-find_first_zero_bit-properly +++ a/include/asm-generic/bitops/find.h @@ -97,6 +97,7 @@ unsigned long find_next_zero_bit(const u #ifdef CONFIG_GENERIC_FIND_FIRST_BIT +#ifndef find_first_bit /** * find_first_bit - find the first set bit in a memory region * @addr: The address to start the search at @@ -116,7 +117,9 @@ unsigned long find_first_bit(const unsig return _find_first_bit(addr, size); } +#endif +#ifndef find_first_zero_bit /** * find_first_zero_bit - find the first cleared bit in a memory region * @addr: The address to start the search at @@ -136,6 +139,8 @@ unsigned long find_first_zero_bit(const return _find_first_zero_bit(addr, size); } +#endif + #else /* CONFIG_GENERIC_FIND_FIRST_BIT */ #ifndef find_first_bit