[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9d183df9-7047-0eee-b6d4-b0f9b8d21036@nvidia.com>
Date: Tue, 30 May 2023 10:07:23 -0400
From: Feng Liu <feliu@...dia.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: virtualization@...ts.linux-foundation.org,
linux-kernel@...r.kernel.org, Jason Wang <jasowang@...hat.com>,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
Jiri Pirko <jiri@...dia.com>
Subject: Re: [PATCH v1] virtio-pci: Improve code style for including header
files
On 2023-05-30 a.m.7:27, Michael S. Tsirkin wrote:
> External email: Use caution opening links or attachments
>
>
> On Mon, May 29, 2023 at 02:17:29PM -0400, Feng Liu wrote:
>> Fix code style related to including header file. Include header files
>> before declaring macro definitions to avoid conflicts.
>>
>> Signed-off-by: Feng Liu <feliu@...dia.com>
>> Reviewed-by: Jiri Pirko <jiri@...dia.com>
>
> Which conflicts? These macros are there precisely to change
> how the header behaves.
>
Hi Michael
I think including the header files should be placed before the
macro definition.
If VIRTIO_PCI_NO_LEGACY and VIRTIO_RING_NO_LEGACY are needed for
control header file, we should put them at the beginning of
virtio_pci_common.h.
What do you think?
>> ---
>> drivers/virtio/virtio_pci_modern.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/virtio/virtio_pci_modern.c b/drivers/virtio/virtio_pci_modern.c
>> index d6bb68ba84e5..b21a489e0086 100644
>> --- a/drivers/virtio/virtio_pci_modern.c
>> +++ b/drivers/virtio/virtio_pci_modern.c
>> @@ -15,9 +15,10 @@
>> */
>>
>> #include <linux/delay.h>
>> +#include "virtio_pci_common.h"
>> +
>> #define VIRTIO_PCI_NO_LEGACY
>> #define VIRTIO_RING_NO_LEGACY
>> -#include "virtio_pci_common.h"
>>
>> static u64 vp_get_features(struct virtio_device *vdev)
>> {
>> --
>> 2.37.1 (Apple Git-137.1)
>
Powered by blists - more mailing lists