mtd: fix build with GCC 14
Also fix a couple of warnings while at it. Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
This commit is contained in:
parent
c758d6427c
commit
da0cd9d764
1 changed files with 3 additions and 2 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include <endian.h>
|
#include <endian.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <mtd/mtd-user.h>
|
#include <mtd/mtd-user.h>
|
||||||
|
@ -165,7 +166,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size)
|
||||||
size_t block_offset;
|
size_t block_offset;
|
||||||
|
|
||||||
if (quiet < 2)
|
if (quiet < 2)
|
||||||
fprintf(stderr, "Trying to fix trx header in %s at 0x%x...\n", mtd, offset);
|
fprintf(stderr, "Trying to fix trx header in %s at 0x%zx...\n", mtd, offset);
|
||||||
|
|
||||||
fd = mtd_check_open(mtd);
|
fd = mtd_check_open(mtd);
|
||||||
if(fd < 0) {
|
if(fd < 0) {
|
||||||
|
@ -246,7 +247,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size)
|
||||||
|
|
||||||
trx->crc32 = STORE32_LE(crc32buf(buf, data_size));
|
trx->crc32 = STORE32_LE(crc32buf(buf, data_size));
|
||||||
if (mtd_erase_block(fd, block_offset)) {
|
if (mtd_erase_block(fd, block_offset)) {
|
||||||
fprintf(stderr, "Can't erease block at 0x%x (%s)\n", block_offset, strerror(errno));
|
fprintf(stderr, "Can't erease block at 0x%zx (%s)\n", block_offset, strerror(errno));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue