Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4204615iog; Tue, 21 Jun 2022 14:28:40 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vtm3PB+kubAyGJEMj25YbiYXnF8ORcJ/FZxiPn4xAaXWYyOhBJqRvMVTvJHl/yw7KbNX3W X-Received: by 2002:a05:6402:d0a:b0:425:d455:452 with SMTP id eb10-20020a0564020d0a00b00425d4550452mr98831edb.259.1655846920763; Tue, 21 Jun 2022 14:28:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655846920; cv=none; d=google.com; s=arc-20160816; b=LJsIj+3gjN6W8BCFy8vlytz5cL3l2KqOF7u+4Pwatd3tnb7bIlNIlHaBLZkjvflaka PiU0fHeHgtdDJb46XC8gbTg4H9FSqEO4Qi/pMeCEgShJE0aZyEOnOzvgZCxdgomaIjxw I18XPO7kS3WkEbiye31GWpN21MtGrFVTBnJEn0MNBc63auXqpH7C7fX11lcaVH9EEz5a 8Z1CIORYD84wL+U6IwCU3AXRGd8QAvJr8GPoxBNK4A0dW/36WdtRmmjYck4tJtE79jBo fhFPovC8odGFwSDS464Gi7nhetjQUOjGGXXRnkTEd6tphzVyFBlvm8mS9X0+7w6CA+D0 2Sfw== 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:from:subject :mime-version:message-id:date:dkim-signature; bh=TBTJUKxXl6/CoGemYB3REqJFiIeblmjK8L2EWRNC3hI=; b=YSOl4l8Lq+mn9jkZMZOL2xPF/ORMRoHAyhdLS6frJvSc3Ymlru2+I5HE6JxKNJEnlL H512xH5KQ3/Nz8F8d96bTmjUs1OzANNtdOb4oP4IzS67B99B4J0j/0nWuFljvb33Lbht gyK7eMEpjy3IuNgyiXven9S8o7h/ceg53iraB66GvY+hBdf62bCKeL9KCw4MXUGUYmAs 61XiKohtJJ0qWfixX/GM47WGv4HS2jeOhQs/yiYfe6kh3cr/UYTHEWCU4DsgU3o9z7al UGCm3I51i3NT74TieTKIl3gn6mhBlqAet6JqKSh/wS7g+PCyB/AMrp/EaPU9Yml3ff30 ID8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=JkQhyN+x; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m6-20020a17090672c600b0071576ce44e1si15768562ejl.91.2022.06.21.14.28.15; Tue, 21 Jun 2022 14:28:40 -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=@google.com header.s=20210112 header.b=JkQhyN+x; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349676AbiFUUjb (ORCPT + 99 others); Tue, 21 Jun 2022 16:39:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354188AbiFUUj2 (ORCPT ); Tue, 21 Jun 2022 16:39:28 -0400 Received: from mail-pf1-x449.google.com (mail-pf1-x449.google.com [IPv6:2607:f8b0:4864:20::449]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E30BE21E06 for ; Tue, 21 Jun 2022 13:39:27 -0700 (PDT) Received: by mail-pf1-x449.google.com with SMTP id bm2-20020a056a00320200b0052531ca7c1cso1976629pfb.15 for ; Tue, 21 Jun 2022 13:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=TBTJUKxXl6/CoGemYB3REqJFiIeblmjK8L2EWRNC3hI=; b=JkQhyN+x8xO9p13An8lNUc3EIJj4b6DAyE7xZpJ7T7EpKBDtW2fZkVhM7DfjEQtJ7p 6DI2hX0snVjQiA0cxY+7w2K5CTkr1lE3ImkqKi/WeJg/2eU2RAl8vDaQsC0iRPCfzc6j dlM/IwEY/mGrodbwRYQ7PCbIAARUeEMGzqkUlBnGmfAk0fTq+Uvm2QhpJjNQOJBhcqyW ucYnMt380S0hDSbNup1QcqxPAAZYvor5zrk7qQToX1oy754i1V3nPdifsyF+w3/bW7+1 pf8oBBosJG04k2+FrshmyenC1ATMgUdchPUs2TRnmHb907CjwN2ckgEoG60OSv3zc/9z mI1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc :content-transfer-encoding; bh=TBTJUKxXl6/CoGemYB3REqJFiIeblmjK8L2EWRNC3hI=; b=p2+o3tvXw/USvSo4gQeN2Ykz5nwDHjOVwV39rJXkLF0DDAzn4wIxndtV7+SfNle+Yh Gib5KoPdEZOP9GNm4+9tD+5x793MjnFLD0HGqPzThMi6HD3VHJdcojIaCM+qiSWul16K HlICHi133bjhqJMq/Adf1Hz29gzuvXHbvO0GQMwjjvc5Sr7MGnvyykiSM3Mt/FUkfBau EgROrSdXo4YWJryWx7A/Y5/Q05AOPMQRPiCHYmvJXSFZqJBLLv+ZZ/pbUOUMuuKy+ndY QwZ0t5c4W9w8lM+SBqSDp0pF/Joc+lKdr01utkLkQyxp81tGXOuO2UBReTBZBL9sfNHI FYbQ== X-Gm-Message-State: AJIora9epd1SdMFvBvpQeL4TSD75H8PFit6MzdDWptpQUbChVmQllWaV GGODnyxID/2yeSuX5Lfjm/R12rWuJ9n+DQ== X-Received: from zllamas.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:4c]) (user=cmllamas job=sendgmr) by 2002:a17:902:d5c3:b0:168:f037:98d7 with SMTP id g3-20020a170902d5c300b00168f03798d7mr30454468plh.117.1655843967320; Tue, 21 Jun 2022 13:39:27 -0700 (PDT) Date: Tue, 21 Jun 2022 20:39:21 +0000 Message-Id: <20220621203921.3594920-1-cmllamas@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.0.rc0.104.g0611611a94-goog Subject: [PATCH] drm/fourcc: fix integer type usage in uapi header From: Carlos Llamas To: amd-gfx@lists.freedesktop.org Cc: Masahiro Yamada , Carlos Llamas , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Alex Deucher , Bas Nieuwenhuizen , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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 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() { 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 in th= is 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 --- 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 mod= ifier) #define AMD_FMT_MOD_PIPE_MASK 0x7 =20 #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##_SHIFT)) =20 #if defined(__cplusplus) } --=20 2.37.0.rc0.104.g0611611a94-goog