All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH 1/8] vfio: Add header guards and includes to drivers/vfio/vfio.h
Date: Wed, 31 Aug 2022 12:36:02 -0300	[thread overview]
Message-ID: <Yw9/4h3mlN4LuBz8@nvidia.com> (raw)
In-Reply-To: <BN9PR11MB52764F22F96E12177D50C8068C789@BN9PR11MB5276.namprd11.prod.outlook.com>

On Wed, Aug 31, 2022 at 08:42:17AM +0000, Tian, Kevin wrote:

> > diff --git a/drivers/vfio/vfio.h b/drivers/vfio/vfio.h
> > index 503bea6c843d56..093784f1dea7a9 100644
> > --- a/drivers/vfio/vfio.h
> > +++ b/drivers/vfio/vfio.h
> > @@ -3,6 +3,14 @@
> >   * Copyright (C) 2012 Red Hat, Inc.  All rights reserved.
> >   *     Author: Alex Williamson <alex.williamson@redhat.com>
> >   */
> > +#ifndef __VFIO_VFIO_H__
> > +#define __VFIO_VFIO_H__
> > +
> > +#include <linux/device.h>
> > +#include <linux/cdev.h>
> > +#include <linux/module.h>
> 
> Curious what is the criteria for which header inclusions should be
> placed here. If it is for everything required by the definitions in
> this file then the list is not complete, e.g. <linux/iommu.h> is
> obviously missing.

It isn't missing:

$ clang-14 -Wp,-MMD,drivers/vfio/.vfio_main.o.d -nostdinc -I../arch/x86/include -I./arch/x86/include/generated -I../include -I./include -I../arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I../include/uapi -I./include/generated/uapi -include ../include/linux/compiler-version.h -include ../include/linux/kconfig.h -include ../include/linux/compiler_types.h -D__KERNEL__ -Qunused-arguments -fmacro-prefix-map=../= -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE -Werror=implicit-function-declaration -Werror=implicit-int -Werror=return-type -Wno-format-security -std=gnu11 --target=x86_64-linux-gnu -fintegrated-as -Werror=unknown-warning-option -Werror=ignored-optimization-argument -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fcf-protection=none -m64 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mstack-alignment=8 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-address-of-packed-member -O2 -Wframe-larger-than=2048 -fno-stack-protector -Wimplicit-fallthrough -Wno-gnu -Wno-unused-but-set-variable -Wno-unused-const-variable -fomit-frame-pointer -fno-stack-clash-protection -Wdeclaration-after-statement -Wvla -Wno-pointer-sign -Wcast-function-type -fno-strict-overflow -fno-stack-check -Werror=date-time -Werror=incompatible-pointer-types -Wno-initializer-overrides -Wno-format -Wno-sign-compare -Wno-pointer-to-enum-cast -Wno-tautological-constant-out-of-range-compare -Wno-unaligned-access -I ../drivers/vfio -I ./drivers/vfio  -DMODULE  -DKBUILD_BASENAME='"vfio_main"' -DKBUILD_MODNAME='"vfio"' -D__KBUILD_MODNAME=kmod_vfio -c -o /tmp/jnk.o ../drivers/vfio/vfio.h
[no error]

The criteria I like to use is if the header is able to compile
stand-alone.

> btw while they are moved here the inclusions in vfio_main.c are
> not removed in patch8.

?  I'm not sure I understand this

Jason

  reply	other threads:[~2022-08-31 15:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  1:01 [PATCH 0/8] vfio: Split the container code into a clean layer and dedicated file Jason Gunthorpe
2022-08-31  1:01 ` [PATCH 1/8] vfio: Add header guards and includes to drivers/vfio/vfio.h Jason Gunthorpe
2022-08-31  8:42   ` Tian, Kevin
2022-08-31 15:36     ` Jason Gunthorpe [this message]
2022-08-31 18:02       ` Alex Williamson
2022-08-31 18:24         ` Jason Gunthorpe
2022-09-01  2:17           ` Tian, Kevin
2022-08-31  1:01 ` [PATCH 2/8] vfio: Rename __vfio_group_unset_container() Jason Gunthorpe
2022-08-31  8:46   ` Tian, Kevin
2022-09-02  0:28     ` Jason Gunthorpe
2022-09-02  3:51       ` Tian, Kevin
2022-09-02 14:39         ` Alex Williamson
2022-09-02 16:24           ` Jason Gunthorpe
2022-09-06  3:35             ` Tian, Kevin
2022-09-06 19:38               ` Alex Williamson
2022-09-06 23:06                 ` Jason Gunthorpe
2022-08-31  1:01 ` [PATCH 3/8] vfio: Split the container logic into vfio_container_attach_group() Jason Gunthorpe
2022-08-31  8:47   ` Tian, Kevin
2022-09-02  0:42     ` Jason Gunthorpe
2022-08-31  1:01 ` [PATCH 4/8] vfio: Remove #ifdefs around CONFIG_VFIO_NOIOMMU Jason Gunthorpe
2022-08-31  8:48   ` Tian, Kevin
2022-08-31 15:28     ` Jason Gunthorpe
2022-09-01  2:18       ` Tian, Kevin
2022-08-31  1:01 ` [PATCH 5/8] vfio: Split out container code from the init/cleanup functions Jason Gunthorpe
2022-08-31  8:49   ` Tian, Kevin
2022-08-31  1:02 ` [PATCH 6/8] vfio: Rename vfio_ioctl_check_extension() Jason Gunthorpe
2022-08-31  8:50   ` Tian, Kevin
2022-08-31  1:02 ` [PATCH 7/8] vfio: Split the register_device ops call into functions Jason Gunthorpe
2022-09-02  3:52   ` Tian, Kevin
2022-08-31  1:02 ` [PATCH 8/8] vfio: Move container code into drivers/vfio/container.c Jason Gunthorpe

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=Yw9/4h3mlN4LuBz8@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    /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.