Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp378022rwe; Wed, 24 Aug 2022 02:33:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR49F4VfdYzllIOetRmZiyLbFHXiZaIzf63KnRhcRQiIsZw+NhOjTsUwLqcAQHPOsgFiEys0 X-Received: by 2002:a17:907:7ea2:b0:73d:8657:3bc2 with SMTP id qb34-20020a1709077ea200b0073d86573bc2mr2382857ejc.79.1661333611039; Wed, 24 Aug 2022 02:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661333611; cv=none; d=google.com; s=arc-20160816; b=zxbZ6jTFYcKMtelatFkrDBFigjl6831mM1d44f997V69oqeIK1UExr+ry564UBA61q xOBwR6Ee2NFf7zuZernfwyNGyJNFKNYY/mPXDN0c650n0DFN1t6gXmTI5DbjRMelGTcX Q3OtbhmiJm4KX0K/icV9K9VJwWiU5RMAotTzEQcqK3hPdHRj2rbmtHZmsFY7aaZImeiF x16AVqoHMUD9Xe2jXbya3GHjlx+3cr3rpMJMxTEaM1n+EfWQEdAF3V1jQM/RyQw3eR7E rgeY5cQGP2HCAjgGdstnNBEEQHjdTmiutCjUVCfIjyWmJR3Cfu3ebIQOGxklhvAbh7as QrZg== 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=APYUm7pTLg0UMmA20sdSUDSCMnCFPm5AUCvgM2nCBfE=; b=VefttPS/m24EiY8Dnzttiuen3UEV7U4K4KBDsqeZ62nlW5zOPQD3bf/Vqrw71ZFGM0 E+fq/nkvZ6ZCozRIiVm5BIk+cZrfQ9+F4UJ4uXNmNVxHwTMYS3qE3hxD5xrM7iP9ZZ7j avhYXrhhhW0nptJh/JNZuP90OTFZuJRLsXoRHwmv+V5BO75oGsQ1P22xvbRqN/TXYM50 B6sCmusF4zNbhHALFWF2XFDs6Mm43XHDnt+I1cqvLTA82okkqH8GboIO91t/zo/8cVkj ur2jAPNjgpSh4tMzAvlF/GtpaIrBXQfflOs+HSarLYzeOso71ECKrtKz7dJzg8a/YpW/ TICg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UMizMcqT; 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 hp24-20020a1709073e1800b007316ac034c1si1685696ejc.496.2022.08.24.02.33.05; Wed, 24 Aug 2022 02:33:31 -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=UMizMcqT; 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 S235856AbiHXJYv (ORCPT + 99 others); Wed, 24 Aug 2022 05:24:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231561AbiHXJYu (ORCPT ); Wed, 24 Aug 2022 05:24:50 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F00825D3 for ; Wed, 24 Aug 2022 02:24:48 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id cb8so12300917qtb.0 for ; Wed, 24 Aug 2022 02:24:48 -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=APYUm7pTLg0UMmA20sdSUDSCMnCFPm5AUCvgM2nCBfE=; b=UMizMcqTQ/q/pLQ7Fw4rY6/aegr+1otQV1K/yWFQ0U4q8llDJ4weYOrvSGxYLOE9Cp yig6Bd5E3DZp483bb1okP3dH1AtSdo+MjH4gnwCxqrM1Tx4xofwviUQ1EG/aANOgarKJ a3RX+vlqbd2jBK6Fgiw7ZMWU1DJxkt2oH8MVh5RrZDDQ/WlUDZSyXDjEB9xnvRUhTP4M bq+y0UPwv3Cx1VjOe9VrypbWaQrWVM3ZHws3NJMVkxBtSKUg4W6dCqn3BEy32/xECh8S 7L7tmi8+QmKqj1J6sELrdpTjOinDcM3Fle26D6xx+LFMBtXUpjc6TVruQJvnWuogV6wU NnmQ== 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=APYUm7pTLg0UMmA20sdSUDSCMnCFPm5AUCvgM2nCBfE=; b=pF6biJj1MaMfd4Tyb1OacoXpjHyYYPpQFcVFsZ5aCFmf0J6mkSNV/T8avxYAHI5REQ JsA+8RkQis6UijJoyROK/4rxGOdBMTy/BZghz1E+7s7FgFAxwYjMTNaKr38E7AUkTTNV bFNA7E//Ut0xTceiz9kyhKNSyereHDWnAi21bNJzXlCt6L6ZspXarbLtkncwqErkWBT5 XAS82szfEGTubxzWQjHdr9BfWTCPl5pwstc1g+udIxscccYta1KEmtG4LgOFuLVwVt8j sfjt1t+exf/coaazPtjjfNzVUGjYmJo2NFboM0KSUoTZYD6N1/m5JuIXOR8XmKYIr4p9 NUBg== X-Gm-Message-State: ACgBeo3I4cc/ok2qonReg8jGLwgHFuIOC4jDb8oGV0DT0/OcMSBXbfYM AtQrpp+fxlGQ5gCAssJkserXjBid+GdWhVJSJktkh3BWgVY= X-Received: by 2002:ac8:5786:0:b0:343:3051:170d with SMTP id v6-20020ac85786000000b003433051170dmr22894132qta.429.1661333087519; Wed, 24 Aug 2022 02:24:47 -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 12:24:11 +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 12:22 PM Andy Shevchenko wrote: > On Wed, Aug 24, 2022 at 5:17 AM Yury Norov wrote: ... > > +#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!" The rationale is that the missed definition may give wrong results while being compiled with no errors. With the above, the developer must think about what they are doing. -- With Best Regards, Andy Shevchenko