All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Tiwei Bie <tiwei.bie@intel.com>,
	Andrius Sirvys <andrius.sirvys@intel.com>
Cc: dev@dpdk.org, Zhihong Wang <zhihong.wang@intel.com>,
	stable@dpdk.org, jianfeng.tan@intel.com
Subject: Re: [PATCH] drivers/virtio: fix duplicate naming of include guard
Date: Thu, 21 Mar 2019 10:26:12 +0100	[thread overview]
Message-ID: <5d054e50-0c67-17c5-1ad7-3a8cd6f2f20e@redhat.com> (raw)
In-Reply-To: <20190321075906.GA29047@dpdk-tbie.sh.intel.com>



On 3/21/19 8:59 AM, Tiwei Bie wrote:
> On Wed, Mar 20, 2019 at 01:57:39PM +0000, Andrius Sirvys wrote:
>> The LGTM static code analysis tool is reporting
>>
>> "The macro name '_VHOST_NET_USER_H' of this include guard is used
>> in 2 different header files."
>>
>> lib/librte_vhost/vhost_user.h has the same include guard.
>> Renamed the include guard in vhost.h to differentiate.
> 
> Above two files are private headers in two individual modules,
> there is no chance that they will be included by the same file.
> But I agree it's not a good name for any of them.
> 
>>
>> Fixes: 6a84c37e3975 ("net/virtio-user: add vhost-user adapter layer")
>> Cc: jianfeng.tan@intel.com
>> Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com>
>> ---
>>   drivers/net/virtio/virtio_user/vhost.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/virtio/virtio_user/vhost.h b/drivers/net/virtio/virtio_user/vhost.h
>> index 83a85cc..f8d26b6 100644
>> --- a/drivers/net/virtio/virtio_user/vhost.h
>> +++ b/drivers/net/virtio/virtio_user/vhost.h
>> @@ -2,8 +2,8 @@
>>    * Copyright(c) 2010-2016 Intel Corporation
>>    */
>>   
>> -#ifndef _VHOST_NET_USER_H
>> -#define _VHOST_NET_USER_H
>> +#ifndef ANOTHER_VHOST_NET_USER_H
>> +#define ANOTHER_VHOST_NET_USER_H
> 
> If we want to change it, I prefer to change it to _PATH_NAME_,
> e.g. _VIRTIO_USER_VHOST_H_ or similar.

+1 for _VIRTIO_USER_VHOST_H_

> 
> Thanks,
> Tiwei
> 
>>   
>>   #include <stdint.h>
>>   #include <linux/types.h>
>> -- 
>> 2.7.4
>>

  reply	other threads:[~2019-03-21  9:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-20 13:57 [PATCH] drivers/virtio: fix duplicate naming of include guard Andrius Sirvys
2019-03-21  6:19 ` Rami Rosen
2019-03-21  7:59 ` Tiwei Bie
2019-03-21  9:26   ` Maxime Coquelin [this message]
2019-03-21 10:09 ` [PATCH v2] " Andrius Sirvys
2019-03-22  6:06   ` Tiwei Bie
2019-03-27 11:13   ` Maxime Coquelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d054e50-0c67-17c5-1ad7-3a8cd6f2f20e@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=andrius.sirvys@intel.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=stable@dpdk.org \
    --cc=tiwei.bie@intel.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.