[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXqI7qbxZEulU_GO@smile.fi.intel.com>
Date: Thu, 29 Jan 2026 00:08:46 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Paul Retourné <paul.retourne@...nge.fr>
Cc: andy@...nel.org, gregkh@...uxfoundation.org,
dri-devel@...ts.freedesktop.org, linux-fbdev@...r.kernel.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: fbtft: use guard() to simplify code
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
Powered by blists - more mailing lists