Skip to contentSkip to conversation

Fix format strings in log messages

PATCH New Bart Van Assche 1 participant 1 message Aug 26, 2022 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix format strings in log messages

Make the argument list match the format string. Use PRIu64 for uint64_t and %zu for size_t.

---
 fsck/sload.c  | 2 +-
 lib/libf2fs.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
fsck/sload.c +1 -1
index 00c3403dace0..ae18c046d567 100644
@@ -318,7 +318,7 @@ static int configure_files(void)
 #else
 	sehnd = selinux_android_file_context_handle();
 	if (!sehnd) {
-		ERR_MSG("Failed to get android file_contexts\n", c.mount_point);
+		ERR_MSG("Failed to get android file_contexts\n");
 		return -EINVAL;
 	}
 #endif
lib/libf2fs.c +3 -3
index ecaa2e9d1ad5..f63307a42a08 100644
@@ -1046,7 +1046,7 @@ int get_device_info(int i)
 		}
 
 		if (!is_power_of_2(dev->zone_size)) {
-			MSG(0, "\tError: zoned: illegal zone size %lu (not a power of 2)\n",
+			MSG(0, "\tError: zoned: illegal zone size %" PRIu64 "u (not a power of 2)\n",
 					dev->zone_size);
 			free(stat_buf);
 			return -1;
@@ -1064,10 +1064,10 @@ int get_device_info(int i)
 		MSG(0, "Info: Host-%s zoned block device:\n",
 				(dev->zoned_model == F2FS_ZONED_HA) ?
 					"aware" : "managed");
-		MSG(0, "      %u zones, %lu zone size(bytes), %u randomly writeable zones\n",
+		MSG(0, "      %u zones, %" PRIu64 "u zone size(bytes), %u randomly writeable zones\n",
 				dev->nr_zones, dev->zone_size,
 				dev->nr_rnd_zones);
-		MSG(0, "      %lu blocks per zone\n",
+		MSG(0, "      %zu blocks per zone\n",
 				dev->zone_blocks);
 	}
 #endif

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel