Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5244627rwl; Tue, 11 Apr 2023 02:34:41 -0700 (PDT) X-Google-Smtp-Source: AKy350b1J3kcJpWKSYY6Qt5K2VaDLwAvt6ovVfA+KyhgYzuBmG8M37n89aCVb3Og36XLGuwBkH5j X-Received: by 2002:a17:902:e5c9:b0:199:1996:71ec with SMTP id u9-20020a170902e5c900b00199199671ecmr18903889plf.16.1681205681424; Tue, 11 Apr 2023 02:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681205681; cv=none; d=google.com; s=arc-20160816; b=gDYSlmL3OcXeRuIpf0jC4r3ckNmMSmVxlf109lJbTOl39HtCwYxGbD3uTqYWV3RY1i xJcEubB35ZJcypnrNFGW8sjja3tRRMvPpu/YQjv7AblDQXQBDANFUXMC5ISlUn4HaWaj U6QylHVdDBCl/Lsi1xALWGYhmvgqKq/OQbEL52KuPBpdLD97t77M14tDsaY3vsaVG5f8 pMRz6o9ioqqLa/TgeZ3afGeji5xqJ5S/I1kaetPYv6bjY2TRQAAU0QjAJcTMn/Kl+lYz AdypwzUKBTLHlhpkyuhzX3PN4hb4KyWbBCLEvsGAocpr6OX8CEOjk2PuFZqclH7fIbQD 0nFA== 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 :message-id:date:subject:cc:to:from; bh=FUgAXLr1iYAC7dgjc2/dCB4XWMuKY/pZEeWUFAG1yko=; b=gw/vhEb7Oh377frsMdqm1DwHMYh78sHjvS+2nJ1bnPmybM3SgzaCrlSyh48ba83Scz AdwpSw4o8L9EyO91MTsegrRWOJJlwnmp//bnBXdB1HXs1h91zNCPHsoQQAcCBang2grU FHphgRyYIcPyK2ILp+zIM3u5ICLsJeJKFgnLrB2AlNysEzCH3vi8La2nKqIBH4i1M+hR 8qxUWzmF12NjqExg4x2Wqhn9T//vnRLKAIyge5x2j6Sjx4+JOxHiLyDwGbDe+LKyNzua v8DL3EHg3WVt3/9YJUh7qyWmfz4PAEpnnmQEmif333KCT2KVa+BJsPr9wSj6KvQMzIaC YEuA== 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=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a170902d49100b001a20c983d1dsi14332554plg.618.2023.04.11.02.34.30; Tue, 11 Apr 2023 02:34:41 -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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229720AbjDKJ2R (ORCPT + 99 others); Tue, 11 Apr 2023 05:28:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbjDKJ2A (ORCPT ); Tue, 11 Apr 2023 05:28:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A71C4C3; Tue, 11 Apr 2023 02:27:57 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D0E0BD75; Tue, 11 Apr 2023 02:28:41 -0700 (PDT) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.65]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 578DC3F73F; Tue, 11 Apr 2023 02:27:56 -0700 (PDT) From: Kevin Brodsky To: linux-kernel@vger.kernel.org Cc: linux-kbuild@vger.kernel.org, Masahiro Yamada , Sam Ravnborg , Petr Vorel , Andrew Morton , Kevin Brodsky , Ruben Ayrapetyan Subject: [PATCH RESEND] uapi/linux/const.h: Prefer ISO-friendly __typeof__ Date: Tue, 11 Apr 2023 10:27:47 +0100 Message-Id: <20230411092747.3759032-1-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 typeof is (still) a GNU extension, which means that it cannot be used when building ISO C (e.g. -std=c99). It should therefore be avoided in uapi headers in favour of the ISO-friendly __typeof__. Unfortunately this issue could not be detected by CONFIG_UAPI_HEADER_TEST=y as the __ALIGN_KERNEL() macro is not expanded in any uapi header. Reported-by: Ruben Ayrapetyan Tested-by: Ruben Ayrapetyan Signed-off-by: Kevin Brodsky --- include/uapi/linux/const.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h index af2a44c08683..a429381e7ca5 100644 --- a/include/uapi/linux/const.h +++ b/include/uapi/linux/const.h @@ -28,7 +28,7 @@ #define _BITUL(x) (_UL(1) << (x)) #define _BITULL(x) (_ULL(1) << (x)) -#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) +#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (__typeof__(x))(a) - 1) #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) -- 2.38.1