Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3245885rwa; Tue, 23 Aug 2022 01:04:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR4TRzRfsq6v0aPCybGEBCtuB8tB2NWecpgI0avnNL7EKa5781kuyOO1KV/VpiAFnCeS0MPC X-Received: by 2002:a63:2cd0:0:b0:41c:5f9b:893c with SMTP id s199-20020a632cd0000000b0041c5f9b893cmr19603242pgs.173.1661241846168; Tue, 23 Aug 2022 01:04:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661241846; cv=none; d=google.com; s=arc-20160816; b=wKwOivTkOCiULiSIDg23xtT5WNA5vqWIva5u4jEzuYVBInYLtHKPusrW+gKLRo0nRF XCaTxmfh35stnOAXCOXtbdIyVTdlqXNDXGJKYJEKxfWdM15GbBYkOPqTV6F2GRZ0x7UN 3O0K3B41FgYMstd9/8koGAhrpZnFi6w4VQYZJvm0EfiFRVVOdgXWbPp0yedhps8inRly DB7HXS6lsjf88tdtvG+u4Hulmurk6Hrjeyyap4DgLkAPesE3L9xpV5LmzTMT8LZBT2Rj U8LGAxY+zzrI+1vm2gfyAwO/YLkUw+0tjcIiqRe1GMhF1/5RVhc67/eUYdYdEm7Hv94P L+ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QIJFXkkMKWbCHmr9ms//oW2s4/z3odXdFLKo8s9yoYo=; b=xppm4x3HSej8W9vNSrcmaY58Uyt1ejpRKGWHRlq8jaR5+tcSojyg0ZCbnpvw2pw/Di R/yHVqKDef5I9tkHLunIoNSSSn0tR75Y+a3L0J4OuVRhHWSJancNslIGeNv3uNUf9pkU ta4+yoTmMf5Ypk3Qwiv8Pd1P8sxs95B8SohPtpyDMc8Q0a36635Za/mGd3Crkiru45G0 Sf8rNbyqMW++b6s/g9vY+2WockQ+92ePpj3Ws5Zay8HP/KspK1lr7CCnjKdRLLPenoXm K12HCMHVzYWykQ0jmHZPQ8Z8uoEQVtD57+386gi2cvpJRDHFGXRILgbzwAzYF9AXOJSq CiOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=PAbXJqHx; 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 k15-20020a170902c40f00b0016d572968fcsi16787406plk.118.2022.08.23.01.03.55; Tue, 23 Aug 2022 01:04:06 -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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=PAbXJqHx; 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 S240709AbiHWHHB (ORCPT + 99 others); Tue, 23 Aug 2022 03:07:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240838AbiHWHG5 (ORCPT ); Tue, 23 Aug 2022 03:06:57 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73F7B61D47 for ; Tue, 23 Aug 2022 00:06:55 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id x10so12664183ljq.4 for ; Tue, 23 Aug 2022 00:06:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=QIJFXkkMKWbCHmr9ms//oW2s4/z3odXdFLKo8s9yoYo=; b=PAbXJqHxS/bhuFzgIsFKzDZVeHn5yIfIjuafATi+onOvp7G37TSmtZdSzq6rbCrQsI Ci8ibL5+SX1c8uTn5UrjF0EM1uKbNkvF+wt6GIe/Pnl6FZ2XQ7fjn5dzlpHpCpEAFs0H wwzcDZ27b6LsgtFDpzc/FcnhYFFXur8SQtVik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=QIJFXkkMKWbCHmr9ms//oW2s4/z3odXdFLKo8s9yoYo=; b=yOH1iynxbnk64j4DN0jQiprkrRRcPh8BSL7hzyvgCQBbog5b1DuJonXf9aoUfDRJMC jBzg9tRWPLLCXDxIjC/inZggv18hbnIFlYP1kMBSEuhO2hmUwaqaBc6gD6C7vYlyx6Fc UvxQuJ2Fh03ci2+mAUvg3oZfz7Ut1Sl5ykJrG8dAZ43dzOqo13pfBqGVlwhLWN/srEy+ pvxf62A77ZU9OdiBx/72RdlpSIVyYvSP9j037Svf2X+MPoaohopcoHQsFGQLLvthCkXe SFh351jKjiukPSoNToNJrRJcsq72s+2DjhhtNZfEsr3eGRlvvhHEeElCV3JU1C21qfd6 RubA== X-Gm-Message-State: ACgBeo3TU9rYMrROaA2XFjuAIfeHBmNS5XusJEIf4YR/nTbjkAz13p3O j0K0BBGg/u/UUkAlybEL3VBh8A== X-Received: by 2002:a05:651c:b29:b0:261:d351:9dc4 with SMTP id b41-20020a05651c0b2900b00261d3519dc4mr1497708ljr.409.1661238413778; Tue, 23 Aug 2022 00:06:53 -0700 (PDT) Received: from [172.16.11.74] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id x12-20020a056512078c00b00492d108777dsm1714538lfr.136.2022.08.23.00.06.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Aug 2022 00:06:52 -0700 (PDT) Message-ID: <02daa3d6-2847-d7e0-e23e-411076c6d4db@rasmusvillemoes.dk> Date: Tue, 23 Aug 2022 09:06:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [for-linus][PATCH 01/10] tracing: Suppress sparse warnings triggered by is_signed_type() Content-Language: en-US To: Linus Torvalds , Bart Van Assche Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Christoph Hellwig , Luc Van Oostenryck , Jens Axboe References: <20220821000737.328590235@goodmis.org> <20220821000844.510643400@goodmis.org> <5700ac75-f6a9-877e-4011-9b314f12b5ab@acm.org> From: Rasmus Villemoes In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, 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 22/08/2022 20.45, Linus Torvalds wrote: > On Mon, Aug 22, 2022 at 11:20 AM Bart Van Assche wrote: >> >> I agree that it's better that sparse sees the same code as what is used to >> build the kernel. However, I do not agree that the patch above is a solution. >> Sparse reports a warning for the suggested definition above of is_signed_type() >> because the new definition tries to use the less-than (<) operator to compare >> two __bitwise types. > > Argh. I forgot that part. It wasn't just the cast that warned, it was > the compare too. > > But we did have a sparse fix for it, didn't we? That fix required that > the '< (type)1' cast be changed to '<= (type)0' iirc, and a patch to > sparse, but it at least avoided the problem. Heh. I originally wrote the comparison "< (t)1" instead of "< (t)0" to avoid a -Wtype-limits warning when applied to unsigned types - yeah yeah, the kernel isn't built with that, but it's a nice macro to copy-paste to other projects, and sometimes people do explicitly enable -Wtype-limits to manually go through some, and then it's nice to not have tons of false positives from this macro. But of course <1 is the same as <=0, and we can indeed spell it that way without triggering Wtype-limits. So if that can help with also silencing sparse, ack from me on that part. Rasmus