treewide: strip trailing whitespace

Strip trailing whitespace in all code:
find . -type f | grep "\.c$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.h$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dts$" | xargs sed -i 's/[ \t]\+$//'
find . -type f | grep "\.dtsi$" | xargs sed -i 's/[ \t]\+$//'

Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/18626
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Mieczyslaw Nalewaj
2025-05-19 14:27:36 +02:00
committed by Robert Marko
parent 6b43a52171
commit a238170e57
138 changed files with 1965 additions and 1965 deletions

View File

@@ -139,7 +139,7 @@ static uint32_t strntoul(char *str, char **endptr, int base, size_t len) {
newstr = calloc(len + 1, sizeof(char));
if (newstr) {
strncpy(newstr, str, len);
strncpy(newstr, str, len);
res = strtoul(newstr, endptr, base);
free(newstr);
}
@@ -258,7 +258,7 @@ trx_check(int imagefd, const char *mtd, char *buf, int *len)
}
headerCRC = crc32buf(buf, offsetof(struct bcm_tag, header_crc));
if (*(uint32_t *)(&tag->header_crc) != headerCRC) {
if (quiet < 2) {
fprintf(stderr, "Bad header CRC got %08x, calculated %08x\n",
*(uint32_t *)(&tag->header_crc), headerCRC);
@@ -276,7 +276,7 @@ trx_check(int imagefd, const char *mtd, char *buf, int *len)
}
imageLen = strntoul(&tag->total_length[0], NULL, 10, IMAGE_LEN);
if(mtdsize < imageLen) {
fprintf(stderr, "Image too big for partition: %s\n", mtd);
close(fd);
@@ -355,7 +355,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size)
rootfslen = strntoul(&tag->root_length[0], NULL, 10, IMAGE_LEN);
if (rootfslen == 0) {
if (quiet < 2)
if (quiet < 2)
fprintf(stderr, "Header already fixed, exiting\n");
close(fd);
return 0;
@@ -390,9 +390,9 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size)
}
if (quiet < 2) {
fprintf(stderr, "New image crc32: 0x%x, rewriting block\n",
fprintf(stderr, "New image crc32: 0x%x, rewriting block\n",
*(uint32_t *)(&tag->image_crc));
fprintf(stderr, "New header crc32: 0x%x, rewriting block\n", headercrc);
fprintf(stderr, "New header crc32: 0x%x, rewriting block\n", headercrc);
}
if (pwrite(fd, buf, erasesize, block_offset) != erasesize) {

View File

@@ -293,7 +293,7 @@ int mtd_write_jffs2(const char *mtd, const char *filename, const char *dir)
if (quiet < 2)
fprintf(stderr, "Appending %s to jffs2 partition %s\n", filename, mtd);
buf = malloc(erasesize);
if (!buf) {
fprintf(stderr, "Out of memory!\n");

View File

@@ -16,7 +16,7 @@
#define JFFS2_SUPER_MAGIC 0x72b6
/* You must include something which defines the C99 uintXX_t types.
/* You must include something which defines the C99 uintXX_t types.
We don't do it from here because this file is used in too many
different environments. */