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] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZPnfmxqI12OsQRPA@smile.fi.intel.com>
Date:   Thu, 7 Sep 2023 17:35:07 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Kartik <kkartik@...dia.com>
Cc:     thierry.reding@...il.com, jonathanh@...dia.com, sumitg@...dia.com,
        arnd@...db.de, pshete@...dia.com, digetx@...il.com,
        petlozup@...dia.com, windhl@....com, frank.li@...o.com,
        robh@...nel.org, stefank@...dia.com, pdeschrijver@...dia.com,
        linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 3/6] soc/tegra: fuse: Add function to add lookups

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ