Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5109598iog; Wed, 22 Jun 2022 12:10:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tbXUKUGqayKQuUrNzwXbuV7kFHGdGnWtKufnyhGHA79x2SgEWWn40cd5nkL8S1Ks98rtod X-Received: by 2002:a17:90a:f288:b0:1ec:7f71:b05f with SMTP id fs8-20020a17090af28800b001ec7f71b05fmr30939163pjb.184.1655925029402; Wed, 22 Jun 2022 12:10:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655925029; cv=none; d=google.com; s=arc-20160816; b=DgNgK/BT9a/YJQFbZH2mYaMTx4h1Ybb2UwRMc7oodrIUEGyCAXRt5j7e3o4BX2eEE6 xMSX3oZjfa7gjA0XeogRrY4UB6O5z8vEtg4qLX+hE+MLAOHFYdWlVeHLfgqV8KxHQOFG O/17jyTuQqUIQ40RrUpqKyf7oskL3goNrZglGiRriv/3HiVwSyNHQuexoAWKs5X5WRQ+ lEovtqphBScgvFx81w2LX6idRa+Cz3C7i77NrjXw5CD54B627Zc38DBc+UJLPbFEjD5C IjavpjA4QoAMtZFmouSeAxTVXVARCE0rL3IWE7TEmXic8lKForV7yKvEe2YaF5Psjz07 sWig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=G+CACZy3Mxqt2TdD/PGEXumJzA2wixKKRDT9daZiP3c=; b=LLJcrxkVliWTysk+VeGtn03MVDeLy8LlKdGh/UedyXpAiTR95aBq0wjTpNhN3FcLpO GNlDagaavagTNN0CIrQ7Hkafo+nZY10s7uBVbyudkpEWjzv/hxpJgil2q1JuLFCcjWrB OE8fRs2/rrXM5uNDt7rgX72Nz35apY5LZyC+H/yFA55U509BC21GtNNrwi+P3YT1eg5M 41gNQzcXl10TdrRq6d8PEL84X9TL8sqCGEY2gvE4cpwP9u5c9+mkB9jOWWXSB1cnyYly gTFp2NDSwBskgHHgK231xApFf6i7uvbzQKM+G5Xk1ih2DZud/tn80DRaYvnDEm/Cyqxy y6IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=o6jn9j2l; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 200-20020a6304d1000000b003c63c350186si13542218pge.847.2022.06.22.12.10.13; Wed, 22 Jun 2022 12:10:29 -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=@gmail.com header.s=20210112 header.b=o6jn9j2l; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376662AbiFVSr1 (ORCPT + 99 others); Wed, 22 Jun 2022 14:47:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbiFVSr0 (ORCPT ); Wed, 22 Jun 2022 14:47:26 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71C832DD48 for ; Wed, 22 Jun 2022 11:47:25 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id t5so3661682eje.1 for ; Wed, 22 Jun 2022 11:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=G+CACZy3Mxqt2TdD/PGEXumJzA2wixKKRDT9daZiP3c=; b=o6jn9j2lXpVzeSsFW8lIMJD2FICQqWpBbxlCNOxwbXeMpjJTeD58bupZS2q24Cmlfk SPxeRixrduH/9d5it/xQvKGeUzVawm3ooAubTb1JgYmD5O6GlzDxZcKN60JQ4A+B6jPn Ri1abaj9MmmCcWw/fKs6ISKZTO/CN39vc1d91NHjLXeNEGYSGYsCXnJXnaWUi4/zLj5C YPCllGolqmZA7mBCALskOYOlfoxoneJ8ToXJ9D30ndSVIGSg9btK5c6VpRFvnWmiZzDd 9ngDr++brL0QJ5OIzADsAUd8QWrBItO+sPzHIMtW+RM5Crg+vgye0fHRV38DQID8EEuM Vhvg== 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:content-transfer-encoding; bh=G+CACZy3Mxqt2TdD/PGEXumJzA2wixKKRDT9daZiP3c=; b=YSF6z6t1MDn2yfvFHqzZI5JiDcspUlBt4WMtvCc3c2+YLtHn9pFEHnYh8K8WJqMvH/ /Muta49stzio9jaUQAB41DTMs4rxnAa/6QehVE0joDtA6pALvqs7G8lnttEC2uMpOmJd uB8r8GzmBvwlT9PK1ZuHGIe6XW0pDFr1G+7o7sxkYBBDpfhrYQu/gz1CILHDZu+2FiXf NomaDj0zfSuR8szL82z7TytpNpKJYys+VGrBMOWu/85rscXUD4Ojx6F/yD8UHJ+NCMM6 Z6n1NNH5CWzxk9rk0/zYASO31t+HcTxB2eGwNGZ1pNt+U1lPkBtQyebNZ++ptKs9uCP/ P5Lg== X-Gm-Message-State: AJIora8e9Y7FEEhX+mwfnwi6vQYlr7bttwlU6J0g48ryiHODtNKy3xXh TuzcWbPdah6Ml+Ja83CTEjJvFSqlnBmUNYr91zQ= X-Received: by 2002:a17:906:74c2:b0:722:e1e2:edea with SMTP id z2-20020a17090674c200b00722e1e2edeamr4536987ejl.658.1655923643901; Wed, 22 Jun 2022 11:47:23 -0700 (PDT) MIME-Version: 1.0 References: <20220621203921.3594920-1-cmllamas@google.com> In-Reply-To: From: Alex Deucher Date: Wed, 22 Jun 2022 14:47:12 -0400 Message-ID: Subject: Re: [PATCH] drm/fourcc: fix integer type usage in uapi header To: Simon Ser Cc: Carlos Llamas , David Airlie , Masahiro Yamada , LKML , Maling list - DRI developers , amd-gfx list , Thomas Zimmermann , Alex Deucher 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,FREEMAIL_FROM, 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 Applied. Thanks! Alex On Wed, Jun 22, 2022 at 3:02 AM Simon Ser wrote: > > On Tuesday, June 21st, 2022 at 22:39, Carlos Llamas = wrote: > > > Kernel uapi headers are supposed to use __[us]{8,16,32,64} types define= d > > by as opposed to 'uint32_t' and similar. See [1] for th= e > > relevant discussion about this topic. In this particular case, the usag= e > > of 'uint64_t' escaped headers_check as these macros are not being calle= d > > here. However, the following program triggers a compilation error: > > > > #include > > > > int main() > > { > > unsigned long x =3D AMD_FMT_MOD_CLEAR(RB); > > return 0; > > } > > > > gcc error: > > drm.c:5:27: error: =E2=80=98uint64_t=E2=80=99 undeclared (first use i= n 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_fourc= c.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= modifier) > > #define AMD_FMT_MOD_PIPE_MASK 0x7 > > > > #define AMD_FMT_MOD_SET(field, value) \ > > - ((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT) > > + ((__u64)(value) << AMD_FMT_MOD_##field##_SHIFT) > > #define AMD_FMT_MOD_GET(field, value) \ > > (((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##= _MASK) > > #define AMD_FMT_MOD_CLEAR(field) \ > > - (~((uint64_t)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_= SHIFT)) > > + (~((__u64)AMD_FMT_MOD_##field##_MASK << AMD_FMT_MOD_##field##_SHI= FT)) > > > > #if defined(__cplusplus) > > } > > -- > > 2.37.0.rc0.104.g0611611a94-goog