public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Vaishali Thakkar <vaishali.thakkar@linaro.org>
Cc: andy.gross@linaro.org, david.brown@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	rafael@kernel.org, bjorn.andersson@linaro.org, vkoul@kernel.org
Subject: Re: [PATCH v3 5/5] soc: qcom: socinfo: Expose image information
Date: Thu, 21 Feb 2019 17:34:10 +0100	[thread overview]
Message-ID: <20190221163410.GE8727@kroah.com> (raw)
In-Reply-To: <20190221162419.32384-6-vaishali.thakkar@linaro.org>

On Thu, Feb 21, 2019 at 09:54:19PM +0530, Vaishali Thakkar wrote:
>  static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo)
>  {
> +	struct smem_image_version *smem_image_version;
> +	size_t size;
> +
>  	qcom_socinfo->dbg_root = debugfs_create_dir("qcom_socinfo", NULL);
>  
>  	DEBUGFS_UINT_ADD(raw_version);
> @@ -314,6 +432,98 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo)
>  	DEBUGFS_ADD(pmic_model);
>  	DEBUGFS_ADD(platform_subtype);
>  	DEBUGFS_ADD(pmic_die_revision);
> +
> +	smem_image_version = qcom_smem_get(QCOM_SMEM_HOST_ANY,
> +					   SMEM_IMAGE_VERSION_TABLE,
> +					   &size);
> +
> +	qcom_socinfo->boot = debugfs_create_dir("boot",
> +						qcom_socinfo->dbg_root);
> +	if (!qcom_socinfo->boot) {
> +		pr_err("Cannot create boot image directory\n");
> +		return;
> +	}

You do not care, do not check please.  Also, even if you wanted to
check, your error checking was wrong :)

> +	DEBUGFS_IMAGE_NAME(name, boot, SMEM_IMAGE_TABLE_BOOT_INDEX);
> +	DEBUGFS_IMAGE_VARIANT(variant, boot, SMEM_IMAGE_TABLE_BOOT_INDEX);
> +	DEBUGFS_IMAGE_OEM(oem, boot, SMEM_IMAGE_TABLE_BOOT_INDEX);
> +
> +	qcom_socinfo->tz = debugfs_create_dir("tz",
> +					      qcom_socinfo->dbg_root);
> +	if (!qcom_socinfo->tz) {
> +		pr_err("Cannot create tz image directory\n");
> +		return;
> +	}

Same here, no error checking please.

> +	DEBUGFS_IMAGE_NAME(name, tz, SMEM_IMAGE_TABLE_TZ_INDEX);
> +	DEBUGFS_IMAGE_VARIANT(variant, tz, SMEM_IMAGE_TABLE_TZ_INDEX);
> +	DEBUGFS_IMAGE_OEM(oem, tz, SMEM_IMAGE_TABLE_TZ_INDEX);
> +
> +	qcom_socinfo->rpm = debugfs_create_dir("rpm",
> +					       qcom_socinfo->dbg_root);
> +	if (!qcom_socinfo->rpm) {
> +		pr_err("Cannot create rpm image directory\n");
> +		return;
> +	}

And here.

> +	DEBUGFS_IMAGE_NAME(name, rpm, SMEM_IMAGE_TABLE_RPM_INDEX);
> +	DEBUGFS_IMAGE_VARIANT(variant, rpm, SMEM_IMAGE_TABLE_RPM_INDEX);
> +	DEBUGFS_IMAGE_OEM(oem, rpm, SMEM_IMAGE_TABLE_RPM_INDEX);
> +
> +	qcom_socinfo->apps = debugfs_create_dir("apps",
> +						qcom_socinfo->dbg_root);
> +	if (!qcom_socinfo->apps) {
> +		pr_err("Cannot create apps image directory\n");
> +		return;
> +	}

And here.

> +	DEBUGFS_IMAGE_NAME(name, apps, SMEM_IMAGE_TABLE_APPS_INDEX);
> +	DEBUGFS_IMAGE_VARIANT(variant, apps, SMEM_IMAGE_TABLE_APPS_INDEX);
> +	DEBUGFS_IMAGE_OEM(oem, apps, SMEM_IMAGE_TABLE_APPS_INDEX);
> +
> +	qcom_socinfo->mpss = debugfs_create_dir("mpss",
> +						qcom_socinfo->dbg_root);
> +	if (!qcom_socinfo->mpss) {
> +		pr_err("Cannot create mpss image directory\n");
> +		return;
> +	}

Yet again...

> +
> +	DEBUGFS_IMAGE_NAME(name, mpss, SMEM_IMAGE_TABLE_MPSS_INDEX);
> +	DEBUGFS_IMAGE_VARIANT(variant, mpss, SMEM_IMAGE_TABLE_MPSS_INDEX);
> +	DEBUGFS_IMAGE_OEM(oem, mpss, SMEM_IMAGE_TABLE_MPSS_INDEX);
> +
> +	qcom_socinfo->adsp = debugfs_create_dir("adsp",
> +						qcom_socinfo->dbg_root);
> +	if (!qcom_socinfo->adsp) {
> +		pr_err("Cannot create adsp image directory\n");
> +		return;
> +	}

And again...

> +
> +	DEBUGFS_IMAGE_NAME(name, adsp, SMEM_IMAGE_TABLE_ADSP_INDEX);
> +	DEBUGFS_IMAGE_VARIANT(variant, adsp, SMEM_IMAGE_TABLE_ADSP_INDEX);
> +	DEBUGFS_IMAGE_OEM(oem, adsp, SMEM_IMAGE_TABLE_ADSP_INDEX);
> +
> +	qcom_socinfo->cnss = debugfs_create_dir("cnss",
> +						qcom_socinfo->dbg_root);
> +	if (!qcom_socinfo->cnss) {
> +		pr_err("Cannot create cnss image directory\n");
> +		return;
> +	}

And again...

> +
> +	DEBUGFS_IMAGE_NAME(name, cnss, SMEM_IMAGE_TABLE_CNSS_INDEX);
> +	DEBUGFS_IMAGE_VARIANT(variant, cnss, SMEM_IMAGE_TABLE_CNSS_INDEX);
> +	DEBUGFS_IMAGE_OEM(oem, cnss, SMEM_IMAGE_TABLE_CNSS_INDEX);
> +
> +	qcom_socinfo->video = debugfs_create_dir("video",
> +						 qcom_socinfo->dbg_root);
> +	if (!qcom_socinfo->video) {
> +		pr_err("Cannot create video image directory\n");
> +		return;
> +	}

And one last time.

There, you get to delete a bunch of code, that's always fun :)

thanks,

greg k-h

  reply	other threads:[~2019-02-21 16:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-21 16:24 [PATCH v3 0/5] soc: qcom: Add SoC info driver Vaishali Thakkar
2019-02-21 16:24 ` [PATCH v3 1/5] base: soc: Add serial_number attribute to soc Vaishali Thakkar
2019-02-21 16:31   ` Greg KH
2019-02-21 16:24 ` [PATCH v3 2/5] base: soc: Export soc_device_register/unregister APIs Vaishali Thakkar
2019-02-21 16:31   ` Greg KH
2019-02-21 16:24 ` [PATCH v3 3/5] soc: qcom: Add socinfo driver Vaishali Thakkar
2019-02-21 16:24 ` [PATCH v3 4/5] soc: qcom: socinfo: Expose custom attributes Vaishali Thakkar
2019-02-21 16:32   ` Greg KH
2019-02-21 16:24 ` [PATCH v3 5/5] soc: qcom: socinfo: Expose image information Vaishali Thakkar
2019-02-21 16:34   ` Greg KH [this message]
2019-02-21 17:05     ` Vaishali Thakkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190221163410.GE8727@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=vaishali.thakkar@linaro.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox