Re: [Intel-gfx] [PATCH 10/13] drm/i915: Use drm_connector_list_iter in debugfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 14, 2016 at 3:44 PM, Jani Nikula
<jani.nikula@xxxxxxxxxxxxxxx> wrote:
> On Wed, 14 Dec 2016, Daniel Vetter <daniel.vetter@xxxxxxxx> wrote:
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> index 20bc04d5e617..7e25a7fffb1c 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -481,6 +481,9 @@ struct i915_hotplug {
>>                           &(dev)->mode_config.connector_list, \
>>                           base.head)
>>
>> +#define for_each_intel_connector_iter(intel_connector, iter) \
>> +     while ((intel_connector = to_intel_connector(drm_connector_list_iter_next(iter))))
>
> I occasionally worry about us relying on the base struct always being
> the first member. We don't even document this requirement anywhere.

In the cases where we misplaced the base struct we fixed up our to_foo
cast macros to correctly cast NULL pointers. Anything else just goes
boom sooner or later ...
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux