From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C007FC00140 for ; Wed, 24 Aug 2022 09:24:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235945AbiHXJYw (ORCPT ); Wed, 24 Aug 2022 05:24:52 -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-Google-Smtp-Source: AA6agR6NeKFnojkjNkBuW2m80DnoKp7Dk6eBwitHQSG6cBexDxjTyEbzlqXCspc/FUKvRHoHIf5DFCgIDy/eaNXZLsA= 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" 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