From patchwork Tue Oct 5 05:40:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12535605 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 919BDC433EF for ; Tue, 5 Oct 2021 05:41:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AAAF61507 for ; Tue, 5 Oct 2021 05:41:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232084AbhJEFmx (ORCPT ); Tue, 5 Oct 2021 01:42:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbhJEFmu (ORCPT ); Tue, 5 Oct 2021 01:42:50 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 556F7C061745; Mon, 4 Oct 2021 22:41:00 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id k26so16430687pfi.5; Mon, 04 Oct 2021 22:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sW0jJ5BzCWKEZDvFC9cMEYLIv2cIm64unRMGWihrNWQ=; b=WOXswavyJMWF/0Lt4Wn5Zd9XNa+PO32+1yDRh6F1FfPSNi9pdMeOkEIZfaKf+IuvZf vObi+qExEYPtOu22bBx/YhHhkY5vhMQdnRI3kX43P+17BNzwmRpKDXQS6u6RrsRl9QBt n50kGkLgBKMCb/LQoRYmfQ0VJbmdBQcxiocYN9/yiaHvOXejw9e/GxVLLEVqlcuj+c1J V5Ef8Ha5eTh9EalE3TTqAgLW8weAuxSwc6pRi6vTMjg8K04oHYdwuKt2arpHi6nWgE6b Btpgx3yBMYmSGtH6ESnXAbavbBxPYQjyWN+ykhZvV5MsqN2faV+1jMR+5W/O08yRYDnS fOFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sW0jJ5BzCWKEZDvFC9cMEYLIv2cIm64unRMGWihrNWQ=; b=O2tUQNA0ENZ0vNZ+bTfdXGeLmqSCm6hnbD0UB1kxAXmkaprL3wGD52raJfXnkK70hh /Zn2qqO341nJiIhUsrew5BODcyzj+20Dl4760fGzfKTeXzTEVxkTmW0ef9hqIZC+Sd8u txoMNpEzll/ywFdUojZtI3SgFs5Y0hl0VFN+mIxGJ9h0R+FLUVCfIQMTrmztoHv+UW2B BO8DZGTR95Q3anAt8x4m6R6RpqypP5v9pmJHRUI/34btJIWma6ZtMh+Y+2no0L8oN6bA 60mbsDK8EVn4E4Y4PEJXPUneaaM6/Tt79g1CjfdNfxuX3OHWnKJXCzgPKR9M7YVulfEW 4Rcg== X-Gm-Message-State: AOAM530jKZy5N6weqNODg3otd/EZt1aDkHtDfTyJT6u13MjTXk3ygAPk 0gUxrnMNU1cKy40ZTuXRQz8= X-Google-Smtp-Source: ABdhPJxojNM5f46KxY2QTVGFBd3LT+L/Ruhn4FYG3sxC1D9oFomJBdBrVF6aAr0Lyq/9vAihEusPpw== X-Received: by 2002:a63:d806:: with SMTP id b6mr14155714pgh.395.1633412459843; Mon, 04 Oct 2021 22:40:59 -0700 (PDT) Received: from localhost (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id a5sm5897048pff.219.2021.10.04.22.40.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 22:40:59 -0700 (PDT) From: Yury Norov To: Stephen Rothwell Cc: Yury Norov , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mmc@vger.kernel.org, linux-perf-users@vger.kernel.org, kvm@vger.kernel.org, "James E.J. Bottomley" , Alexander Lobakin , Alexander Shishkin , Alexey Klimov , Andrea Merello , Andy Shevchenko , Arnaldo Carvalho de Melo , Arnd Bergmann , Ben Gardon , Benjamin Herrenschmidt , Brian Cain , Catalin Marinas , Christoph Lameter , Daniel Bristot de Oliveira , David Hildenbrand , Dennis Zhou , Geert Uytterhoeven , Heiko Carstens , Ian Rogers , Ingo Molnar , Jaegeuk Kim , Jakub Kicinski , Jiri Olsa , Joe Perches , Jonas Bonn , Leo Yan , Mark Rutland , Namhyung Kim , Palmer Dabbelt , Paolo Bonzini , Peter Xu , Peter Zijlstra , Petr Mladek , Rasmus Villemoes , Rich Felker , Samuel Mendoza-Jonas , Sean Christopherson , Sergey Senozhatsky , Shuah Khan , Stefan Kristiansson , Steven Rostedt , Tejun Heo , Thomas Bogendoerfer , Ulf Hansson , Will Deacon , Wolfram Sang , Yoshinori Sato , kernel test robot Subject: [PATCH 01/16] bitops: protect find_first_{,zero}_bit properly Date: Mon, 4 Oct 2021 22:40:44 -0700 Message-Id: <20211005054059.475634-2-yury.norov@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211005054059.475634-1-yury.norov@gmail.com> References: <20211005054059.475634-1-yury.norov@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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. Signed-off-by: Yury Norov Fixes: 2cc7b6a44ac2 ("lib: add fast path for find_first_*_bit() and find_last_bit()") Reported-by: kernel test robot Tested-by: Wolfram Sang --- include/asm-generic/bitops/find.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/asm-generic/bitops/find.h b/include/asm-generic/bitops/find.h index 0d132ee2a291..835f959a25f2 100644 --- a/include/asm-generic/bitops/find.h +++ b/include/asm-generic/bitops/find.h @@ -97,6 +97,7 @@ unsigned long find_next_zero_bit(const unsigned long *addr, unsigned long size, #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 unsigned long *addr, unsigned long size) 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 unsigned long *addr, unsigned long size) return _find_first_zero_bit(addr, size); } +#endif + #else /* CONFIG_GENERIC_FIND_FIRST_BIT */ #ifndef find_first_bit