From: Robin van der Gracht <robin@protonic.nl> To: barebox@lists.infradead.org Cc: Oleksij Rempel <o.rempel@pengutronix.de>, Robin van der Gracht <robin@protonic.nl>, david@protonic.nl Subject: [PATCH 5/9] ARM: boards: protonic-imx6: Remove unsused argument from prt_imx6_usb_mount Date: Thu, 16 Jun 2022 15:11:10 +0200 [thread overview] Message-ID: <20220616131114.214628-6-robin@protonic.nl> (raw) In-Reply-To: <20220616131114.214628-1-robin@protonic.nl> Removing this unused pointer pointer relieves the caller from freeing the memory afterwards. Signed-off-by: Robin van der Gracht <robin@protonic.nl> --- arch/arm/boards/protonic-imx6/board.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/boards/protonic-imx6/board.c b/arch/arm/boards/protonic-imx6/board.c index 7978553cb8..e67d8d2f3b 100644 --- a/arch/arm/boards/protonic-imx6/board.c +++ b/arch/arm/boards/protonic-imx6/board.c @@ -248,7 +248,7 @@ static int prt_imx6_read_i2c_mac_serial(struct prt_imx6_priv *priv) return 0; } -static int prt_imx6_usb_mount(struct prt_imx6_priv *priv, char **usbdisk) +static int prt_imx6_usb_mount(struct prt_imx6_priv *priv) { struct device_d *dev = priv->dev; const char *path; @@ -267,8 +267,6 @@ static int prt_imx6_usb_mount(struct prt_imx6_priv *priv, char **usbdisk) ret = mount(path, NULL, "usb", NULL); if (ret) goto exit_usb_mount; - - *usbdisk = strdup("disk0.0"); return 0; } @@ -278,8 +276,6 @@ static int prt_imx6_usb_mount(struct prt_imx6_priv *priv, char **usbdisk) ret = mount(path, NULL, "usb", NULL); if (ret) goto exit_usb_mount; - - *usbdisk = strdup("disk0"); return 0; } @@ -294,7 +290,7 @@ static void prt_imx6_check_usb_boot_do_work(struct work_struct *w) { struct prt_imx6_priv *priv = container_of(w, struct prt_imx6_priv, work); struct device_d *dev = priv->dev; - char *second_word, *bootsrc, *usbdisk; + char *second_word, *bootsrc; char buf[sizeof("vicut1q recovery")] = {}; unsigned int v; ssize_t size; @@ -306,7 +302,7 @@ static void prt_imx6_check_usb_boot_do_work(struct work_struct *w) usb_rescan(); - ret = prt_imx6_usb_mount(priv, &usbdisk); + ret = prt_imx6_usb_mount(priv); if (ret) return; @@ -363,12 +359,10 @@ static void prt_imx6_check_usb_boot_do_work(struct work_struct *w) if (ret) goto exit_usb_boot; - free(usbdisk); return; exit_usb_boot: dev_err(dev, "Failed to run usb boot: %s\n", strerror(-ret)); - free(usbdisk); return; } -- 2.34.1
next prev parent reply other threads:[~2022-06-16 13:12 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-16 13:11 [PATCH 0/9] ARM: boards: protonic-imx6: Updates Robin van der Gracht 2022-06-16 13:11 ` [PATCH 1/9] ARM: boards: protonic-imx6: prtvt7 hardkey inputs are active low Robin van der Gracht 2022-06-16 16:28 ` Oleksij Rempel 2022-06-16 16:38 ` Oleksij Rempel 2022-06-17 6:57 ` Sascha Hauer 2022-06-17 8:44 ` Marco Felsch 2022-06-20 7:51 ` Ahmad Fatoum 2022-06-20 8:16 ` Robin van der Gracht 2022-06-20 15:42 ` Robin van der Gracht 2022-06-20 6:48 ` Robin van der Gracht 2022-06-20 7:23 ` Oleksij Rempel 2022-06-16 13:11 ` [PATCH 2/9] ARM: boards: protonic-imx6: Update comment to match a recent code update Robin van der Gracht 2022-06-17 7:00 ` Sascha Hauer 2022-06-20 6:40 ` Robin van der Gracht 2022-06-16 13:11 ` [PATCH 3/9] ARM: boards: protonic-imx6: Free allocated autoboot_timeout string Robin van der Gracht 2022-06-16 13:11 ` [PATCH 4/9] ARM: boards: protonic-imx6: Always free allocated alias string Robin van der Gracht 2022-06-16 13:11 ` Robin van der Gracht [this message] 2022-06-16 13:11 ` [PATCH 6/9] ARM: boards: protonic-imx6: Register prt-usb boot entry Robin van der Gracht 2022-06-16 13:11 ` [PATCH 7/9] ARM: boards: protonic-imx6: Remove usb_delay from the priv struct Robin van der Gracht 2022-06-16 13:11 ` [PATCH 8/9] ARM: boards: protonic-imx6: Read serial and mac from fuses if available Robin van der Gracht 2022-06-16 13:11 ` [PATCH 9/9] ARM: boards: protonic-imx6: Register serial_number parameter with ocotp Robin van der Gracht 2022-06-17 7:10 ` (subset) [PATCH 0/9] ARM: boards: protonic-imx6: Updates Sascha Hauer
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=20220616131114.214628-6-robin@protonic.nl \ --to=robin@protonic.nl \ --cc=barebox@lists.infradead.org \ --cc=david@protonic.nl \ --cc=o.rempel@pengutronix.de \ --subject='Re: [PATCH 5/9] ARM: boards: protonic-imx6: Remove unsused argument from prt_imx6_usb_mount' \ /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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox