Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp1654958rwa; Sun, 21 Aug 2022 13:37:44 -0700 (PDT) X-Google-Smtp-Source: AA6agR7yDfXMnJ+2AKf3MalRUNdin2ig9kOadvoqG9kDjwGniYFTKMaTN3kv7APN4P2iclUWnIWB X-Received: by 2002:a17:90a:d14d:b0:1fa:f740:4aa5 with SMTP id t13-20020a17090ad14d00b001faf7404aa5mr11022776pjw.21.1661114263942; Sun, 21 Aug 2022 13:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661114263; cv=none; d=google.com; s=arc-20160816; b=LKrbFhJtfMaoe4nI7dqxYSrhEN0pAkZRDK3tFY19PFTMJGvQAGKoqf4rF38MEsMSF/ l/zvt48e2bicjCtBrkFcQzV0m5mjObfSohjvn8/4YjOoIt5ubg6dieIa26lTac01Z5Gs l7yFnen6eYo9WFuBiuvIDbpJhsS6cPGwvCB9/ggPEWRVEYmWiGatUvKGcBJ1OyhZpm3i u269FKA8/T/GKYo9/NvONggqw4cz2i8ImGRq1K87VNbROs41B2vg8/mV4GW6/L+Smb1Q agnqgWVRojkjgOPpCJN17xtv7VpLPwvZzoPm3A6CBhG4vMA9OBrCn4fjqQOfVRCRbRVc acSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=boS4oSsVVACKQaEE4q/L6z6cdCD/FDzhd2oAc5hiKlU=; b=TBcVCsQc5xaVWmtGY51EIl8vN/sG7qAjD9qCvVPEMllzQu+yIcW+nUkNl9dk9+trGb nZY10bC5D1SOBo1CZtg8LEdbwHfUoeqLdPWJ69JcjshooZ7rQwh0Qc6X4SrLp7pjK6lP 8bo5SzTQWZOUKsVwV7TQ3/ZaBaQxxYxwH3xOcmXEd5TJ43m0uBDxTQ1uUGjASdV42+dq jhGz7I78y0L7Pcc6v+vOBc/24Lh4mviOtrm3RXSBQd8TFoz33izpx/inDxU6EwKtpYh4 DZETd5jPztK9/jh75KRYhMXOxxpjnTlX5JaeCd/bLMknCKhBP/HnmIRm03akHS2SdxqL hhpw== 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 j19-20020a63e753000000b00415c97318c6si10847864pgk.289.2022.08.21.13.37.27; Sun, 21 Aug 2022 13:37:43 -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; 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 S231558AbiHUTzZ (ORCPT + 99 others); Sun, 21 Aug 2022 15:55:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231521AbiHUTzW (ORCPT ); Sun, 21 Aug 2022 15:55:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4D0D19289 for ; Sun, 21 Aug 2022 12:55:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6A2BDB80E11 for ; Sun, 21 Aug 2022 19:55:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2030AC433C1; Sun, 21 Aug 2022 19:55:18 +0000 (UTC) Date: Sun, 21 Aug 2022 15:55:33 -0400 From: Steven Rostedt To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Christoph Hellwig , Rasmus Villemoes , Luc Van Oostenryck , Jens Axboe , Bart Van Assche Subject: Re: [for-linus][PATCH 01/10] tracing: Suppress sparse warnings triggered by is_signed_type() Message-ID: <20220821155533.34a0976a@gandalf.local.home> In-Reply-To: References: <20220821000737.328590235@goodmis.org> <20220821000844.510643400@goodmis.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,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 Sun, 21 Aug 2022 11:35:29 -0700 Linus Torvalds wrote: > On Sat, Aug 20, 2022 at 5:08 PM Steven Rostedt wrote: > > > > Since there is no known way of checking signedness of a bitwise type > > without triggering sparse warnings, disable signedness checking when > > verifying code with sparse. > > What, what, what? > > The last I saw of this discussion, the fix was just to make sparse not > warn about these cases. Why did this bogus fix make it into a pull > request that I will now ignore? Sorry, I was triaging my internal patchwork and saw the "Suggested-by" Christoph and was thinking this was what we decided on. > > If we want to just shut up the sparse warning, then afaik the simple > one-liner fix would have been > > -#define is_signed_type(type) (((type)(-1)) < (type)1) > +#define is_signed_type(type) (((__force type)(-1)) < (__force type)1) > > and at least then sparse checks the same source as is compiled, > instead of passing a "this is not a signed type" to places. > > So that "no known way" was always bogus, the real question was whether > there was a way to make sparse not need the "ignore bitwise" hack. > > Btw, that patch is entirely broken for *another* reason. > > Even if you were to say "ok, sparse just gets a different argument", > the fact that the trace_events file re-defined that is_signed_type() > macro means that you added that > > +#undef is_signed_type > > to make the compiler happy about how you only modified one of them. > > But that then means that if gets included > *before* , you'll just get the warning *there* > instead. > > Now, that warning would only happen for a __CHECKER__ build - but > that's the only build this patch is relevant for anyway. > > And maybe that ordering doesn't exist, or maybe it only exists on some > very random config. Regardless, it's broken. > > Of course, the real fix should be to just not re-define that macro at > all, and just have it in *one* place. I'll remove this patch and send another pull request. Thanks, -- Steve