Message ID | 20180905201943.22675-1-lucas.demarchi@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2] drm/i915: reword documentation of possible pci_device_id struct | expand |
On Wed, Sep 5, 2018 at 1:21 PM Lucas De Marchi <lucas.demarchi@intel.com> wrote: > > Document it like a real struct for ease of copy and paste, remove > comment of C99 compatibility and document that in some cases the first 2 > fields can be u16. > > v2: - remove mention to (non-existent) PCI_DEVICE_ANY and better explain > use of __u16 in first 2 fields ping review? thanks Lucas De Marchi > > Cc: Chris Wilson <chris@chris-wilson.co.uk> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> > --- > include/drm/i915_pciids.h | 17 ++++++++++------- > 1 file changed, 10 insertions(+), 7 deletions(-) > > diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h > index 754ce4b10129..0f15d7b2e8ea 100644 > --- a/include/drm/i915_pciids.h > +++ b/include/drm/i915_pciids.h > @@ -26,14 +26,17 @@ > #define _I915_PCIIDS_H > > /* > - * A pci_device_id struct { > - * __u32 vendor, device; > - * __u32 subvendor, subdevice; > - * __u32 class, class_mask; > - * kernel_ulong_t driver_data; > + * These macros can be used with a struct declared like this: > + * > + * struct pci_device_id { > + * __u32 vendor, device; > + * __u32 subvendor, subdevice; > + * __u32 class, class_mask; > + * kernel_ulong_t driver_data; > * }; > - * Don't use C99 here because "class" is reserved and we want to > - * give userspace flexibility. > + * > + * This matches the struct used in the kernel. First two fields may be > + * changed to __u16 if using this header in a userspace program. > */ > #define INTEL_VGA_DEVICE(id, info) { \ > 0x8086, id, \ > -- > 2.17.1 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h index 754ce4b10129..0f15d7b2e8ea 100644 --- a/include/drm/i915_pciids.h +++ b/include/drm/i915_pciids.h @@ -26,14 +26,17 @@ #define _I915_PCIIDS_H /* - * A pci_device_id struct { - * __u32 vendor, device; - * __u32 subvendor, subdevice; - * __u32 class, class_mask; - * kernel_ulong_t driver_data; + * These macros can be used with a struct declared like this: + * + * struct pci_device_id { + * __u32 vendor, device; + * __u32 subvendor, subdevice; + * __u32 class, class_mask; + * kernel_ulong_t driver_data; * }; - * Don't use C99 here because "class" is reserved and we want to - * give userspace flexibility. + * + * This matches the struct used in the kernel. First two fields may be + * changed to __u16 if using this header in a userspace program. */ #define INTEL_VGA_DEVICE(id, info) { \ 0x8086, id, \
Document it like a real struct for ease of copy and paste, remove comment of C99 compatibility and document that in some cases the first 2 fields can be u16. v2: - remove mention to (non-existent) PCI_DEVICE_ANY and better explain use of __u16 in first 2 fields Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> --- include/drm/i915_pciids.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)