lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <532f14ced3ba915dfa4d92b2d2f4eaba@codeaurora.org>
Date:   Tue, 19 Jan 2021 09:55:21 +0530
From:   Sai Prakash Ranjan <saiprakash.ranjan@...eaurora.org>
To:     Stephen Boyd <swboyd@...omium.org>
Cc:     Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        Douglas Anderson <dianders@...omium.org>,
        Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
Subject: Re: [PATCH] soc: qcom: socinfo: Don't print anything if nothing found

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@...eaurora.org>
> Cc: Douglas Anderson <dianders@...omium.org>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> Signed-off-by: Stephen Boyd <swboyd@...omium.org>
> ---

Reviewed-by: Sai Prakash Ranjan <saiprakash.ranjan@...eaurora.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ