Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp42562rwe; Wed, 24 Aug 2022 16:32:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR5lhjzlmYAC2HedzsKTLD0F62VrfYYnKVbIsmZeBTy3amv51amtHH1P7mxQT7hfxRAi/MaQ X-Received: by 2002:a05:6a00:1586:b0:537:f5f:11d0 with SMTP id u6-20020a056a00158600b005370f5f11d0mr1438274pfk.64.1661383952452; Wed, 24 Aug 2022 16:32:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661383952; cv=none; d=google.com; s=arc-20160816; b=jGKuJ7yS3UQGGi+/tAD8vj/PSgBqFXyrcE4hSwAX3QG74FuxuZV/38UPulVC8wCEHe zwHpFLyQFjP68gPCraJZyb8p/aoUvkIgh/Z7OcKQN3pRIouJ1ONEvp9s5VCz7Dl+Vf4i ahOGgjhEHWogPtunF2kvkAw2Vx2dMdFLQ45uH7ckkC6YrI4SqpjBPIbbDV1wFwumjHfv IldeLnHxTdhaLVBm3q664aC7mCtgg2W9XLNKgpnPWRfrP3vC9JZenhkCPAdZEhGV/c0e On7KTXbb/9a5IFoiSDchyOCo6CTcEhz1HZoIny6KmabZ0svJkLL9DaVZjHiT2uuYWuDM AQpw== 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; bh=G0ySZZcLlbrtg1sbUR0T0eGd+OHbyJMxGcV3YBMLCvg=; b=Yq9bNp9kJJOz6H7g2hsjllj++FOisB2yqiF8/4qRIcRnqNFVEWjABhKIYSuO/IxTZH iQjxhalMYvseanC8K9O2OdIQd1nQY4siO/03KYL2O6fEfC/LhyzOJfaP8UoYCpSSH+5E K1pflyJ4L6D0QuCzFeXf3YJCFBJ7mgoS7BmeMYcojlPv7kjPi9QhVStNk17OhA/ssVWO T21AU6sbOTjfUEkY44bD0FoCHk9l8uVga6LcZTOblHliQOHEuZZB1cq7NbsU9DDddf3+ zgYpafbbRM/GZuCjMtUXhvS14haNXlp0RaP9zG0t268q2MefJOfhfbpGEHj0hfRQhinB FGOA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x17-20020a056a000bd100b0052b8a12a070si17311807pfu.200.2022.08.24.16.32.21; Wed, 24 Aug 2022 16:32:32 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbiHXX2c (ORCPT + 99 others); Wed, 24 Aug 2022 19:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbiHXX2a (ORCPT ); Wed, 24 Aug 2022 19:28:30 -0400 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E7C56EF16 for ; Wed, 24 Aug 2022 16:28:29 -0700 (PDT) Received: by mail-pf1-f176.google.com with SMTP id 83so12273313pfw.6 for ; Wed, 24 Aug 2022 16:28:29 -0700 (PDT) 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=G0ySZZcLlbrtg1sbUR0T0eGd+OHbyJMxGcV3YBMLCvg=; b=1rT/ChS8YO0DgK8G1nr8mt6aqXCxEhNtJ2/3Zyk3+g08XKCgU77fbvG1K+z1d6XUeD j0KJ05E1Qtbxs5rkJAPs6aO04dQw0urMz58xTkGxBC5Za7b0kONxM/fb91HNyzxiWVRb /krvOxEuuxfOWw93++6oeYztQRPMdlzJOEDgxupt7tls66ql2mHoVCxTFfjtARc4JyWu B/49ky5piEwTopWX2iq6sRANXFDS8Z3w8uhjGEycpH9C0yPTus9wNMeX6Zp+3V0wGv8s u5ExH8Aoq00pTP4+qwyv0Jru7nyA6gnIHYetwq06LGobKtEHpLMkZFTcr3qDP7nsjM8a vczQ== X-Gm-Message-State: ACgBeo0/pCYgntvmsA0sZeWTLx6zpzYOu/WfSSZIyoRok+jMF71PQ3/N Vv6O293x2UxZmuyb5A2BWknDMRtEYNA= X-Received: by 2002:a65:6849:0:b0:42b:3b1b:94bf with SMTP id q9-20020a656849000000b0042b3b1b94bfmr955024pgt.168.1661383708749; Wed, 24 Aug 2022 16:28:28 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:222f:dc9c:99a3:dfb8? ([2620:15c:211:201:222f:dc9c:99a3:dfb8]) by smtp.gmail.com with ESMTPSA id 203-20020a6215d4000000b005350ea966c7sm13682161pfv.154.2022.08.24.16.28.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Aug 2022 16:28:27 -0700 (PDT) Message-ID: <353e5bbd-cdd1-f818-6a2f-9a7c800f9879@acm.org> Date: Wed, 24 Aug 2022 16:28:25 -0700 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 Cc: Rasmus Villemoes , 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> <02daa3d6-2847-d7e0-e23e-411076c6d4db@rasmusvillemoes.dk> <0163b361-14bf-7b4c-751a-14f1a004b1a9@acm.org> From: Bart Van Assche In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,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 8/23/22 18:49, Linus Torvalds wrote: > On Tue, Aug 23, 2022 at 5:09 PM Bart Van Assche wrote: >> >> I'm probably doing something wrong but even with sparse commit 658ee8e0f631 >> ("unrestricted values are unrestricted even after a cast") I see warnings >> being triggered by users of the is_signed_type() macro, warnings that >> disappear if I change the definition of the is_signed_type() macro into 0: > > That's the > >> It does require that kernel change to make >> >> #define is_signed_type(type) (((type)(-1)) <= (type)0) > > part I was talking about. > > So your kernel side patch looks fine, except I don't think you need > the '__force' - the sparse patches in my tree should make sparse happy > about casting '-1'. > > But I didn't do very much testing. Hi Linus, Can you take a look at the following report from the kernel test robot: https://lore.kernel.org/all/202208250433.EVz5pZkB-lkp@intel.com/ ? Do I see correctly that gcc reports a new warning for the above definition of is_signed_type() with W=1? I'm not sure how to get rid of that new gcc warning without reintroducing a sparse warning. The tree that the kernel robot tested is available here: https://github.com/bvanassche/linux/tree/tracing Thanks, Bart.