lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240725-psychedelic-benevolent-muskrat-c7fd57@houat>
Date: Thu, 25 Jul 2024 10:28:39 +0200
From: Maxime Ripard <mripard@...nel.org>
To: Jani Nikula <jani.nikula@...ux.intel.com>
Cc: Tejas Vipin <tejasvipin76@...il.com>, 
	maarten.lankhorst@...ux.intel.com, tzimmermann@...e.de, dianders@...omium.org, airlied@...il.com, 
	daniel@...ll.ch, dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] drm/mipi-dsi: Change multi functions to use quiet
 member of mipi_dsi_multi_context

On Wed, Jul 24, 2024 at 06:32:14PM GMT, Jani Nikula wrote:
> On Wed, 24 Jul 2024, Tejas Vipin <tejasvipin76@...il.com> wrote:
> > Changes all the multi functions to check if the current context requires
> > errors to be printed or not using the quiet member.
> >
> > Signed-off-by: Tejas Vipin <tejasvipin76@...il.com>
> > ---
> >  drivers/gpu/drm/drm_mipi_dsi.c | 20 ++++++++++++++++++++
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
> > index a471c46f5ca6..cbb77342d201 100644
> > --- a/drivers/gpu/drm/drm_mipi_dsi.c
> > +++ b/drivers/gpu/drm/drm_mipi_dsi.c
> > @@ -814,6 +814,8 @@ void mipi_dsi_generic_write_multi(struct mipi_dsi_multi_context *ctx,
> >  	ret = mipi_dsi_generic_write(dsi, payload, size);
> >  	if (ret < 0) {
> >  		ctx->accum_err = ret;
> > +		if (ctx->quiet)
> > +			return;
> >  		dev_err(dev, "sending generic data %*ph failed: %d\n",
> >  			(int)size, payload, ctx->accum_err);
> 
> A maintainability nitpick. Imagine someone wishing to add some more
> error handling here. Or something else after the block.
> 
> IMO the dev_err() should be wrapped in if (!ctx->quiet) instead of
> adding an early return.
> 
> Ditto everywhere.

I'm not even sure why we need that parameter in the first place.

Like, what's the expected use of that parameter? Is it supposed to be
set in users of that function?

If so, wouldn't it prevent any sort of meaningful debugging if some
drivers set it and some don't?

It looks to me like you're reimplementing drm.debug.

Maxime

Download attachment "signature.asc" of type "application/pgp-signature" (274 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ