All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] soc: qcom: socinfo: Don't print anything if nothing found
@ 2021-01-15 20:39 Stephen Boyd
  2021-01-16  0:57 ` Doug Anderson
  2021-01-19  4:25 ` Sai Prakash Ranjan
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Boyd @ 2021-01-15 20:39 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson
  Cc: linux-kernel, linux-arm-msm, Sai Prakash Ranjan,
	Douglas Anderson, Dmitry Baryshkov

Let's skip printing anything if there's nothing to see. This makes it so
the file length is 0 instead of 1, for the newline, and helps scripts
figure out if there's anything to see in these files.

Cc: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 drivers/soc/qcom/socinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
index a985ed064669..0844b5d4e354 100644
--- a/drivers/soc/qcom/socinfo.c
+++ b/drivers/soc/qcom/socinfo.c
@@ -373,8 +373,8 @@ QCOM_OPEN(chip_id, qcom_show_chip_id);
 static int show_image_##type(struct seq_file *seq, void *p)		  \
 {								  \
 	struct smem_image_version *image_version = seq->private;  \
-	seq_puts(seq, image_version->type);			  \
-	seq_putc(seq, '\n');					  \
+	if (image_version->type[0] != '\0')			  \
+		seq_printf(seq, "%s\n", image_version->type);	  \
 	return 0;						  \
 }								  \
 static int open_image_##type(struct inode *inode, struct file *file)	  \

base-commit: 3bc4bf77fa2adca8d6677461b6ec57505f1a3331
-- 
https://chromeos.dev


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

* Re: [PATCH] soc: qcom: socinfo: Don't print anything if nothing found
  2021-01-15 20:39 [PATCH] soc: qcom: socinfo: Don't print anything if nothing found Stephen Boyd
@ 2021-01-16  0:57 ` Doug Anderson
  2021-01-19  4:25 ` Sai Prakash Ranjan
  1 sibling, 0 replies; 3+ messages in thread
From: Doug Anderson @ 2021-01-16  0:57 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Andy Gross, Bjorn Andersson, LKML, linux-arm-msm,
	Sai Prakash Ranjan, Dmitry Baryshkov

Hi,

On Fri, Jan 15, 2021 at 12:39 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Let's skip printing anything if there's nothing to see. This makes it so
> the file length is 0 instead of 1, for the newline, and helps scripts
> figure out if there's anything to see in these files.
>
> Cc: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
>  drivers/soc/qcom/socinfo.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

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

* Re: [PATCH] soc: qcom: socinfo: Don't print anything if nothing found
  2021-01-15 20:39 [PATCH] soc: qcom: socinfo: Don't print anything if nothing found Stephen Boyd
  2021-01-16  0:57 ` Doug Anderson
@ 2021-01-19  4:25 ` Sai Prakash Ranjan
  1 sibling, 0 replies; 3+ messages in thread
From: Sai Prakash Ranjan @ 2021-01-19  4:25 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Andy Gross, Bjorn Andersson, linux-kernel, linux-arm-msm,
	Douglas Anderson, Dmitry Baryshkov

On 2021-01-16 02:09, Stephen Boyd wrote:
> Let's skip printing anything if there's nothing to see. This makes it 
> so
> the file length is 0 instead of 1, for the newline, and helps scripts
> figure out if there's anything to see in these files.
> 
> Cc: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>
> Cc: Douglas Anderson <dianders@chromium.org>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---

Reviewed-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org>

>  drivers/soc/qcom/socinfo.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/qcom/socinfo.c b/drivers/soc/qcom/socinfo.c
> index a985ed064669..0844b5d4e354 100644
> --- a/drivers/soc/qcom/socinfo.c
> +++ b/drivers/soc/qcom/socinfo.c
> @@ -373,8 +373,8 @@ QCOM_OPEN(chip_id, qcom_show_chip_id);
>  static int show_image_##type(struct seq_file *seq, void *p)		  \
>  {								  \
>  	struct smem_image_version *image_version = seq->private;  \
> -	seq_puts(seq, image_version->type);			  \
> -	seq_putc(seq, '\n');					  \
> +	if (image_version->type[0] != '\0')			  \
> +		seq_printf(seq, "%s\n", image_version->type);	  \
>  	return 0;						  \
>  }								  \
>  static int open_image_##type(struct inode *inode, struct file *file)	  
> \
> 
> base-commit: 3bc4bf77fa2adca8d6677461b6ec57505f1a3331

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a 
member
of Code Aurora Forum, hosted by The Linux Foundation

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

end of thread, other threads:[~2021-01-19  4:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 20:39 [PATCH] soc: qcom: socinfo: Don't print anything if nothing found Stephen Boyd
2021-01-16  0:57 ` Doug Anderson
2021-01-19  4:25 ` Sai Prakash Ranjan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.