Skip to content

Commit 0d361b0

Browse files
bebarinoandersson
authored andcommitted
soc: qcom: socinfo: Don't print anything if nothing found
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> Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Sai Prakash Ranjan <saiprakash.ranjan@codeaurora.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20210628030150.2627905-1-swboyd@chromium.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1 parent d43b3a9 commit 0d361b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/soc/qcom/socinfo.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ QCOM_OPEN(chip_id, qcom_show_chip_id);
417417
static int show_image_##type(struct seq_file *seq, void *p) \
418418
{ \
419419
struct smem_image_version *image_version = seq->private; \
420-
seq_puts(seq, image_version->type); \
421-
seq_putc(seq, '\n'); \
420+
if (image_version->type[0] != '\0') \
421+
seq_printf(seq, "%s\n", image_version->type); \
422422
return 0; \
423423
} \
424424
static int open_image_##type(struct inode *inode, struct file *file) \

0 commit comments

Comments
 (0)