public inbox for linux-fbdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: "Paul Retourné" <paul.retourne@orange.fr>
Cc: andy@kernel.org, gregkh@linuxfoundation.org,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: use guard() to simplify code
Date: Thu, 29 Jan 2026 00:08:46 +0200	[thread overview]
Message-ID: <aXqI7qbxZEulU_GO@smile.fi.intel.com> (raw)
In-Reply-To: <20260128212644.1170970-1-paul.retourne@orange.fr>

On Wed, Jan 28, 2026 at 10:26:42PM +0100, Paul Retourné wrote:
> Use guard() to simplify mutex locking. No functional change.

...

>  #include <linux/init.h>
>  #include <linux/gpio/consumer.h>
>  #include <linux/delay.h>
> +#include <linux/cleanup.h>

Try to squeeze the new inclusion into the longest ordered chain with some
pieces left unordered. With the given context the lease is to put it before
delay.h, but maybe there is a better place.

...

>  	if (par->gamma.curves[0] == 0) {
> -		mutex_lock(&par->gamma.lock);
> +		guard(mutex)(&par->gamma.lock);
>  		if (par->info->var.yres == 64)
>  			par->gamma.curves[0] = 0xCF;
>  		else
>  			par->gamma.curves[0] = 0x8F;
> -		mutex_unlock(&par->gamma.lock);
>  	}

This has close to 0 added value. Don't do conversion just for fun.

...

> --- a/drivers/staging/fbtft/fb_ssd1306.c
> +++ b/drivers/staging/fbtft/fb_ssd1306.c

Ditto.

...

Sorry, but I don't see much value in this change.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-01-28 22:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-28 21:26 [PATCH] staging: fbtft: use guard() to simplify code Paul Retourné
2026-01-28 22:08 ` Andy Shevchenko [this message]
2026-01-29  9:18   ` Paul Retourne
2026-01-29  4:38 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aXqI7qbxZEulU_GO@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=paul.retourne@orange.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox