Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2098940iof; Tue, 7 Jun 2022 19:42:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1Jj8WQV8/KSBxCvIDgx0mVa+hBNVieDsUgxK30w03o3M2LgVxS8FLdW0Fm/sTIoGPZ5Zz X-Received: by 2002:a17:903:210:b0:15e:f139:f901 with SMTP id r16-20020a170903021000b0015ef139f901mr33088177plh.66.1654656120660; Tue, 07 Jun 2022 19:42:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654656120; cv=none; d=google.com; s=arc-20160816; b=sCIDl9Fxu75Z5bXpwUw68UMB1TYZjXmvzNCRoBRfj1/Ws8q6kGqzXuBDzt0NMQ6MSX /bVRld3Bv7gbQZ0aHmfDFzfIpt5moUV0PX2diPVgSHmqROxKDwKKcZ9VQAz78Z34GCfI WcifF9ykojtV7cgWZYh5JUqLdC+EdbQXWwosgThU3ImkdD8Zd2Fr/AcFVYdc0W7gjf6X K1LvUujjaLu2Az1PGMfGM7tUWJrqUDwpESeHpy0jVIoIYtzRGAGIsyfMyZ49O18Yzh3B 7MhvlpIdVVe2P1VGuChvejAhVykGeXClUj2kJbEndgx0i9bjebiHQhL14nrWbUQ/oNeW Nf4A== 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:dkim-signature; bh=lANEaRZF8RNlGQuEjAUuCnlc1k8UC96t1LkjmMu7vvs=; b=wlG3LCglsIbsbiO4jW8cfKSsIVh3lbfEc6mUQKPsIGIRBR+lT6RxOymGfNKd+Txv1t Ds3LM06dPqJfVXm8IO3PiQucFA9foX3VlNukhE7gr7z1dVvvQwLUuaUPvwS5PXaOwiIw s61UIyMBdajKfySxje3Fh6nKsuwRhlQzMEQotX8tUvM/l+qw2KfviqECPqB//3CvpyzI 1UGGuRWIvUKs2wOcMzrQh2F6+IXJXkakMzS2ORxqdZ676Cd2mmpFAtAfeUPLapg6mNTj KTUmVgBXf9fVEh+K+jJT3GMIx2OnI0QWqO4FCqROj+vu1LmFC+9R4MPueoLkUy9kpJo0 C7VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=gsCc3Tvj; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id u11-20020a170902e5cb00b0016646a4d661si21846080plf.377.2022.06.07.19.42.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 19:42:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=gsCc3Tvj; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 515D340CDD6; Tue, 7 Jun 2022 19:32:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359236AbiFGUfB (ORCPT + 99 others); Tue, 7 Jun 2022 16:35:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357586AbiFGTmI (ORCPT ); Tue, 7 Jun 2022 15:42:08 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08E3615A3C1 for ; Tue, 7 Jun 2022 11:15:26 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id bg6so17033701ejb.0 for ; Tue, 07 Jun 2022 11:15:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lANEaRZF8RNlGQuEjAUuCnlc1k8UC96t1LkjmMu7vvs=; b=gsCc3TvjLneSHG/GMjspzmVXJk8TNOJ8UT6qlP4EOH6kvkrxzAaJXttxEyf4ZD8SkL s66S60CaayzPMN6BMjs/lZf1xjYPrMCmXs/KcnpQvQqJSX5JOHaqjVzqpx2cYgAk8b0W 8E+vMj04FOfMjKT2XIjjIVYWclACVZJqmBOTY= 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=lANEaRZF8RNlGQuEjAUuCnlc1k8UC96t1LkjmMu7vvs=; b=VpoW/t4w7p2Cpdg/Va/EFGEUpKaCDntIO1KY1x/lAReDFbZsvbZVxwMmerr0UyxSds 3J8T0ny4FbGRxgpBg+4+KDoKRUyPiTa5LK6p3vBHuoXAEMmyzN2mz6P/Cu5YbsrnmbY8 ZkBr6L3kTs00IQdlbh6BOf7saq0jgq0fL95AOKwHKt1x4oSWeKjV0A+mBaI2gLKbXo0W iTH8o9yy7LBnSY64NXsfzmAANdZuyG1feB2tO2k3UTFeUSjERBhLU2Cu7v+cfB+3AR4R X0Prhwqlpia1DvVIVybV2k3dtLefxRpD09q4V7bOHhYl9XBQtPOtoQ36BcIv/319xOtB QvlQ== X-Gm-Message-State: AOAM530dZYNsUhh+2Bjb2bfg0h9tlR9jnStoAy5EgJCU60HoV/kGtCdo 1CB5diYrpkH0wOZ3fCFzEx1StiZUmFz+Nw5vNiM= X-Received: by 2002:a17:906:52c7:b0:6ce:a880:50a3 with SMTP id w7-20020a17090652c700b006cea88050a3mr28073754ejn.437.1654625724918; Tue, 07 Jun 2022 11:15:24 -0700 (PDT) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com. [209.85.128.48]) by smtp.gmail.com with ESMTPSA id r24-20020a170906549800b006f3ef214db9sm8029612ejo.31.2022.06.07.11.15.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jun 2022 11:15:23 -0700 (PDT) Received: by mail-wm1-f48.google.com with SMTP id q15so6600188wmj.2 for ; Tue, 07 Jun 2022 11:15:23 -0700 (PDT) X-Received: by 2002:a05:600c:42c6:b0:39c:4bfd:a4a9 with SMTP id j6-20020a05600c42c600b0039c4bfda4a9mr15814099wme.8.1654625723046; Tue, 07 Jun 2022 11:15:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Tue, 7 Jun 2022 11:15:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [git pull] drm for 5.19-rc1 To: Geert Uytterhoeven Cc: Dave Airlie , Daniel Vetter , dri-devel , LKML , Arnd Bergmann Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 Tue, Jun 7, 2022 at 3:23 AM Geert Uytterhoeven wrote: > > These header files are heavy users of large constants lacking the "U" > suffix e.g.: > > #define NB_ADAPTER_ID__SUBSYSTEM_ID_MASK 0xFFFF0000L As Andreas says, this is not undefined behavior. A hexadecimal integer constant will always get a type that fits the actual value. So on a 32-bit architecture, because 0xFFFF0000 doesn't fit in 'long', it will automatically become 'unsigned long'. Now, a C compiler might still warn about such implicit type conversions, but I'd be a bit surprised if any version of gcc actually would do that, because this behavior for hex constants is *very* traditional, and very common. It's also true that the type of the constant - but not the value - will be different on 32-bit and 64-bit architectures (ie on 64-bit, it will be plain "long" and never extended to "unsigned long", because the hex value obviously fits just fine). I don't see any normal situation where that really matters, since any normal use will have the same result. The case you point to at https://lore.kernel.org/r/CAK8P3a0QrihBR_2FQ7uZ5w2JmLjv7czfrrarCMmJOhvNdJ3p9g@mail.gmail.com is very different, because the constant "1" is always just a plain signed "int". So when you do "(1 << 31)", that is now a signed integer with the top bit set, and so it will have an actual negative value, and that can cause various problems (when right-shifted, or when compared to other values). But hexadecimal constants can be signed types, but they never have negative values. Linus