[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <878rgj14ha.fsf@intel.com>
Date: Mon, 27 Feb 2023 18:02:25 +0200
From: Jani Nikula <jani.nikula@...ux.intel.com>
To: Siddh Raman Pant <code@...dh.me>
Cc: maarten lankhorst <maarten.lankhorst@...ux.intel.com>,
maxime ripard <mripard@...nel.org>,
thomas zimmermann <tzimmermann@...e.de>,
david airlie <airlied@...il.com>,
daniel vetter <daniel@...ll.ch>,
jim cromie <jim.cromie@...il.com>,
sam ravnborg <sam@...nborg.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
dri-devel <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH v7 1/7] drm/print: Fix and add support for NULL as first
argument in drm_* macros
On Mon, 27 Feb 2023, Siddh Raman Pant <code@...dh.me> wrote:
> On Mon, 27 Feb 2023 15:13:21 +0530, Jani Nikula wrote:
>> First of all, that's two distinct changes in one patch. The subject says
>> one thing, but it's really two.
>
> Sorry, my bad.
>
>> But the main question is, do we *really* want to let callers pass either
>> struct drm_device * or struct device *? It will be type safe with
>> generics, but if it's okay to use either, people *will* use either. The
>> call sites will end up being a mixture of both. You can't control it. It
>> will be very tedious if you ever want to revert that decision.
>>
>> Do we want to promote a style where you can pass either? To me, in C
>> context, it seems awfully sloppy and confusing rather than convenient.
>>
>> I'd argue the struct mipi_dsi_host stuff should use dev_* calls
>> directly, as it's more of a special case, rather than allow struct
>> device * in drm_* logging macros.
>
> I agree. I thought direct dev_* calls would not be ideal, as there is a
> TODO to move away from that, and also incorrectly expected to have more
> such dev ptr problems. But on a second thought, you are correct.
>
> Should I post a new patch, with using __drm_dev_ptr instead and
> removing the __get_dev_ptr generic macro, and using dev_* in
> drm_mipi_dsi.c as `dev_err(dev, "*ERROR* [drm] <msg>", ...);`?
I think commit 1040e424353f ("drm: mipi-dsi: Convert logging to drm_*
functions.") and any similar ones should just be reverted. It worked by
accident. You're supposed to pass struct drm_device * to the drm_*
logging functions, and that passes struct mipi_dsi_host *.
BR,
Jani.
>
>> BR,
>> Jani.
>
> Thanks,
> Siddh
--
Jani Nikula, Intel Open Source Graphics Center
Powered by blists - more mailing lists