From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQuYk-0006M4-GI for barebox@lists.infradead.org; Thu, 07 Jun 2018 13:02:39 +0000 Received: by mail-pl0-x241.google.com with SMTP id w17-v6so6106545pll.9 for ; Thu, 07 Jun 2018 06:02:24 -0700 (PDT) From: Andrey Smirnov Date: Thu, 7 Jun 2018 06:01:04 -0700 Message-Id: <20180607130108.5339-49-andrew.smirnov@gmail.com> In-Reply-To: <20180607130108.5339-1-andrew.smirnov@gmail.com> References: <20180607130108.5339-1-andrew.smirnov@gmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [RESEND v3 48/52] scripts: imx-image: Drop error return from write_dcd() To: barebox@lists.infradead.org Cc: Andrey Smirnov Write_dcd() exits early in case of failure, so there's no realy reason to have it return a error code as a result. Drop it and simplify the caller code. Signed-off-by: Andrey Smirnov --- scripts/imx/imx-image.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index b241e8c4b..a8a26e0ee 100644 --- a/scripts/imx/imx-image.c +++ b/scripts/imx/imx-image.c @@ -427,7 +427,7 @@ static int xwrite(int fd, void *buf, int len) return 0; } -static int write_dcd(const char *outfile) +static void write_dcd(const char *outfile) { int outfd, ret; int dcdsize = curdcd * sizeof(uint32_t); @@ -443,8 +443,6 @@ static int write_dcd(const char *outfile) perror("write"); exit(1); } - - return 0; } static int check(const struct config_data *data, uint32_t cmd, uint32_t addr, @@ -778,10 +776,8 @@ int main(int argc, char *argv[]) check_last_dcd(0); if (dcd_only) { - ret = write_dcd(data.outfile); - if (ret) - exit(1); - exit (0); + write_dcd(data.outfile); + exit(0); } switch (data.header_version) { -- 2.17.0 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox