Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp798633rwb; Thu, 19 Jan 2023 02:54:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXsEqrj4VoOwEmcoftBBAnlUwVjse+q/PhIUrJMKlID0xJC/h/795V1a2eI3xe2HjrF6lbn7 X-Received: by 2002:a17:906:fb16:b0:7c1:6d65:4718 with SMTP id lz22-20020a170906fb1600b007c16d654718mr10708073ejb.33.1674125647210; Thu, 19 Jan 2023 02:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674125647; cv=none; d=google.com; s=arc-20160816; b=DyXCoKh1h8qcYeQnhM9VHy/6TeJFTWW5pFqt+yZdU7ocQgo7PSAZDFFlY0f8e/sYrd ePYgyFE5/D8QQfYWb+GO20wzQfC08fji6TCNM/XPDt0Z0nfzFjvb2qd9N5sL4Q+WPIdq yS2qMp2mXBp0ojbdCAh8syyP6ZZwM208l/V7GYli4HeVrcWCAXyYzPwWAg4wDLPnpzjR poLPjPd8H1QB4paWA4FEiIc06jK/qC9RgVzgYNS35n7WvHJFwwkJaD9DMBoPEXMTCpjn 53/TFKU5NBCqaJwu+NbGmwYhbkFD6+Oysqr50nVH4h88nTwrHr0P7VpKlLF41RBngT+V 16sw== 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=u4d6TcVv9yL4sUCvHxl/chYpJfRTNu99adzCOtb/YHJ2c5HQ0y9+G90qdK/4jPYqIq MjhsfRLGQ9AHl/UESIMJbFy8qLPXOh9M3kjC4HQvPbQXIuy2YZHk6bwOOcBS5AEXknlr VEcMKDhoS2Lo+veId0sfOP2pKKtB/OqoJ3uuccifr2/UsgbOUsNhjsPBTrJYTZ/ERKBy EtWd76z6H7R/B9tThYxaZ6RPD2uvNdiMGdjpIqaw6bcbZ7N4WZlDA/YogFdK/JFvoh7Z a9SCaxJzxR5uUtbsdJose1i2mYbGyU+zno0VpRxBTBzvS+tLa1PrJTsZojD7oTiOPbeI an2A== 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 l11-20020a170906794b00b0084514612c2asi44557058ejo.609.2023.01.19.02.53.56; Thu, 19 Jan 2023 02:54:07 -0800 (PST) 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 S230072AbjASJmp (ORCPT + 44 others); Thu, 19 Jan 2023 04:42:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbjASJmm (ORCPT ); Thu, 19 Jan 2023 04:42:42 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 43A1C676D8; Thu, 19 Jan 2023 01:42:40 -0800 (PST) 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 6AD1F1758; Thu, 19 Jan 2023 01:43:21 -0800 (PST) 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 01F393F71A; Thu, 19 Jan 2023 01:42:38 -0800 (PST) From: Kevin Brodsky To: linux-kernel@vger.kernel.org Cc: Masahiro Yamada , Sam Ravnborg , linux-kbuild@vger.kernel.org, Kevin Brodsky , Ruben Ayrapetyan Subject: [PATCH] uapi/linux/const.h: Prefer ISO-friendly __typeof__ Date: Thu, 19 Jan 2023 09:42:25 +0000 Message-Id: <20230119094225.2422787-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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 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