Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2355801pxp; Mon, 7 Mar 2022 13:40:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+ofGEcx5qKED/oxWGP4oI28WulZ8TytUflV+BbC7XjQnLWrUeEdY70wsrBueZ06sTjjqS X-Received: by 2002:a17:907:d13:b0:6db:de8:615e with SMTP id gn19-20020a1709070d1300b006db0de8615emr7919583ejc.649.1646689226505; Mon, 07 Mar 2022 13:40:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646689226; cv=none; d=google.com; s=arc-20160816; b=aL4CTu6CQvAoMOtBgjMB2R2cPnVYQdO8JWUiObZN7MfMMaVbOm5KUXuVVb4moiuEvb t5jwD7TLER8oGoKX99ew/c0XqFFF7uRvst1ZQ4EucC7AH+VtrUJh4SccK88DhNFcqPK0 1l9xZVKJSt5AeB8VFSoah7DE166T2KV9ji2JF5KIBYa7pafAuc6iRqB1SRTJOysmohAj vGSVt1vcfrZEpiim1Q9J8gE/wME53kPNMtEt/KHWozG+redMhXzJ62ykoMEMjb510nXV caPh/zhZ/3PLoZSYegHaMGy/giXjCouN9sfJheV4+sZBDboJ84QrgMVSB/V+hN3xOgnn d1qg== 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; bh=st/f+0iO0UDzjkNWhcsOsygYrvFCRtgzkkkSRKcKsWc=; b=EMMRo1j2H155aZvs1wI/RoFwtBx60Kgfl0dED+oSST55qDhDOoAmRiyhDpqwGwoS4S QAvV456EVTeG2du+mBRglJdVD8g3h0bRezo2mlj8g4x98hEZX/DRrP4ShDmW/GLGW+d4 8ULuoi+nxbbh9JuLCLcLlqvwnmmulKROWiBCB8zRJ2fy0xQ4alh3T62uNNyrgwdKHVHh hQ+cBS7FT2P18fLtt/WVxHfoBGwpYSH8uQHk8ALTVfYVTiv7PoNqQbkYeXFA3B6MA2Bc ZZkxDI7Wj+/5NAGTBYoO3YjiTFgIWaQOVLR5QHia3YByDHne7bCQa+YOMM/+VA6w1by4 dz4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a17090604c900b006d0ab20b6basi9162227eja.444.2022.03.07.13.40.04; Mon, 07 Mar 2022 13:40:26 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243010AbiCGOHS (ORCPT + 99 others); Mon, 7 Mar 2022 09:07:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236976AbiCGOHN (ORCPT ); Mon, 7 Mar 2022 09:07:13 -0500 Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2A188D695 for ; Mon, 7 Mar 2022 06:06:18 -0800 (PST) Received: by mail-yw1-f176.google.com with SMTP id 00721157ae682-2dbd97f9bfcso164962497b3.9 for ; Mon, 07 Mar 2022 06:06:18 -0800 (PST) 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=st/f+0iO0UDzjkNWhcsOsygYrvFCRtgzkkkSRKcKsWc=; b=EGmGbR6QJchstZuNcWhdV6v0l9ElqdRUhuBVbso6eeBWcGLJYHwPCncrIYkpRxhme8 CgCjYctVv1lA50pWihpweYJNR3JT5FzJwAg82x3xAQ7Iwy5WdxrPY6F94WeRX4MNxO+L dqPxYihg41OO0JNOMZE5C6Ce9QsNFVwMFI4IwHhFxeVWwSvKj6uSh3ni+Ys2axD/edPU q4kqgkOS0q6EMUYdz88l01kY0kqssT9ZmzkHQYmgVHHTJ4mSFc+uOo2hw9wWfJSZZJAc Bq6FEyqbRC8UaUeV1HzGyTK1ESX8QnR6wBOfzoCHvAnzp2YwTQ8zraN7kJlKGV4WvUqe DX8Q== X-Gm-Message-State: AOAM532cOiXm0gxNX21+f/zOZODpdF69nko1F1RUehiF9o9QzykEjhUo s9nMbmFpMD5UPe7+GaIgvCWwLHc3faid/6kImbQ= X-Received: by 2002:a81:6bc6:0:b0:2db:fe24:d5ee with SMTP id g189-20020a816bc6000000b002dbfe24d5eemr8306756ywc.392.1646661977922; Mon, 07 Mar 2022 06:06:17 -0800 (PST) MIME-Version: 1.0 References: <20220304124416.1181029-1-mailhol.vincent@wanadoo.fr> <20220307105810.1747024-1-alexandr.lobakin@intel.com> In-Reply-To: From: Vincent MAILHOL Date: Mon, 7 Mar 2022 23:06:06 +0900 Message-ID: Subject: Re: [PATCH] linux/bits.h: fix -Wtype-limits warnings in GENMASK_INPUT_CHECK() To: Andy Shevchenko Cc: Alexander Lobakin , Rikard Falkeborn , Andrew Morton , Linux Kernel Mailing List , Arnd Bergmann , Kees Cook Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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 Mon. 7 Mar 2022 at 22:40, Andy Shevchenko wrote: > On Mon, Mar 7, 2022 at 1:00 PM Alexander Lobakin > wrote: > > From: Andy Shevchenko > > Date: Fri, 4 Mar 2022 20:46:08 +0200 > > > On Fri, Mar 4, 2022 at 7:36 PM Vincent Mailhol > > > wrote: > > > > > > > This pattern is harmless but because it occurs in header files > > > > (example find_first_bit() from linux/find.h [1]) and because of the > > > > include hell, the macro GENMASK_INPUT_CHECK() is accountable for 31% > > > > (164714/532484) of all warnings when compiling all modules at W=2 > > > > level. > > > > Nice catch, thanks! I wanted to submit the very same fix, but > > postponed it for some reason, and now here we are. > > > > > Have you fixed W=1 warnings? > > > Without fixing W=1 (which makes much more sense, when used with > > > WERROR=y && COMPILE_TEST=y) this has no value. > > > > How is this connected? > > By priorities. > I don't see much value in fixing W=2 per se if the code doesn't compile for W=1. *My code* compiles for W=1. For me, fixing this W=2 in the next in line if speaking of priorities. I do not understand why I should be forbidden to fix a W=2 in the file which I am maintaining on the grounds that some code to which I do not care still has some W=1. > > When I do `make W=2 path/to/my/code`, I want to see the actual code > > problems, not something that comes from the include files. > > When I do `make W=2 path/to/new/code/from/lkml`, I want to see the > > actual new warnings, not something coming from the includes. > > It's much easier to overlook or miss some real warnings when the > > stderr is being flooded by the warnings from the include files. > > I'm aware there are some scripts to compare before/after, but I > > don't want to use them just because "this has to value". > > I rephrased above. > > > I don't want to do `make W=2 KCFLAGS='-Wno-shadow -Wno-type-limits'` > > because then I'm not able to spot the actual shadow or type limit > > problems in my/new code. > > I fixed several `-Wshadow` warnings previously in the include files > > related to networking, and *nobody* said "this has no value" or > > NAKed it. And `-Wshadow` has always been in W=2. > > Yes, because people rarely enable COMPILE_TEST + WERROR. > To be clear, my comment is given in that scope. And my comments are given in a different scope: a developer who wants to solve the issue for his *own* file without being spammed. Yours sincerely, Vincent Mailhol