[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190301195140.GE27005@builder>
Date: Fri, 1 Mar 2019 11:51:40 -0800
From: Bjorn Andersson <bjorn.andersson@...aro.org>
To: Vaishali Thakkar <vaishali.thakkar@...aro.org>
Cc: andy.gross@...aro.org, david.brown@...aro.org,
gregkh@...uxfoundation.org, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, rafael@...nel.org, vkoul@...nel.org
Subject: Re: [PATCH v4 5/5] soc: qcom: socinfo: Expose image information
On Sun 24 Feb 22:50 PST 2019, Vaishali Thakkar wrote:
> +#define IMAGE_SHOW_OEM(attr) \
> +static int show_ ##attr## _oem(struct seq_file *seq, void *p) \
> +{ \
> + struct smem_image_version *image_version = seq->private; \
> + seq_puts(seq, image_version->oem); \
> + seq_puts(seq, "\n"); \
> + return 0; \
> +} \
> +static int open_ ##attr## _oem(struct inode *inode, struct file *file) \
> +{ \
> + return single_open(file, show_ ##attr## _oem, inode->i_private); \
> +} \
> + \
> +static const struct file_operations qcom_ ##attr## _oem_ops = { \
> + .open = open_ ##attr## _oem, \
> + .read = seq_read, \
> + .llseek = seq_lseek, \
> + .release = single_release, \
> +}
> +
> +#define DEBUGFS_IMAGE_OEM(fname, attr, index) \
> +debugfs_create_file(__stringify(fname), 0400, qcom_socinfo->attr, \
> + &smem_image_version[index], &qcom_ ##attr## _oem_ops)
> +
> +#define IMAGE_SHOW(name) \
> + IMAGE_SHOW_NAME(name); \
> + IMAGE_SHOW_VARIANT(name); \
> + IMAGE_SHOW_OEM(name) \
> +
> +IMAGE_SHOW(boot);
Given that you pass &smem_image_version[index] as "data" it seems that
these instances will only differ in the function name. So you should be
able to have one set of these functions to handle all the images.
> +IMAGE_SHOW(tz);
> +IMAGE_SHOW(rpm);
> +IMAGE_SHOW(apps);
> +IMAGE_SHOW(mpss);
> +IMAGE_SHOW(adsp);
> +IMAGE_SHOW(cnss);
> +IMAGE_SHOW(video);
> +
Regards,
Bjorn
Powered by blists - more mailing lists