public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] drm/xcsi2rxss: use str_true_false() for boolean dev_info output
@ 2026-01-23 15:31 Nick Huang
  2026-01-23 15:36 ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Huang @ 2026-01-23 15:31 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Michal Simek, linux-media,
	linux-arm-kernel, linux-kernel, kusogame68, Nick Huang

Refactor dev_info calls in xcsi2rxss_log_status() to use the
str_true_false() helper instead of inline ternary operators
("true" : "false"). This makes the code cleaner, more readable,
and easier to maintain. Added #include <linux/string_choices.h>
for future use if symbolic flag printing is needed.

Signed-off-by: Nick Huang <sef1548@gmail.com>
---
 drivers/media/platform/xilinx/xilinx-csi2rxss.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c
index 146131b8f..e0c5b2ceb 100644
--- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c
+++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c
@@ -17,6 +17,7 @@
 #include <linux/of_irq.h>
 #include <linux/platform_device.h>
 #include <linux/v4l2-subdev.h>
+#include <linux/string_choices.h>
 #include <media/media-entity.h>
 #include <media/mipi-csi2.h>
 #include <media/v4l2-common.h>
@@ -400,19 +401,19 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd)
 	dev_info(dev, "***** Core Status *****\n");
 	data = xcsi2rxss_read(xcsi2rxss, XCSI_CSR_OFFSET);
 	dev_info(dev, "Short Packet FIFO Full = %s\n",
-		 data & XCSI_CSR_SPFIFOFULL ? "true" : "false");
+		 str_true_false(data & XCSI_CSR_SPFIFOFULL));
 	dev_info(dev, "Short Packet FIFO Not Empty = %s\n",
-		 data & XCSI_CSR_SPFIFONE ? "true" : "false");
+		 str_true_false(data & XCSI_CSR_SPFIFONE));
 	dev_info(dev, "Stream line buffer full = %s\n",
-		 data & XCSI_CSR_SLBF ? "true" : "false");
+		 str_true_false(data & XCSI_CSR_SLBF));
 	dev_info(dev, "Soft reset/Core disable in progress = %s\n",
-		 data & XCSI_CSR_RIPCD ? "true" : "false");
+		 str_true_false(data & XCSI_CSR_RIPCD));
 
 	/* Clk & Lane Info  */
 	dev_info(dev, "******** Clock Lane Info *********\n");
 	data = xcsi2rxss_read(xcsi2rxss, XCSI_CLKINFR_OFFSET);
 	dev_info(dev, "Clock Lane in Stop State = %s\n",
-		 data & XCSI_CLKINFR_STOP ? "true" : "false");
+		 str_true_false(data & XCSI_CLKINFR_STOP));
 
 	dev_info(dev, "******** Data Lane Info *********\n");
 	dev_info(dev, "Lane\tSoT Error\tSoT Sync Error\tStop State\n");
@@ -421,9 +422,9 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd)
 		data = xcsi2rxss_read(xcsi2rxss, reg);
 
 		dev_info(dev, "%d\t%s\t\t%s\t\t%s\n", i,
-			 data & XCSI_DLXINFR_SOTERR ? "true" : "false",
-			 data & XCSI_DLXINFR_SOTSYNCERR ? "true" : "false",
-			 data & XCSI_DLXINFR_STOP ? "true" : "false");
+			 str_true_false(data & XCSI_DLXINFR_SOTERR),
+			 str_true_false(data & XCSI_DLXINFR_SOTSYNCERR),
+			 str_true_false(data & XCSI_DLXINFR_STOP));
 
 		reg += XCSI_NEXTREG_OFFSET;
 	}
-- 
2.43.0



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

* Re: [PATCH] drm/xcsi2rxss: use str_true_false() for boolean dev_info output
  2026-01-23 15:31 [PATCH] drm/xcsi2rxss: use str_true_false() for boolean dev_info output Nick Huang
@ 2026-01-23 15:36 ` Laurent Pinchart
  2026-01-24  7:51   ` Nick Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2026-01-23 15:36 UTC (permalink / raw)
  To: Nick Huang
  Cc: Mauro Carvalho Chehab, Michal Simek, linux-media,
	linux-arm-kernel, linux-kernel, kusogame68

On Fri, Jan 23, 2026 at 03:31:04PM +0000, Nick Huang wrote:
> Refactor dev_info calls in xcsi2rxss_log_status() to use the
> str_true_false() helper instead of inline ternary operators
> ("true" : "false"). This makes the code cleaner, more readable,
> and easier to maintain.

That's a matter of personal preference, and I disagree with that. Please
don't post this kind of refactoring that doesn't bring actual
improvements, that's not a good use of reviewers and maintainers' time.

> Added #include <linux/string_choices.h>
> for future use if symbolic flag printing is needed.
> 
> Signed-off-by: Nick Huang <sef1548@gmail.com>
> ---
>  drivers/media/platform/xilinx/xilinx-csi2rxss.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c
> index 146131b8f..e0c5b2ceb 100644
> --- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c
> +++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c
> @@ -17,6 +17,7 @@
>  #include <linux/of_irq.h>
>  #include <linux/platform_device.h>
>  #include <linux/v4l2-subdev.h>
> +#include <linux/string_choices.h>
>  #include <media/media-entity.h>
>  #include <media/mipi-csi2.h>
>  #include <media/v4l2-common.h>
> @@ -400,19 +401,19 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd)
>  	dev_info(dev, "***** Core Status *****\n");
>  	data = xcsi2rxss_read(xcsi2rxss, XCSI_CSR_OFFSET);
>  	dev_info(dev, "Short Packet FIFO Full = %s\n",
> -		 data & XCSI_CSR_SPFIFOFULL ? "true" : "false");
> +		 str_true_false(data & XCSI_CSR_SPFIFOFULL));
>  	dev_info(dev, "Short Packet FIFO Not Empty = %s\n",
> -		 data & XCSI_CSR_SPFIFONE ? "true" : "false");
> +		 str_true_false(data & XCSI_CSR_SPFIFONE));
>  	dev_info(dev, "Stream line buffer full = %s\n",
> -		 data & XCSI_CSR_SLBF ? "true" : "false");
> +		 str_true_false(data & XCSI_CSR_SLBF));
>  	dev_info(dev, "Soft reset/Core disable in progress = %s\n",
> -		 data & XCSI_CSR_RIPCD ? "true" : "false");
> +		 str_true_false(data & XCSI_CSR_RIPCD));
>  
>  	/* Clk & Lane Info  */
>  	dev_info(dev, "******** Clock Lane Info *********\n");
>  	data = xcsi2rxss_read(xcsi2rxss, XCSI_CLKINFR_OFFSET);
>  	dev_info(dev, "Clock Lane in Stop State = %s\n",
> -		 data & XCSI_CLKINFR_STOP ? "true" : "false");
> +		 str_true_false(data & XCSI_CLKINFR_STOP));
>  
>  	dev_info(dev, "******** Data Lane Info *********\n");
>  	dev_info(dev, "Lane\tSoT Error\tSoT Sync Error\tStop State\n");
> @@ -421,9 +422,9 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd)
>  		data = xcsi2rxss_read(xcsi2rxss, reg);
>  
>  		dev_info(dev, "%d\t%s\t\t%s\t\t%s\n", i,
> -			 data & XCSI_DLXINFR_SOTERR ? "true" : "false",
> -			 data & XCSI_DLXINFR_SOTSYNCERR ? "true" : "false",
> -			 data & XCSI_DLXINFR_STOP ? "true" : "false");
> +			 str_true_false(data & XCSI_DLXINFR_SOTERR),
> +			 str_true_false(data & XCSI_DLXINFR_SOTSYNCERR),
> +			 str_true_false(data & XCSI_DLXINFR_STOP));
>  
>  		reg += XCSI_NEXTREG_OFFSET;
>  	}

-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH] drm/xcsi2rxss: use str_true_false() for boolean dev_info output
  2026-01-23 15:36 ` Laurent Pinchart
@ 2026-01-24  7:51   ` Nick Huang
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Huang @ 2026-01-24  7:51 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Mauro Carvalho Chehab, Michal Simek, linux-media,
	linux-arm-kernel, linux-kernel, kusogame68

Laurent Pinchart <laurent.pinchart@ideasonboard.com> 於 2026年1月23日週五 下午11:36寫道:
>
> On Fri, Jan 23, 2026 at 03:31:04PM +0000, Nick Huang wrote:
> > Refactor dev_info calls in xcsi2rxss_log_status() to use the
> > str_true_false() helper instead of inline ternary operators
> > ("true" : "false"). This makes the code cleaner, more readable,
> > and easier to maintain.
>
> That's a matter of personal preference, and I disagree with that. Please
> don't post this kind of refactoring that doesn't bring actual
> improvements, that's not a good use of reviewers and maintainers' time.
>
> > Added #include <linux/string_choices.h>
> > for future use if symbolic flag printing is needed.
> >
> > Signed-off-by: Nick Huang <sef1548@gmail.com>
> > ---
> >  drivers/media/platform/xilinx/xilinx-csi2rxss.c | 17 +++++++++--------
> >  1 file changed, 9 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/media/platform/xilinx/xilinx-csi2rxss.c b/drivers/media/platform/xilinx/xilinx-csi2rxss.c
> > index 146131b8f..e0c5b2ceb 100644
> > --- a/drivers/media/platform/xilinx/xilinx-csi2rxss.c
> > +++ b/drivers/media/platform/xilinx/xilinx-csi2rxss.c
> > @@ -17,6 +17,7 @@
> >  #include <linux/of_irq.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/v4l2-subdev.h>
> > +#include <linux/string_choices.h>
> >  #include <media/media-entity.h>
> >  #include <media/mipi-csi2.h>
> >  #include <media/v4l2-common.h>
> > @@ -400,19 +401,19 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd)
> >       dev_info(dev, "***** Core Status *****\n");
> >       data = xcsi2rxss_read(xcsi2rxss, XCSI_CSR_OFFSET);
> >       dev_info(dev, "Short Packet FIFO Full = %s\n",
> > -              data & XCSI_CSR_SPFIFOFULL ? "true" : "false");
> > +              str_true_false(data & XCSI_CSR_SPFIFOFULL));
> >       dev_info(dev, "Short Packet FIFO Not Empty = %s\n",
> > -              data & XCSI_CSR_SPFIFONE ? "true" : "false");
> > +              str_true_false(data & XCSI_CSR_SPFIFONE));
> >       dev_info(dev, "Stream line buffer full = %s\n",
> > -              data & XCSI_CSR_SLBF ? "true" : "false");
> > +              str_true_false(data & XCSI_CSR_SLBF));
> >       dev_info(dev, "Soft reset/Core disable in progress = %s\n",
> > -              data & XCSI_CSR_RIPCD ? "true" : "false");
> > +              str_true_false(data & XCSI_CSR_RIPCD));
> >
> >       /* Clk & Lane Info  */
> >       dev_info(dev, "******** Clock Lane Info *********\n");
> >       data = xcsi2rxss_read(xcsi2rxss, XCSI_CLKINFR_OFFSET);
> >       dev_info(dev, "Clock Lane in Stop State = %s\n",
> > -              data & XCSI_CLKINFR_STOP ? "true" : "false");
> > +              str_true_false(data & XCSI_CLKINFR_STOP));
> >
> >       dev_info(dev, "******** Data Lane Info *********\n");
> >       dev_info(dev, "Lane\tSoT Error\tSoT Sync Error\tStop State\n");
> > @@ -421,9 +422,9 @@ static int xcsi2rxss_log_status(struct v4l2_subdev *sd)
> >               data = xcsi2rxss_read(xcsi2rxss, reg);
> >
> >               dev_info(dev, "%d\t%s\t\t%s\t\t%s\n", i,
> > -                      data & XCSI_DLXINFR_SOTERR ? "true" : "false",
> > -                      data & XCSI_DLXINFR_SOTSYNCERR ? "true" : "false",
> > -                      data & XCSI_DLXINFR_STOP ? "true" : "false");
> > +                      str_true_false(data & XCSI_DLXINFR_SOTERR),
> > +                      str_true_false(data & XCSI_DLXINFR_SOTSYNCERR),
> > +                      str_true_false(data & XCSI_DLXINFR_STOP));
> >
> >               reg += XCSI_NEXTREG_OFFSET;
> >       }
>
> --
> Regards,
>
> Laurent Pinchart

Hi Laurent Pinchart

Thanks for your reply! Since this refactor doesn't introduce
significant logic improvements, let's stick to the original design to
respect the maintainers' time.

-- 
Regards,
Nick Huang


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

end of thread, other threads:[~2026-01-24  7:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 15:31 [PATCH] drm/xcsi2rxss: use str_true_false() for boolean dev_info output Nick Huang
2026-01-23 15:36 ` Laurent Pinchart
2026-01-24  7:51   ` Nick Huang

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