From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] dmaengine: imx-sdma: sdma_get_firmware does not need to copy fw_name
Date: Mon, 5 Sep 2011 11:20:35 +0200 [thread overview]
Message-ID: <20110905092035.GC19678@pengutronix.de> (raw)
In-Reply-To: <1310723066-567-3-git-send-email-shawn.guo@linaro.org>
On Fri, Jul 15, 2011 at 05:44:25PM +0800, Shawn Guo wrote:
> It does not need to allocate space and copy fw_name in function
> sdma_get_firmware().
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
(appointed to act for Sascha who is on vacation)
Thanks
Uwe
> ---
> drivers/dma/imx-sdma.c | 12 ++----------
> 1 files changed, 2 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index 4a7aa72..6b839a2 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1125,22 +1125,14 @@ static int __init sdma_get_firmware(struct sdma_engine *sdma,
> const char *fw_name)
> {
> const struct firmware *fw;
> - char *fwname;
> const struct sdma_firmware_header *header;
> int ret;
> const struct sdma_script_start_addrs *addr;
> unsigned short *ram_code;
>
> - fwname = kasprintf(GFP_KERNEL, "%s", fw_name);
> - if (!fwname)
> - return -ENOMEM;
> -
> - ret = request_firmware(&fw, fwname, sdma->dev);
> - if (ret) {
> - kfree(fwname);
> + ret = request_firmware(&fw, fw_name, sdma->dev);
> + if (ret)
> return ret;
> - }
> - kfree(fwname);
>
> if (fw->size < sizeof(*header))
> goto err_firmware;
> --
> 1.7.4.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2011-09-05 9:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 9:44 [PATCH v2 0/3] Add device tree probe for imx-sdma driver Shawn Guo
2011-07-15 9:44 ` [PATCH v2 1/3] dmaengine: imx-sdma: use platform_device_id to identify sdma version Shawn Guo
2011-09-05 9:16 ` Uwe Kleine-König
2011-07-15 9:44 ` [PATCH v2 2/3] dmaengine: imx-sdma: sdma_get_firmware does not need to copy fw_name Shawn Guo
2011-09-05 9:20 ` Uwe Kleine-König [this message]
2011-07-15 9:44 ` [PATCH v2 3/3] dmaengine: imx-sdma: add device tree probe support Shawn Guo
2011-08-04 3:57 ` Koul, Vinod
2011-08-25 13:37 ` Koul, Vinod
2011-08-30 1:45 ` Shawn Guo
2011-09-05 9:24 ` Uwe Kleine-König
2011-07-22 3:54 ` [PATCH v2 0/3] Add device tree probe for imx-sdma driver Shawn Guo
2011-07-25 11:41 ` Vinod Koul
2011-07-25 15:19 ` Shawn Guo
2011-08-04 3:59 ` Koul, Vinod
2011-08-04 5:35 ` Shawn Guo
2011-08-04 5:28 ` Koul, Vinod
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=20110905092035.GC19678@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).