Re: [PATCH 2/4] drm/i915: Consistent struct device naming

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

 



On Tue, 02 Aug 2016, Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> wrote:
> On ma, 2016-08-01 at 19:57 +0100, Chris Wilson wrote:
>> On Mon, Aug 01, 2016 at 06:38:53PM +0300, David Weinehall wrote:
>> > 
>> > We currently have a mix of struct device *device, struct device *kdev,
>> > and struct device *dev (the latter forcing us to refer to
>> > struct drm_device as something else than the normal dev).
>> > 
>> > To simplify things, always use kdev when referring to struct device.
>> > 
>> > Signed-off-by: David Weinehall <david.weinehall@xxxxxxxxxxxxxxx>
>> kdev may be confused with kdev_t, but seems reasonable due to kobj.
>> 
>> This patch is an improvement, so
>> Reviewed-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
>> 
>> but I was wondering if
>> 
>> struct device *dev;
>> struct drm_device *drm;
>> struct i915_device *i915;
>> 
>
> I'd vote for this scheme.

In the driver,

30 out of 52 struct device * decls use "dev".

1233 out of 1251 struct drm_device * decls use "dev".

2112 out of 2154 struct drm_i915_private * decls use "dev_priv".

By all means change struct device *dev to something else, like kdev, or
whatever.

But do we really not have better things to do than come up with ways to
create tons of rename churn, increasing the cognitive burden of
developers, forcing rebases of tons of in-flight code making it harder
to get code in, creating conflicts for backporting fixes, and so on?

I'm firmly behind sticking with struct drm_i915_private *dev_priv and
struct drm_device *dev.


BR,
Jani.

>
> Regards, Joonas
>
>> (struct i915_device is move apt now than drm_i915_private due to the
>> subclassing)
>> 
>> made more sense as a longterm goal?
>> -Chris
>> 

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux