Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] media: atomisp: gmin: Use str_on_off() helper
@ 2026-06-10 18:23 Mert Seftali
  2026-06-10 22:19 ` Kees Cook
  2026-06-11  5:34 ` Andy Shevchenko
  0 siblings, 2 replies; 7+ messages in thread
From: Mert Seftali @ 2026-06-10 18:23 UTC (permalink / raw)
  To: Hans de Goede, Mauro Carvalho Chehab
  Cc: Sakari Ailus, Andy Shevchenko, Greg Kroah-Hartman, Kees Cook,
	linux-media, linux-staging, linux-kernel, Mert Seftali

Replace the open-coded "on" : "off" ternary with the standard
str_on_off() helper from <linux/string_choices.h>. This improves
readability and reuses the kernel's existing string helper instead of
duplicating the literals.

No functional change intended.

Signed-off-by: Mert Seftali <mertsftl@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index 4026e98c5845..322eca4a3755 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -13,6 +13,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/gpio.h>
 #include <linux/platform_device.h>
+#include <linux/string_choices.h>
 #include "../../include/linux/atomisp_platform.h"
 #include "../../include/linux/atomisp_gmin_platform.h"
 
@@ -917,7 +918,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on)
 		return 0;
 
 	dev_dbg(subdev->dev, "Setting power state to %s\n",
-		on ? "on" : "off");
+		str_on_off(on));
 
 	if (on)
 		ret = acpi_device_set_power(adev,
@@ -930,7 +931,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on)
 		gs->clock_on = on;
 	else
 		dev_err(subdev->dev, "Couldn't set power state to %s\n",
-			on ? "on" : "off");
+			str_on_off(on));
 
 	return ret;
 }
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] media: atomisp: gmin: Use str_on_off() helper
  2026-06-10 18:23 [PATCH] media: atomisp: gmin: Use str_on_off() helper Mert Seftali
@ 2026-06-10 22:19 ` Kees Cook
  2026-06-11  5:34 ` Andy Shevchenko
  1 sibling, 0 replies; 7+ messages in thread
From: Kees Cook @ 2026-06-10 22:19 UTC (permalink / raw)
  To: Mert Seftali
  Cc: Hans de Goede, Mauro Carvalho Chehab, Sakari Ailus,
	Andy Shevchenko, Greg Kroah-Hartman, linux-media, linux-staging,
	linux-kernel

On Wed, Jun 10, 2026 at 08:23:48PM +0200, Mert Seftali wrote:
> Replace the open-coded "on" : "off" ternary with the standard
> str_on_off() helper from <linux/string_choices.h>. This improves
> readability and reuses the kernel's existing string helper instead of
> duplicating the literals.
> 
> No functional change intended.
> 
> Signed-off-by: Mert Seftali <mertsftl@gmail.com>

Reviewed-by: Kees Cook <kees@kernel.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] media: atomisp: gmin: Use str_on_off() helper
  2026-06-10 18:23 [PATCH] media: atomisp: gmin: Use str_on_off() helper Mert Seftali
  2026-06-10 22:19 ` Kees Cook
@ 2026-06-11  5:34 ` Andy Shevchenko
  2026-06-11  6:14   ` [PATCH v2] " Mert Seftali
  1 sibling, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-06-11  5:34 UTC (permalink / raw)
  To: Mert Seftali
  Cc: Hans de Goede, Mauro Carvalho Chehab, Sakari Ailus,
	Andy Shevchenko, Greg Kroah-Hartman, Kees Cook, linux-media,
	linux-staging, linux-kernel

On Wed, Jun 10, 2026 at 08:23:48PM +0200, Mert Seftali wrote:
> Replace the open-coded "on" : "off" ternary with the standard
> str_on_off() helper from <linux/string_choices.h>. This improves
> readability and reuses the kernel's existing string helper instead of
> duplicating the literals.
> 
> No functional change intended.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
but see a couple of nit-picks below.

...

>  #include <linux/gpio/consumer.h>
>  #include <linux/gpio.h>
>  #include <linux/platform_device.h>
> +#include <linux/string_choices.h>

While at it, perhaps add a blank line here.

>  #include "../../include/linux/atomisp_platform.h"
>  #include "../../include/linux/atomisp_gmin_platform.h"

...

>  	dev_dbg(subdev->dev, "Setting power state to %s\n",
> -		on ? "on" : "off");
> +		str_on_off(on));

Now this goes to be perfectly one line.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] media: atomisp: gmin: Use str_on_off() helper
  2026-06-11  5:34 ` Andy Shevchenko
@ 2026-06-11  6:14   ` Mert Seftali
  2026-06-11  6:51     ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Mert Seftali @ 2026-06-11  6:14 UTC (permalink / raw)
  To: Hans de Goede, Mauro Carvalho Chehab
  Cc: Andy Shevchenko, Sakari Ailus, Greg Kroah-Hartman, Kees Cook,
	linux-media, linux-staging, linux-kernel, Mert Seftali

Replace the open-coded "on" : "off" ternary with the standard
str_on_off() helper from <linux/string_choices.h>. This improves
readability and reuses the kernel's existing string helper instead of
duplicating the literals.

No functional change intended.

Signed-off-by: Mert Seftali <mertsftl@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
---
Changes in v2:
- Add a blank line between the system and local includes.
- Join the dev_dbg() call onto a single line now that it fits.

 drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
index 4026e98c5845..cb60cb3fab48 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c
@@ -13,6 +13,8 @@
 #include <linux/gpio/consumer.h>
 #include <linux/gpio.h>
 #include <linux/platform_device.h>
+#include <linux/string_choices.h>
+
 #include "../../include/linux/atomisp_platform.h"
 #include "../../include/linux/atomisp_gmin_platform.h"
 
@@ -916,8 +918,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on)
 	if (gs->clock_on == on)
 		return 0;
 
-	dev_dbg(subdev->dev, "Setting power state to %s\n",
-		on ? "on" : "off");
+	dev_dbg(subdev->dev, "Setting power state to %s\n", str_on_off(on));
 
 	if (on)
 		ret = acpi_device_set_power(adev,
@@ -930,7 +931,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on)
 		gs->clock_on = on;
 	else
 		dev_err(subdev->dev, "Couldn't set power state to %s\n",
-			on ? "on" : "off");
+			str_on_off(on));
 
 	return ret;
 }
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] media: atomisp: gmin: Use str_on_off() helper
  2026-06-11  6:14   ` [PATCH v2] " Mert Seftali
@ 2026-06-11  6:51     ` Andy Shevchenko
  2026-06-11  7:09       ` Mert S
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-06-11  6:51 UTC (permalink / raw)
  To: Mert Seftali
  Cc: Hans de Goede, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Kees Cook, linux-media, linux-staging,
	linux-kernel

On Thu, Jun 11, 2026 at 08:14:17AM +0200, Mert Seftali wrote:
> Replace the open-coded "on" : "off" ternary with the standard
> str_on_off() helper from <linux/string_choices.h>. This improves
> readability and reuses the kernel's existing string helper instead of
> duplicating the literals.
> 
> No functional change intended.

First of all, do not chain a new version to the email thread with the old one.
Second, you forgot tag from Kees. Why did you not take it?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] media: atomisp: gmin: Use str_on_off() helper
  2026-06-11  6:51     ` Andy Shevchenko
@ 2026-06-11  7:09       ` Mert S
  2026-06-11  7:38         ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Mert S @ 2026-06-11  7:09 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Hans de Goede, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Kees Cook, linux-media, linux-staging,
	linux-kernel

Andy Shevchenko wrote:
> First of all, do not chain a new version to the email thread with the
> old one.

Sorry about that. I'm pretty new to all this and still finding my way
around the process, so I appreciate you pointing it out. I'll send the
next revision as its own separate thread.

> Second, you forgot tag from Kees. Why did you not take it?

That ones just my mistake, I overlooked Kees' tag when I put v2
together. I'll make sure to take it in v3.

Thanks for your patience with me, and for the review.

Mert Seftali

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] media: atomisp: gmin: Use str_on_off() helper
  2026-06-11  7:09       ` Mert S
@ 2026-06-11  7:38         ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2026-06-11  7:38 UTC (permalink / raw)
  To: Mert S
  Cc: Hans de Goede, Mauro Carvalho Chehab, Sakari Ailus,
	Greg Kroah-Hartman, Kees Cook, linux-media, linux-staging,
	linux-kernel

On Thu, Jun 11, 2026 at 09:09:23AM +0200, Mert S wrote:
> Andy Shevchenko wrote:
> > First of all, do not chain a new version to the email thread with the
> > old one.
> 
> Sorry about that. I'm pretty new to all this and still finding my way
> around the process, so I appreciate you pointing it out. I'll send the
> next revision as its own separate thread.

Also note, the new version of the patch should be sent not earlier than 24+h
after the previous one.

> > Second, you forgot tag from Kees. Why did you not take it?
> 
> That ones just my mistake, I overlooked Kees' tag when I put v2
> together. I'll make sure to take it in v3.

`b4` tool is your friend. Become familiar with it and it helps you a lot.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-06-11  7:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10 18:23 [PATCH] media: atomisp: gmin: Use str_on_off() helper Mert Seftali
2026-06-10 22:19 ` Kees Cook
2026-06-11  5:34 ` Andy Shevchenko
2026-06-11  6:14   ` [PATCH v2] " Mert Seftali
2026-06-11  6:51     ` Andy Shevchenko
2026-06-11  7:09       ` Mert S
2026-06-11  7:38         ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox