Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3523929pxp; Tue, 8 Mar 2022 16:35:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYaVNpQgxCsA0PJMvrHiUgG787WJLUZ8rV5E/4Qgh9iZ1TXUuZg5r//30mgmg0nYgzAMNF X-Received: by 2002:a63:9043:0:b0:37d:92b9:aa6b with SMTP id a64-20020a639043000000b0037d92b9aa6bmr16413164pge.406.1646786136828; Tue, 08 Mar 2022 16:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646786136; cv=none; d=google.com; s=arc-20160816; b=F4ijAUCSB88qsDlzLALGCX57BYx6Z+mVdvOygexpQF3V2fY5+Hw7e7iEbkx8zddoOD ij644EEAceZHEeZwQ0WJzEoBAHZcP23ig0G57WX1k2JXU51O4Fkyd/qO2s+PNxuyWYW5 N/RPzsxsRC24BU6vYBQPFo5Nt4n9oqjK+OiPplWPfyzJF/UR58gbVgBdukO+wZU1IEtZ /bSm4VtmEEuCeI8mmLtsl6HGuCa9krjpUrtkmng9RZZgGgxC0g92PVHIuyGPmSAmY90K ufkSe4D9c5swvl27KuJeIH3/9dbFkeg7x8pcXSbGhS4UaGKykutnT21RTasbJOVbnx7R zx5Q== 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=Uk8vMG8yzUNABGSbXXlhMALinCLxe9UxsQZpByRJJYo=; b=jzTGRus27RZBXm3Shau5cZ++0J5+b4l0ZlzvJm+ulT+b6K6uuoJkdyUP0g+DXILkcn 4Avs14XWLW0ewJ63krD0PX+Au3c4i823C14ALScvxCtsmwybevBPvaA2cNniC1iWQTJq fL7hFQ34iShRJccuTBi/TScEowKJIhtNLYYSxlO5miOE7TnBXJ28DoAjYReWC3soxxYl yeXMbPHmA9DmvICVPXIDeZ4Yx+s9EMu4E9f8d2nOeHAzhWdqmQaVHThdF957TkJTEiSH bXJKmJgGv+7JGNYPAIi6UYUjq7YD/LO4FbywKpDXWOrrX/ReUao/ol6DDvmUBIeVyNZ0 fRng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Xcm39d4I; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m7-20020a656a07000000b00378ac5ba948si505984pgu.81.2022.03.08.16.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 16:35:36 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Xcm39d4I; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 92044114FFF; Tue, 8 Mar 2022 15:52:58 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345092AbiCHSOW (ORCPT + 99 others); Tue, 8 Mar 2022 13:14:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233541AbiCHSOV (ORCPT ); Tue, 8 Mar 2022 13:14:21 -0500 Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61BB5286EF for ; Tue, 8 Mar 2022 10:13:24 -0800 (PST) Received: by mail-lj1-x22f.google.com with SMTP id r22so10637885ljd.4 for ; Tue, 08 Mar 2022 10:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Uk8vMG8yzUNABGSbXXlhMALinCLxe9UxsQZpByRJJYo=; b=Xcm39d4IsVwThejLea1knKW9B43AMUw0+QwtNkfcHuI8k7Z3/eGWS0Lj4SWyDGFoKI s6xYWNIFH8MyE4ov6jE5VGI62n2Uv3aNcve3A8xjbMU7sakLrdFgdRyVCLE4GPdj2nj5 zwD3wGo75LsCYT/agZSVQ4u4X2Wl2+l1RWoJw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Uk8vMG8yzUNABGSbXXlhMALinCLxe9UxsQZpByRJJYo=; b=qCZ3YVGVfVSwMGwLC1ehLlhwdY2bfk/ghMPwBXRue/Jw4FiLx/ww4JziaXms4F7PnL cr0rA6hYmeBNAyv18Hya6ONzUfT1+fYMZrpGMr3LZ5ncuf5V6xRqfMFsIDx/2Q8KZo9t CGGIobXCn13SV6eBP96DmGIA1wRH36fO4VY/SDeIbvYzqEO10hihrh+vHf7EmbHRXjib Gh2WCyWzZRD49sjuxayPwkJOiAarYL617vtoxLwXM52f1pmLpz306YhQWZ40kySv31tx e3hgCN+PRNo1XPSuGcB1Ub6ZnjQanPwd5aqtl9oq4zgP0zh7mqMd4yNOHfwKiSKA15Wx UzyQ== X-Gm-Message-State: AOAM533uI4FFFV046QP9NBwLaJAv4jj21Kkhzgww+8K65TmvX/pmY789 t6WvM58vdORX5m/VZ8NiNG60yDEgJE4RQBwg8ZY= X-Received: by 2002:a2e:871a:0:b0:246:ee2:1109 with SMTP id m26-20020a2e871a000000b002460ee21109mr11472126lji.165.1646763200550; Tue, 08 Mar 2022 10:13:20 -0800 (PST) Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com. [209.85.208.178]) by smtp.gmail.com with ESMTPSA id n16-20020a0565120ad000b00443c3f383c5sm3615058lfu.231.2022.03.08.10.13.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Mar 2022 10:13:19 -0800 (PST) Received: by mail-lj1-f178.google.com with SMTP id l12so26121419ljh.12 for ; Tue, 08 Mar 2022 10:13:18 -0800 (PST) X-Received: by 2002:a2e:9904:0:b0:247:ec95:fdee with SMTP id v4-20020a2e9904000000b00247ec95fdeemr3570290lji.291.1646763198615; Tue, 08 Mar 2022 10:13:18 -0800 (PST) MIME-Version: 1.0 References: <20220304124416.1181029-1-mailhol.vincent@wanadoo.fr> <20220308141201.2343757-1-mailhol.vincent@wanadoo.fr> In-Reply-To: <20220308141201.2343757-1-mailhol.vincent@wanadoo.fr> From: Linus Torvalds Date: Tue, 8 Mar 2022 10:13:02 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] linux/bits.h: GENMASK_INPUT_CHECK: reduce W=2 noise by 31% treewide To: Vincent Mailhol Cc: Rikard Falkeborn , Andrew Morton , Linux Kernel Mailing List , Arnd Bergmann , Andy Shevchenko , Kees Cook , Alexander Lobakin , Herbert Xu , Emil Velikov , Geert Uytterhoeven , Linus Walleij , linux-arch , kernel test robot , Syed Nayyar Waris , William Breathitt Gray , Masahiro Yamada Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, Mar 8, 2022 at 6:12 AM Vincent Mailhol wrote: > > This patch silences a -Wtypes-limits warning in GENMASK_INPUT_CHECK() > which is accountable for 31% of all warnings when compiling with W=2. Please, just make the patch be "remote -Wtypes-limits". Instead of making an already complicated check more complicated, and making it more fragile. I don't see why that int cast on h would be valid, for example. Why just h? And should you not then check that the cast doesn't actually change the value? But the basic issue is that the compiler warns about bad things, and the problem isn't the code, but the compiler. Linus