Share "NO NAME " string

function                                             old     new   delta
bb_NO_NAME_11                                          -      12     +12
static.NO_NAME_11                                     12       -     -12
.rodata                                           104906  104894     -12
------------------------------------------------------------------------------
(add/remove: 1/1 grow/shrink: 0/1 up/down: 12/-24)            Total: -12 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko committed 2026-11-09 23:43:17 +01:00
1 parent d04e804bee
commit 8015168a75
4 files changed
+10 -8

No files matched your search

+2 -1
View File
@@ -2489,7 +2489,8 @@ extern const char bb_PATH_root_path[] ALIGN1; /* BB_PATH_ROOT_PATH */
/* Stored without terminating NUL */
extern const char bb_SWAPSPACE2[sizeof("SWAPSPACE2")-1];
/* Stored with terminating NUL */
extern const char bb_NO_NAME_11[sizeof("NO NAME ")];
extern const int const_int_0;
//extern const int const_int_1;
+4 -1
View File
@@ -37,7 +37,10 @@ const char bb_PATH_root_path[] ALIGN1 = BB_PATH_ROOT_PATH;
/* Stored without terminating NUL */
const char bb_SWAPSPACE2[sizeof("SWAPSPACE2")-1] ALIGN1 = "SWAPSPACE2";
#endif
#if ENABLE_MKDOSFS || ENABLE_MKFS_VFAT || ENABLE_FEATURE_VOLUMEID_FAT
/* Stored with terminating NUL */
const char bb_NO_NAME_11[] = "NO NAME ";
#endif
//const int const_int_1 = 1;
/* explicitly = 0, otherwise gcc may make it a common variable
+2 -4
View File
@@ -218,10 +218,8 @@ static const char boot_code[] ALIGN1 =
int mkfs_vfat_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int mkfs_vfat_main(int argc UNUSED_PARAM, char **argv)
{
static const char NO_NAME_11[] = "NO NAME ";
struct stat st;
const char *arg_volume_label = NO_NAME_11; //default
const char *arg_volume_label = bb_NO_NAME_11; //default
char volume_label11[12];
char *buf;
char *device_name;
@@ -555,7 +553,7 @@ int mkfs_vfat_main(int argc UNUSED_PARAM, char **argv)
// not "NO NAME", "NO NAME " etc?
// (mkfs.fat 4.1 won't create dir entry even with explicit -n 'NO NAME',
// but will create one with e.g. -n '', -n ' zZz')
if (strcmp(volume_label11, NO_NAME_11) != 0) {
if (strcmp(volume_label11, bb_NO_NAME_11) != 0) {
// create dir entry for volume label
struct msdos_dir_entry *de;
#if 0
+2 -2
View File
@@ -280,7 +280,7 @@ int FAST_FUNC volume_id_probe_vfat(struct volume_id *id /*,uint64_t fat_partitio
return -1; /* FAT12/16 uses 16-bit field for FAT sector count, FAT32 uses vs->type.fat32.fat_sct32 */
/* String "NO NAME" has a special meaning (empty label) only for label stored in boot sector */
if (memcmp(vs->type.fat.label, "NO NAME ", 11) != 0) {
if (memcmp(vs->type.fat.label, bb_NO_NAME_11, 11) != 0) {
// volume_id_set_label_raw(id, vs->type.fat.label, 11);
volume_id_set_label_string(id, vs->type.fat.label, 11);
}
@@ -310,7 +310,7 @@ int FAST_FUNC volume_id_probe_vfat(struct volume_id *id /*,uint64_t fat_partitio
// return -1;
/* String "NO NAME" has a special meaning (empty label) only for label stored in boot sector */
if (memcmp(vs->type.fat32.label, "NO NAME ", 11) != 0) {
if (memcmp(vs->type.fat32.label, bb_NO_NAME_11, 11) != 0) {
// volume_id_set_label_raw(id, vs->type.fat32.label, 11);
volume_id_set_label_string(id, vs->type.fat32.label, 11);
}