Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4554885iog; Wed, 22 Jun 2022 00:46:35 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sUJwp1e4j4Z5MNI/WZFp6PsNzUvUow+gine8xVVWWD0+t2wcXOS24KpGCq+hw19XYFahbM X-Received: by 2002:a17:906:db:b0:718:e9e7:e704 with SMTP id 27-20020a17090600db00b00718e9e7e704mr1945001eji.718.1655883995578; Wed, 22 Jun 2022 00:46:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655883995; cv=none; d=google.com; s=arc-20160816; b=tEO8HGcHJLGTiDqh34Tpic86A5TPjl6Ap61rpqm2kVmBD7Z9l6BKDOPZ+JzMfN6+LD r9ThGcEpUJw/wxKNTegKTh8815kihS+TohYo3LPyCAaJPuRW1g0Ou8HXAZzodChumZWl y0LNBL/S4O9g+Yz4MwNRX4jk6xQHZhlRNyVeV8/YA1Z0wGk4VaNsAFVXNsX9nXLD/XFs s0n4tEGNi2OIYNCxZWX2hGP7sLK4nwcTunBaqDeotTaHDCIp/IRJZ6zXdiRLhM1J8IlN W1HeuZvrzCI1PQaaPHQgs+jTPSoO6caaBDvLYZ+/L5MI4MJ2PhUitMx+tUDHu3BPb4aE SpEw== 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 :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=hW6aQpyvrQi+nVh0DL4cohSiWMLpTMwE3tnnUD5pEHc=; b=B0BKVeBZ3U2jIqefy5okFQHvvMspJZr4yA5RVqDmNV9DdD7NSgbSQAIwMDQdAXNmzz EsfqDO7sb+7Sfm/Cv4TwgR0E0whQB73i+09t5a4QnkVNMiwrCZJu97+8pzjBZYfkcB2N cT6du+DoREIpx6YNDAfvgP0zkAWDIQzpFPA0fbYjpo96E6KcFEr4xVuM26I4QsQlUQaN AWOQzNtx0riBqonATZ4MLwYxyY1z1EAVguLNfbJA/BQfEPe6yuXlXOdnHlKqcqEB+4Q1 Xukrk6JFnr3UhqR/KIgNkI82mpGwX6ap1a3q94e/0LEVCc+KnKC48qPxdsm0IDCbH+2W XGDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@emersion.fr header.s=protonmail2 header.b=zPgSvVxQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=emersion.fr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a170906614800b00711d61d0dedsi12504634ejl.593.2022.06.22.00.46.07; Wed, 22 Jun 2022 00:46:35 -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=@emersion.fr header.s=protonmail2 header.b=zPgSvVxQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=emersion.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348347AbiFVHCV (ORCPT + 99 others); Wed, 22 Jun 2022 03:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231278AbiFVHCT (ORCPT ); Wed, 22 Jun 2022 03:02:19 -0400 Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCA06369FC for ; Wed, 22 Jun 2022 00:02:16 -0700 (PDT) Date: Wed, 22 Jun 2022 07:02:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail2; t=1655881334; x=1656140534; bh=hW6aQpyvrQi+nVh0DL4cohSiWMLpTMwE3tnnUD5pEHc=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=zPgSvVxQLJVZ8kUbeSjT6fZZhN8tgkMspF9xTC+0xN8i36hhESoEA4bqRfwNOX28+ BGxiOXxyum7Bdjlwev8aNvA4rE/AGCQzzddCaEEhJedkeWqKTlfgcjyD+xjALkcFKE MxDXPq2hnLQwUXwtbZCO6kwciR+3jKj/zoTVH9Z26oR4id73wnnfwoZvMfAVqgjgqp qsQFRr7W5uBSjNtrHu9ci/BxZejVKXgQKrLUESfGoTE6fs0kZ1WhP8130XcYr6jtg9 v6nUPedlQ9mlsFk37PbD42VtAp4/rtRrhCq1EksZ3+J6bJ5zU1l2IHguHXP4PcBXFE h/3P+Wl7zBi/A== To: Carlos Llamas From: Simon Ser Cc: amd-gfx@lists.freedesktop.org, David Airlie , Masahiro Yamada , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Thomas Zimmermann , Alex Deucher , Bas Nieuwenhuizen Reply-To: Simon Ser Subject: Re: [PATCH] drm/fourcc: fix integer type usage in uapi header Message-ID: In-Reply-To: <20220621203921.3594920-1-cmllamas@google.com> References: <20220621203921.3594920-1-cmllamas@google.com> Feedback-ID: 1358184:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 Tuesday, June 21st, 2022 at 22:39, Carlos Llamas w= rote: > Kernel uapi headers are supposed to use __[us]{8,16,32,64} types defined > by as opposed to 'uint32_t' and similar. See [1] for the > relevant discussion about this topic. In this particular case, the usage > of 'uint64_t' escaped headers_check as these macros are not being called > here. However, the following program triggers a compilation error: > > #include > > int main() > { > =09unsigned long x =3D AMD_FMT_MOD_CLEAR(RB); > =09return 0; > } > > gcc error: > drm.c:5:27: error: =E2=80=98uint64_t=E2=80=99 undeclared (first use in = this function) > 5 | unsigned long x =3D AMD_FMT_MOD_CLEAR(RB); > | ^~~~~~~~~~~~~~~~~ > > This patch changes AMD_FMT_MOD_{SET,CLEAR} macros to use the correct > integer types, which fixes the above issue. > > [1] https://lkml.org/lkml/2019/6/5/18 > > Fixes: 8ba16d599374 ("drm/fourcc: Add AMD DRM modifiers.") > Signed-off-by: Carlos Llamas Reviewed-by: Simon Ser Cc'ing Bas as well > --- > include/uapi/drm/drm_fourcc.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.= h > index f1972154a594..0980678d502d 100644 > --- a/include/uapi/drm/drm_fourcc.h > +++ b/include/uapi/drm/drm_fourcc.h > @@ -1444,11 +1444,11 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 m= odifier) > #define AMD_FMT_MOD_PIPE_MASK 0x7 > > #define AMD_FMT_MOD_SET(field, value) \ > -=09((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT) > +=09((__u64)(value) << AMD_FMT_MOD_##field##_SHIFT) > #define AMD_FMT_MOD_GET(field, value) \ > =09(((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MAS= K) > #define AMD_FMT_MOD_CLEAR(field) \ > -=09(~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIF= T)) > +=09(~((__u64)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHIFT)) > > #if defined(__cplusplus) > } > -- > 2.37.0.rc0.104.g0611611a94-goog