[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <18693900367.2ce71ba5548919.6872574648582795181@siddh.me>
Date: Mon, 27 Feb 2023 21:18:54 +0530
From: Siddh Raman Pant <code@...dh.me>
To: "Jani Nikula" <jani.nikula@...ux.intel.com>
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 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>", ...);`?
> BR,
> Jani.
Thanks,
Siddh
Powered by blists - more mailing lists