From: Johannes Zink <j.zink@pengutronix.de>
To: barebox@lists.infradead.org
Cc: patchwork-jzi@pengutronix.de, Johannes Zink <j.zink@pengutronix.de>
Subject: [PATCH v2 2/3] imx-usb-loader: use proper return code macros
Date: Fri, 5 May 2023 17:52:47 +0200 [thread overview]
Message-ID: <20230505155248.2261867-3-j.zink@pengutronix.de> (raw)
In-Reply-To: <20230505155248.2261867-1-j.zink@pengutronix.de>
It is considered good practice to use EXIT_SUCCESS and EXIT_FAILURE
instead of hardcoding magic values.
No functional changes.
Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
---
scripts/imx/imx-usb-loader.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 17b83b611765..e49c0bea6ca4 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -1557,7 +1557,7 @@ int main(int argc, char *argv[])
break;
case 'h':
usage(argv[0]);
- exit(0);
+ exit(EXIT_SUCCESS);
case 'd':
devtype = optarg;
break;
@@ -1571,13 +1571,13 @@ int main(int argc, char *argv[])
w.do_dcd_once = 0;
break;
default:
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (devtype && strcmp(devtype, "list") == 0) {
list_imx_device_types();
- exit(0);
+ exit(EXIT_SUCCESS);
}
if (devtype && !devpath) {
@@ -1587,7 +1587,7 @@ int main(int argc, char *argv[])
if (optind == argc) {
fprintf(stderr, "no filename given\n");
usage(argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
w.plug = 1;
--
2.39.2
next prev parent reply other threads:[~2023-05-05 15:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-05 15:52 [PATCH v2 0/3] Add displaying a version number in imx-usb-loader Johannes Zink
2023-05-05 15:52 ` [PATCH v2 1/3] imx-usb-loader: exit with success when displaying help on purpose Johannes Zink
2023-05-05 15:52 ` Johannes Zink [this message]
2023-05-05 15:52 ` [PATCH v2 3/3] imx-usb-loader: add commandline option for displaying version number Johannes Zink
2023-05-09 7:22 ` [PATCH v2 0/3] Add displaying a version number in imx-usb-loader 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=20230505155248.2261867-3-j.zink@pengutronix.de \
--to=j.zink@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=patchwork-jzi@pengutronix.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