From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/2] common: Generic firmware loader for file system
Date: Mon, 11 Dec 2017 13:16:56 +0100 [thread overview]
Message-ID: <20171211131656.5466c9e5@karo-electronics.de> (raw)
In-Reply-To: <1512989626-4303-3-git-send-email-tien.fong.chee@intel.com>
Hi,
On Mon, 11 Dec 2017 18:53:46 +0800 tien.fong.chee at intel.com wrote:
> From: Tien Fong Chee <tien.fong.chee@intel.com>
>
[...}
> +/*
> + * Prepare firmware struct;
> + * return -ve if fail.
> + */
> +static int _request_firmware_prepare(struct firmware **firmware_p,
> + const char *name, void *dbuf,
> + size_t size, u32 offset)
> +{
> + struct firmware *firmware = NULL;
> + int ret = 0;
> +
> + *firmware_p = NULL;
>
Sigh. This is useless...
> + if (!name || name[0] == '\0')
> + ret = -EINVAL;
> +
unless you do a 'return -EINVAL' here!
> + *firmware_p = firmware = calloc(1, sizeof(*firmware));
> +
> + if (!firmware) {
> + printf("%s: calloc(struct firmware) failed\n", __func__);
> + return -ENOMEM;
> + }
> +
> + firmware->name = name;
> + firmware->data = dbuf;
> + firmware->size = size;
> + firmware->offset = offset;
> +
> + return ret;
> +}
> +
Lothar Waßmann
next prev parent reply other threads:[~2017-12-11 12:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-11 10:53 [U-Boot] [PATCH 0/2] Generic firmware loader tien.fong.chee at intel.com
2017-12-11 10:53 ` [U-Boot] [PATCH 1/2] arm: socfpga: Remove static declaration on spl_mmc_find_device function tien.fong.chee at intel.com
2017-12-11 11:03 ` Marek Vasut
2017-12-12 4:49 ` Chee, Tien Fong
2017-12-11 10:53 ` [U-Boot] [PATCH 2/2] common: Generic firmware loader for file system tien.fong.chee at intel.com
2017-12-11 12:16 ` Lothar Waßmann [this message]
2017-12-12 4:51 ` Chee, Tien Fong
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=20171211131656.5466c9e5@karo-electronics.de \
--to=lw@karo-electronics.de \
--cc=u-boot@lists.denx.de \
/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