Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4051718imm; Wed, 5 Sep 2018 09:56:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZTpC35GloVftxfrZ2C8iGgApGfa6lMSWy9I3a6+n2w6Z1RyixsdBzP95SzUGjSZ76TGk56 X-Received: by 2002:a17:902:8bc4:: with SMTP id r4-v6mr38578130plo.124.1536166570878; Wed, 05 Sep 2018 09:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536166570; cv=none; d=google.com; s=arc-20160816; b=WlAoi95xeJNESY0989DryuxAo7WyZMdMWt2oMb/E+qtNvdGcfbIw6QIZH3+YJ/BNBl F2ExarqxpXAWBzlgx/QX7IvOj98o6D1hTZQorFzC/k7IPy5ENTlApEHsjzJwXkUnwXNh SDEw01EAjCPFUhQf/e5QUm3+dX98Ivxs+a51FXbrmh/VLr0RTwlogTH1PQgkSeVx2keq DDn8Ug6GawlZnshSrG+24stKJ6vik5TdAy7PpZLA+IgaKpb7iYDwETxLB09JvVpX09VA hxmyzE/VDalU1sp5hf0gzjrCFd4BkW+8KSYpm3TFCc7cnpW9zNjnm9YhYfPHtdTUjXJM 2TCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=0g/xnHVf4mxywdLJmPM+gWJuxygH5xm5C2/41H2Bf2M=; b=QlvSgFrFUiWs+X4816YRMXOOxv+/+POw9KWUXJQyWJkSh30zpi5kIsogXw1hoVFsre bDSzZWzgbRnDDg2OWEJrUEitlqxVb10OR8zKdnGmeQE4mu0mEV8ss2ii4aL1ciTgg4AN haO2NZEmf7t8FqLD4kTbgm4us+iXRbj17iHsdGD/0RWcHGNSh565pzTCFbzyCVqiicPd szlAd16FTceTtf+U968VoiM9KyGD/NG6G3cKiNcjnxHG133lHjs0BnJVYnQpIyoGXyaI OXEroG0Tu9muPOLyi2cLC2Esha0S7isyAnAwY9Ft7haslnwL/pJ1NbJeXfQ4YYGrsz9f BuXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t23-v6si2357801pgi.301.2018.09.05.09.55.55; Wed, 05 Sep 2018 09:56:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727679AbeIEVZm (ORCPT + 99 others); Wed, 5 Sep 2018 17:25:42 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46418 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbeIEVZm (ORCPT ); Wed, 5 Sep 2018 17:25:42 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 85981C49; Wed, 5 Sep 2018 16:54:39 +0000 (UTC) Date: Wed, 5 Sep 2018 18:54:36 +0200 From: Greg KH To: David Howells Cc: linux-api@vger.kernel.org, linux-kbuild@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/11] UAPI: virtio_net: Fix use of C++ keywords as structural members Message-ID: <20180905165436.GA25206@kroah.com> References: <153616286704.23468.584491117180383924.stgit@warthog.procyon.org.uk> <153616289529.23468.7498785670556620808.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <153616289529.23468.7498785670556620808.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 05, 2018 at 04:54:55PM +0100, David Howells wrote: > The virtio_net_ctrl_hdr struct uses a C++ keyword as structural members. Fix > this by inserting an anonymous union that provides an alternative name and > then hide the reserved name in C++. > > Signed-off-by: David Howells > cc: "Michael S. Tsirkin" > cc: Jason Wang > cc: virtualization@lists.linux-foundation.org > --- > > include/uapi/linux/virtio_net.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h > index a3715a3224c1..967142bc0e05 100644 > --- a/include/uapi/linux/virtio_net.h > +++ b/include/uapi/linux/virtio_net.h > @@ -150,7 +150,12 @@ struct virtio_net_hdr_mrg_rxbuf { > * command goes in between. > */ > struct virtio_net_ctrl_hdr { > - __u8 class; > + union { > +#ifndef __cplusplus > + __u8 class; > +#endif > + __u8 _class; > + }; Ugh, ick, no! Come on now, either put the whole C namespace stuff around the file, or don't care about this at all. Doing this whack-a-mole style is a mess. "class" is a fine variable name for C code, there's no reason this has to change here at all. greg k-h