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 0E9D5C433EF for ; Mon, 7 Mar 2022 11:12:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232589AbiCGLNR (ORCPT ); Mon, 7 Mar 2022 06:13:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241808AbiCGLMh (ORCPT ); Mon, 7 Mar 2022 06:12:37 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75E04D996B for ; Mon, 7 Mar 2022 02:34:42 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id hw13so30751427ejc.9 for ; Mon, 07 Mar 2022 02:34:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M1rR/eY80n5vDuYqXPNSE6u83mcd2WVzC9/2TTt/Eo0=; b=Gj9/fnWrwc6IHetIWpmkFgWwMuti9SnpBTZQI4+fpBSdSMDh78T9YTel1Ks7RaIY3f zt5OncxwWYqxHOdhY9xn8K+MSHrrreD3qDrY/f9jhrpwKbCGBjunGgzzLDt1VLWVdZLc VRRHaUu3KNRRT/eYvRBUHb9BxA8vk/e/bVT+31IvTkAPDpn6LOk6C+RyKZRq0ydfmFQb E5RL6qF1WR/VI2wp4CZMK7TjH0h54ml3dEIiDwdC9JzDHKn5m7XO4frn1CD5GKKzfGp+ m6+cIe+wGQCr9BM1Hl3mg8089U0CYQPLnBvjkO7tnG2qferM0ANsSrtdVHqhBdUJ+Z3X N56g== 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=M1rR/eY80n5vDuYqXPNSE6u83mcd2WVzC9/2TTt/Eo0=; b=n/nFanOL0uH0IFWjlskBRBHLdF5djvpr4zZdNWH6QPgqrPpm85S7Gc0JA6z2Jus5UT 0Jmtt8l9G2f5VfQLv3D5bIPGLvqkkVwZUvRqFRWUnBFVn6FCzQuirAinH22qf3HNS9+P AkJ403Vqq7ksfFCmI+FGELbLp20GCg0OqScFZp3tlOSaL9b8rLpA32WETpctDrTwtvYR zkgwiEnsk1x71QayUFtS1Ygkvx6fICNGkspX7pyQNhYMnNutfbDTEBWXq66Ajqi9jDe/ 097qEFBQDUIcBJZE5996Pt51rXIzkqjt+q0fMvhbP61C8qIqUW/QHw74fp+MaKg90dKO DsCA== X-Gm-Message-State: AOAM532Zf04uhuicasx4HKe9K5HgHBWIJxxKoe86DRRF5cUnQdlyU34b orhrvRvJghJIXD1rlNC3l/yZ071SmjzAI75giOqiEvEJU3c= X-Google-Smtp-Source: ABdhPJyZ9XFlNCbQVulJPua3Jfgj9sQ1cpljwcF6zb22A8M+mwlVxG4zEsvsO1xYx7ek52amuGOhL0m4PYqKpZyjTr4= X-Received: by 2002:a17:906:cc12:b0:6b5:ec8f:fdf2 with SMTP id ml18-20020a170906cc1200b006b5ec8ffdf2mr8297004ejb.579.1646649280273; Mon, 07 Mar 2022 02:34:40 -0800 (PST) MIME-Version: 1.0 References: <20220304124416.1181029-1-mailhol.vincent@wanadoo.fr> In-Reply-To: From: Andy Shevchenko Date: Mon, 7 Mar 2022 12:33:22 +0200 Message-ID: Subject: Re: [PATCH] linux/bits.h: fix -Wtype-limits warnings in GENMASK_INPUT_CHECK() To: Vincent MAILHOL Cc: Rikard Falkeborn , Andrew Morton , Linux Kernel Mailing List , Arnd Bergmann , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 6, 2022 at 7:35 AM Vincent MAILHOL wrote: > On Sun. 6 Mar 2022 at 06:33, Andy Shevchenko wrote: > > On Sat, Mar 5, 2022 at 2:43 PM Vincent MAILHOL > > wrote: > > > On Tue. 5 Mar 2022 at 03:46, Andy Shevchenko wrote: > > > > On Fri, Mar 4, 2022 at 7:36 PM Vincent Mailhol > > > > wrote: > > > > ... > > > > > > NAK. > > > > > > Are you willing to change your decision following my comments? > > > > Have you read this discussion (read the thread in full) > > https://lore.kernel.org/lkml/cover.1590017578.git.syednwaris@gmail.com/ > > Thank you, this was an instructive read. > > For what I understand, there was an effort to fix this when > -Wtype-limits was still a W=1 warning but the effort was stopped > after -Wtype-limits was moved to W=2 despite a v4 patch being very > close to the goal. My understanding of that discussion is that Wtype-limits is broken, and Linus pointed out many times that compiler warning on if ((unsigned int)foo < 0) is bogus. I.o.w. there is no issue with the code and hence nothing to fix. > Back to my patch, it successfully passes the lib/test_bits.c > build test (including the TEST_GENMASK_FAILURES) and it also > fixes the last open warning from the thread you pointed me to (on > drivers/crypto/inside-secure/safexcel.o): > https://lore.kernel.org/lkml/20200709123011.GA18734@gondor.apana.org.au/ > > So, I am still not sure to understand what issue you see with my > patch. Is it that we should just not care about fixing W=2? Or > do you still see some issues which are not being addressed (if > so, sorry for not understanding)? See above. You may Cc Linus himself to reignite the discussion. > I do agree that fixing a W=2 has small value for all the files > which are still emitting some W=1. However, I think it is > beneficial to remove this W=2 spam for all the developers who > produced W=1 clean files and would like to tackle the W=2 > warnings. -- With Best Regards, Andy Shevchenko