public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Kartik <kkartik@nvidia.com>
Cc: thierry.reding@gmail.com, jonathanh@nvidia.com,
	sumitg@nvidia.com, arnd@arndb.de, pshete@nvidia.com,
	digetx@gmail.com, petlozup@nvidia.com, windhl@126.com,
	frank.li@vivo.com, robh@kernel.org, stefank@nvidia.com,
	pdeschrijver@nvidia.com, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/6] soc/tegra: fuse: Add function to add lookups
Date: Thu, 7 Sep 2023 17:35:07 +0300	[thread overview]
Message-ID: <ZPnfmxqI12OsQRPA@smile.fi.intel.com> (raw)
In-Reply-To: <20230907071052.3906-4-kkartik@nvidia.com>

On Thu, Sep 07, 2023 at 12:40:49PM +0530, Kartik wrote:
> Add helper function tegra_fuse_add_lookups() to register Tegra fuse
> nvmem lookups. So, this can be shared between tegra_fuse_init() and
> ACPI probe, which is to be introduced later.

...

> +static int tegra_fuse_add_lookups(struct tegra_fuse *fuse)
> +{
> +	size_t size;
> +
> +	if (!fuse->soc->lookups)
> +		return 0;

> +	size = size_mul(sizeof(*fuse->lookups), fuse->soc->num_lookups);
> +
> +	fuse->lookups = kmemdup(fuse->soc->lookups, size, GFP_KERNEL);
> +	if (!fuse->lookups)
> +		return -ENOMEM;

Why not introducing kmemdup_array()?

> +	nvmem_add_cell_lookups(fuse->lookups, fuse->soc->num_lookups);
> +
> +	return 0;
> +}

...

> +	err = tegra_fuse_add_lookups(fuse);
> +	if (err) {
> +		pr_err("failed to add FUSE lookups\n");

Why pr_err() and not dev_err()?

> +		return err;
>  	}
>  
>  	return 0;

These four lines can be just shortened to

	return err;

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2023-09-07 15:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07  7:10 [PATCH v3 0/6] soc/tegra: fuse: Add ACPI support Kartik
2023-09-07  7:10 ` [PATCH v3 1/6] soc/tegra: fuse: Refactor resource mapping Kartik
2023-09-07 14:25   ` Andy Shevchenko
2023-09-07  7:10 ` [PATCH v3 2/6] soc/tegra: fuse: Add tegra_acpi_init_apbmisc() Kartik
2023-09-07  7:10 ` [PATCH v3 3/6] soc/tegra: fuse: Add function to add lookups Kartik
2023-09-07 14:35   ` Andy Shevchenko [this message]
2023-10-11  9:37     ` Kartik
2023-09-07  7:10 ` [PATCH v3 4/6] soc/tegra: fuse: Add function to print SKU info Kartik
2023-09-07  7:10 ` [PATCH v3 5/6] soc/tegra: fuse: Add ACPI support for Tegra194 and Tegra234 Kartik
2023-09-11 10:46   ` Andy Shevchenko
2023-10-11  9:38     ` Kartik
2023-09-07  7:10 ` [PATCH v3 6/6] soc/tegra: fuse: Add support for Tegra241 Kartik

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=ZPnfmxqI12OsQRPA@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=digetx@gmail.com \
    --cc=frank.li@vivo.com \
    --cc=jonathanh@nvidia.com \
    --cc=kkartik@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=pdeschrijver@nvidia.com \
    --cc=petlozup@nvidia.com \
    --cc=pshete@nvidia.com \
    --cc=robh@kernel.org \
    --cc=stefank@nvidia.com \
    --cc=sumitg@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=windhl@126.com \
    /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