Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp377640rwe; Wed, 24 Aug 2022 02:33:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR72+eGYOKkuByp6QmCuZmrv0Pe1TUFDyUidXfDEa0TSGA6DnWtrBDkF92/F4hMBOaKTvRkJ X-Received: by 2002:a05:6402:11c8:b0:440:6513:be2c with SMTP id j8-20020a05640211c800b004406513be2cmr6838959edw.45.1661333580657; Wed, 24 Aug 2022 02:33:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661333580; cv=none; d=google.com; s=arc-20160816; b=TTjhXCYR+5vFJWI2p/pOXHQmbgqtV1gnel5uw8jFDmWonZbGzawcl92TEcp1oNz+vT 4Zew4y2m0LaTtJN1tZr5AlC/smlook6sbjVVu82gGONguNtIbXg2MlDusJ/zQg+Puvnf mfoYL6Ro566mScLjEM+HXHNJW8eFdWWuBfe4ZZTSpD11XGfYX6YKIhfiMQ+3yOgu9wI5 PKvD7V8+IorGLmQqHLKYjUwk4f0IVsg3ZLIl1LW9xuUcJhEbIDt8kZxk7Dj1huXHwmI3 Xiwhtu78Nqc+sLpUHZatYz2+tJg/EM2tTIqfEd9VStn/SJUzvWmuZ+lu8gair+jzAV7k UHaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xWe+ZWv+j/DBZNUi9i5IoxbVooEDeShD1NU+nnYJNXA=; b=eBbCVb620WkfuZnEtpMRJ9mtWsTfD3zI+4Cog/PBT5RfqaeeIgd+brpXadBDrM+EAt 1brkJUFvyh/FlGj3eFj8RIn2bOFAkl/LzF491cpYVjNsfeuf3gvTiBRYhKxzxD9UwCF9 n9jHFS39g+GQ7yTBMruQju8HfV7zDSlG9ToIx8TBhtyRzxFhYw5YNCstM6HNEHUP/P/+ mIvHznab4gZYJRJy6UUOUO6Vs7tef4mUcF7w1udFXtA/IOh0Dw/rtN0UTA9PBewjPIDQ t+mBawA2xq5L9Ms1+R+2mxhh5QgRYEuMjV/Hsh6UN7QLQydYOV7xfkX91NzR/HckYE3G PdhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gp773N5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk12-20020a1709077f8c00b00730870cb4b6si1758201ejc.621.2022.08.24.02.32.34; Wed, 24 Aug 2022 02:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gp773N5D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S236027AbiHXJXN (ORCPT + 99 others); Wed, 24 Aug 2022 05:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231561AbiHXJXK (ORCPT ); Wed, 24 Aug 2022 05:23:10 -0400 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2312B83F24 for ; Wed, 24 Aug 2022 02:23:10 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id y4so12424764qvp.3 for ; Wed, 24 Aug 2022 02:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=xWe+ZWv+j/DBZNUi9i5IoxbVooEDeShD1NU+nnYJNXA=; b=gp773N5DOmVojdNAUa1mrNy4Pfqyv6ZLwgIWUY2J8rlNHYAVh8MGtgBx+13uSVw3gK BXZKwrhhY8lJcbdbY4/hJ4VGtZzysEZiuNHFI4W9EnMxZ9ueJXIQJcaOC1CaHnLhrLZm 9fM6R4fi3R68FLw8nulsKIZxAu/CAdxEwNFP7LJUEwa2KwYJ2+0uHEjDnhG0tZSaLqdO p0DbtPTqxGcW6WxkePGNPLblV3lpz+j9YTcxUKLchhao9pk7j3fDQvu8qckBq0SE9a9X oJ/BdPAC467Ryhms/QrVBxAD8umb3dFVPigVC/q6Ho5daMIcQa0bUYsdHFg73h7CGRP4 Jrzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=xWe+ZWv+j/DBZNUi9i5IoxbVooEDeShD1NU+nnYJNXA=; b=zzp/guif0cgvX4fkbYV5BoUS++fvjdJ0QDNj6gvhRVZFNSMpdMr1RCGUUKhxqKUIdR WaKUmhPR5L6zp+FHGizWDy3g+/so6o9n/YOCIDpTFe5n+0IQe5si9k8Cc0F4RtxSCxnn yVCr9oeRJcpLHqldRJlAelZbTQi7Ay5u+VdGRAH+LhzUQFkJu9F8/QIouxisR5Qq5YqG H/+DwaeIlg5lmbAhOjtfwUYtIm8/JaTsux7zz0sUJpW7OMBi/nGrJ2BH2e29M7kuS0Lm 0k/x/OabvY0ROThHW23/qhotpgoaN7haouozFZ7WDVFtrFNHtpDPxHjaAD75UyZkgONe lPLg== X-Gm-Message-State: ACgBeo1kU5/LwfZ1BWCpgqFqyc/3aBZTtdM2zMg74tPUqhSkGE9v/nfd Ldt9J5RpJehsDTUfAaXhPkLBPSCteNiGfittx7Y= X-Received: by 2002:a0c:aadb:0:b0:497:1283:c849 with SMTP id g27-20020a0caadb000000b004971283c849mr2011106qvb.11.1661332989119; Wed, 24 Aug 2022 02:23:09 -0700 (PDT) MIME-Version: 1.0 References: <20220824012624.2826445-1-yury.norov@gmail.com> <20220824012624.2826445-3-yury.norov@gmail.com> In-Reply-To: <20220824012624.2826445-3-yury.norov@gmail.com> From: Andy Shevchenko Date: Wed, 24 Aug 2022 12:22:33 +0300 Message-ID: Subject: Re: [PATCH v2 2/3] lib/find_bit: create find_first_zero_bit_le() To: Yury Norov Cc: Linus Torvalds , Linux Kernel Mailing List , Guenter Roeck , Dennis Zhou , Russell King , Catalin Marinas , Andy Shevchenko , Rasmus Villemoes , Alexey Klimov , Kees Cook , Andy Whitcroft Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 24, 2022 at 5:17 AM Yury Norov wrote: > > find_first_zero_bit_le() is an alias to find_next_zero_bit_le(), > despite that 'next' is known to be slower than the 'first' version. > > Now that we have a common FIND_FIRST_BIT() macro helper, it's trivial > to implement find_first_zero_bit_le() as a real function. > > Moving find_*_le() to a separate file helps to fit the FIND_FIRST_BIT() > to the _le needs by wiring word_op to swab. > > Signed-off-by: Yury Norov > --- > Like other find_*_le() functions, the new one takes void *addr, instead > of unsigned long *. This should be fixed for all in a separate series. From this comment it is unclear to me why we can't fix them first and then apply this with the correct type? ... > +#define word_op swab > +#include "find_bit.h" Looking at this, I would rather always require to define __ffs_word_op (or whatever name) in the user and replace #ifndef in the find_bit.h with #error "The __ffs_word_op must be defined before including find_bit.h!" -- With Best Regards, Andy Shevchenko