Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp936506rwe; Wed, 24 Aug 2022 11:35:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR6l4VPJqL9YRfckqGS5g841uxNK22Y6Ieu19giCHpZhedDzJbo/iSk34W8iCeBWJwz4wQeg X-Received: by 2002:a05:6402:298c:b0:446:a97:1800 with SMTP id eq12-20020a056402298c00b004460a971800mr253560edb.421.1661366141778; Wed, 24 Aug 2022 11:35:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661366141; cv=none; d=google.com; s=arc-20160816; b=hwjQAsbcslaJ8GUuWioEWZZu7sKUbsEHTUrq3C5uHnmrgn1Ckij8PYixsKTkQv+/PY vhLU5Gi6jOxdGmVyTvVJU3AsNhM01Tjjdy1Jja5kzB9KDjw8TDzPCEd/VF/GetTRHsw5 1bsXLk/UcXgAaHbo4XeZnvP6UM30hoV4JnlPOXzrLIjWpznBcBUYALMcixhZ55mCdue8 MMv5j9WeRQZGb3KixZ+KiTK68m6C0S+lBi/oaOTiS+QPBDTDT102I2lcKeAxooWb6+s0 412FjODsivAkx6LtylBZ6LFGF5uaC982Fgrj7I1L+mpX4juDxiyFZklxmbgkS34OYBpt VxQQ== 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=sDYCJ3jg9yuLE/OMVMOyabundH0O0Kkzt1VVF9Ipbj4=; b=FwFpk+BD+46oINubcqijP3N3N+yTli5eYBzmor2acbK8/MnroDErVxDETF2VvX88bN xtGj8sBYsXpH4BXDAtt20NsCqtb8j2ZBmJCWYRCsWdLfMvAOTVr9ALlHPHtEWutzce9n tABnD55LiXecZA1VND8r0wqDNXKsG6j5of7oc++Dhe1+xB8epnsnASDvBxKu5MfzL9TC wpAIFKH7MbuyYmHgiploLq059FzC8Sizf4cejSb+Oex1gSn+e5h9xCqzox0V3PDUW5hl 77JluXwudSgTOzUc7u+OeauGRtDERC7R+PqPjBjDJbLt082C4iWjd69vic+2/cgzIP1n MlSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ebK9tYay; 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 hv21-20020a17090760d500b00730babc11e3si2183266ejc.640.2022.08.24.11.35.16; Wed, 24 Aug 2022 11:35:41 -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=ebK9tYay; 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 S239016AbiHXRuq (ORCPT + 99 others); Wed, 24 Aug 2022 13:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238320AbiHXRun (ORCPT ); Wed, 24 Aug 2022 13:50:43 -0400 Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97722BC84 for ; Wed, 24 Aug 2022 10:50:41 -0700 (PDT) Received: by mail-qk1-x72e.google.com with SMTP id f4so13267346qkl.7 for ; Wed, 24 Aug 2022 10:50:41 -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=sDYCJ3jg9yuLE/OMVMOyabundH0O0Kkzt1VVF9Ipbj4=; b=ebK9tYay7XA+KAvD/bOK4BDp4VZTZQcqRrb04F9PHRUd8v+bfJF6j05/fRvQje4XH5 BA8P8gO5L8YwW31/Z+m8HaDNeoQHCAqCreI5/MBAtUVFl2m8WkJ/DaI8HBWF5NCOHqMc WPxDIk6U6eLQTCKyqwVqrpkHCN6ky7kS0Jpu4pnmS+f9+OHaOig7ULVpP1onLzIYjwLW XcPiK/NVpN3QqQ4Voc6Lt94wR0eiCvKJ8lH+7/+zGVoGIQkaPJ8+uU4p9brNVV5309Zf m6el0TSdSAjIyP/vODh+eSf9kTzk2Zs1PZSVBNCymQKYt9xnkhC9CZn0IzBtSzgH8x3h cGrA== 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=sDYCJ3jg9yuLE/OMVMOyabundH0O0Kkzt1VVF9Ipbj4=; b=b9eRMfexifxsRMBniJNrERizGkrKIlJBp/oO+KmEScpjhEb2F3pujpyXum87T1tRjN XS4QPFnhgbrVzpLITdHFnbuHw/GjAwovMaCObyFASiBkaiHJ0CNw4nd/KIGYbBumz41A fmBvVnUoq/a/VSR9EqlssGKNsTQtJbYJp96Lr6oWGXws8nH577CaJPfW+mDjC9xowG7u /UaBP/AXiqOsXYhm1d1kr2c5iwvreXhArrPsFMa8KZFD0iIP/kDXeMtP34E2SvFEn6tG E3BTSOcrSehRsR/jOig+iFshWZVOF8A2v5/ZhkyWykU1K+BXRoDv7wqne7BSQkM7yESx pi/w== X-Gm-Message-State: ACgBeo0cM050Q1SvHH/f1Ywj1CZAjv6CBfjPeG35ytfu1SNJjWPRBLIu vIYU/t/svds2udGeUIuADB/2ZY+0CL11nzS4Rzk= X-Received: by 2002:a05:620a:288a:b0:6b8:fcfe:db02 with SMTP id j10-20020a05620a288a00b006b8fcfedb02mr325985qkp.504.1661363440720; Wed, 24 Aug 2022 10:50:40 -0700 (PDT) MIME-Version: 1.0 References: <20220824012624.2826445-1-yury.norov@gmail.com> <20220824012624.2826445-3-yury.norov@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 24 Aug 2022 20:50:04 +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 4:37 PM Yury Norov wrote: > On Wed, Aug 24, 2022 at 12:22:33PM +0300, Andy Shevchenko wrote: > > On Wed, Aug 24, 2022 at 5:17 AM Yury Norov wrote: ... > > > 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? > > Because there is a codebase that relies on existing types, mostly in > filesystem code. And those fs fixes would require 5 or 6 patches. > > This would triple the length of this series, and is completely > unrelated. That's why I think that: > > > This should be fixed for all in a separate series. So comment update then, if a new version is required? ... > > > +#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!" > > This is a local header which is not intended to be included anywhere > except lib/find_bit{,_be}.c. I don't expect someone else would want to > include it, even in lib. So what you suggest is a bit overthinking to > me. But if you insist, I can do that. Basically by the above you assured me that #error is the right approach, please do it that way and we will definitely catch the incorrect users (even by `git grep -lw __ffs_word_op` if they slip into the kernel somehow). -- With Best Regards, Andy Shevchenko