summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-05-12 07:49:22 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-12 09:40:58 +0200
commite7a5dceb5a81328993ebea5abdb8209357dcd75e (patch)
tree1ec5f512b07b47248ec8c76019dfc7f4c8155338 /arch/arm/mach-at91
parent109142e36aae88cec7abee1ecb6e756146d871a0 (diff)
downloadbarebox-e7a5dceb5a81328993ebea5abdb8209357dcd75e.tar.gz
barebox-e7a5dceb5a81328993ebea5abdb8209357dcd75e.tar.xz
ARM: at91: boot_test_cmd: Fix compiler warning
Use a signed type to test against negative return values from write(). While at it, reduce the scope of 'tmp'. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-at91')
-rw-r--r--arch/arm/mach-at91/boot_test_cmd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm/mach-at91/boot_test_cmd.c b/arch/arm/mach-at91/boot_test_cmd.c
index 4fd1998ad0..7bb40f2e40 100644
--- a/arch/arm/mach-at91/boot_test_cmd.c
+++ b/arch/arm/mach-at91/boot_test_cmd.c
@@ -24,7 +24,6 @@ static int do_at91_boot_test(int argc, char *argv[])
int ret = 1;
char *sram = "/dev/sram0";
u32 read_size, write_size;
- u32 tmp = 0;
while ((opt = getopt(argc, argv, "j:s:")) > 0) {
switch (opt) {
@@ -64,7 +63,7 @@ static int do_at91_boot_test(int argc, char *argv[])
}
while (write_size) {
- tmp = write(fd, buf, write_size);
+ int tmp = write(fd, buf, write_size);
if (tmp < 0) {
perror("write");
goto err_open;