Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5790838rwr; Mon, 24 Apr 2023 09:02:07 -0700 (PDT) X-Google-Smtp-Source: AKy350aoIVE23v1AugyHyvnC9T0FAxBuRh0mPfpOZwP9crsY4tNYzg01Gihe20gi7brjgtBa/Amx X-Received: by 2002:a05:7500:2d95:b0:fe:d033:b643 with SMTP id er21-20020a0575002d9500b000fed033b643mr477874gab.75.1682352126904; Mon, 24 Apr 2023 09:02:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682352126; cv=none; d=google.com; s=arc-20160816; b=M6/BRd22H/SKop5JatmPcAsuwFSLGRJvow1cO9ICxKKIpIrDl6qZJu/fyq2UI+svFU e1DEeKbuYo71OQeJ3AxLc0MtXT3EAC43JURJjK7LP5X3LYFR/8cLi01ot0+QwgqCk16D nNKEhPuJP8lQIGqbl1b9xXaK86if3eEGotlvU3saiDn5FjJ8aebGQ6He6h7WclT+MUvw 5ewjMJFyh2QpyNklp6WMawX/yjLI0WxHdzEA9VoR2n0CYdwGe+TNeAN58srvspG26dxf slVmLlsKk3WnJr60OauuCEgTPn0wgMJjWuczrSq4sOLV8tcoWJUT5FcPVgSHYeJv0bgb INIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=ltZdkPLWqzrvXs72Fx19A8Ez4crvfyRZ4GvZyD+yB8w=; b=xXjX1YmFT60kn9ciVxtq/zDes0MIjjqF0f04Kxj1GmNh0rfU5U2U948zCmZv0mZHOI KiUHsaTLMj8nIuSB21Tkz+QtKWHzhD+sx9KmKfCnKdM6z4gmf0bagPor1fZ5ZsioTxDM 6Vh8h8GL+QGPaqTLLHtlerS9fNRLT+FwRKl0OvixHGfJzGnjDyTiSp8c19CSfW+KizlG 6M1OUCS7KP0t0JDjh+hes5YjrcXxrtoTA9FVk9TeQurTiird2fKeXGuRObIcMPF2GqHD eyCZCfNwAf6uFbVpJqlwQgc4mS6hyG1Bq9AYVfhejaEd54Fz74gWHvNVTzXnwC91HbVZ SH2w== 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 e33-20020a0561020fa100b0042c9eea23b2si2127726vsv.729.2023.04.24.09.01.35; Mon, 24 Apr 2023 09:02:06 -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 S232107AbjDXPr5 (ORCPT + 99 others); Mon, 24 Apr 2023 11:47:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231364AbjDXPrz (ORCPT ); Mon, 24 Apr 2023 11:47:55 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 633937AAA; Mon, 24 Apr 2023 08:47:48 -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 057D74B3; Mon, 24 Apr 2023 08:48:32 -0700 (PDT) Received: from [10.57.22.201] (unknown [10.57.22.201]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CD2503F64C; Mon, 24 Apr 2023 08:47:46 -0700 (PDT) Message-ID: Date: Mon, 24 Apr 2023 17:47:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] uapi/netfilter: Prefer ISO-friendly __typeof__ Content-Language: en-GB To: Petr Vorel , linux-kernel@vger.kernel.org Cc: Masahiro Yamada , Andrew Morton , Sam Ravnborg , Ruben Ayrapetyan , linux-kbuild@vger.kernel.org References: <20230416210705.2300706-1-pvorel@suse.cz> From: Kevin Brodsky In-Reply-To: <20230416210705.2300706-1-pvorel@suse.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,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 16/04/2023 23:07, Petr Vorel wrote: > typeof() is a GNU extension, UAPI requires ISO C, therefore __typeof__() > should be used. Similarly to b4bd35a19df5 ("uapi/linux/const.h: Prefer > ISO-friendly __typeof__") use __typeof__() also in x_tables.h. Thanks for finishing up the work! Minor thing, the hash for my commit in -next seems to be 31088f6f7906 at the moment. As to the Fixes: tag, it looks like it should be (assuming that commit already exported the macro): Fixes: 72b2b1dd77e8 ("netfilter: xtables: replace XT_ENTRY_ITERATE macro") Aside from that, looks good to me, so: Reviewed-by: Kevin Brodsky Kevin > Signed-off-by: Petr Vorel > --- > Based on [1] merged into linux-next as b4bd35a19df5. > There should be the same Fixes: which we agree in discussion in [1] > (likely a79ff731a1b2, or d6fc9fcbaa65). > > Kind regards, > Petr > > [1] https://lore.kernel.org/lkml/20230411092747.3759032-1-kevin.brodsky@arm.com/ > > > include/uapi/linux/netfilter/x_tables.h | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/include/uapi/linux/netfilter/x_tables.h b/include/uapi/linux/netfilter/x_tables.h > index 796af83a963a..d4eced07f2a2 100644 > --- a/include/uapi/linux/netfilter/x_tables.h > +++ b/include/uapi/linux/netfilter/x_tables.h > @@ -172,11 +172,11 @@ struct xt_counters_info { > > /* pos is normally a struct ipt_entry/ip6t_entry/etc. */ > #define xt_entry_foreach(pos, ehead, esize) \ > - for ((pos) = (typeof(pos))(ehead); \ > - (pos) < (typeof(pos))((char *)(ehead) + (esize)); \ > - (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset)) > + for ((pos) = (__typeof__(pos))(ehead); \ > + (pos) < (__typeof__(pos))((char *)(ehead) + (esize)); \ > + (pos) = (__typeof__(pos))((char *)(pos) + (pos)->next_offset)) > > -/* can only be xt_entry_match, so no use of typeof here */ > +/* can only be xt_entry_match, so no use of __typeof__ here */ > #define xt_ematch_foreach(pos, entry) \ > for ((pos) = (struct xt_entry_match *)entry->elems; \ > (pos) < (struct xt_entry_match *)((char *)(entry) + \