FROMGIT: modpost: zero-pad CRC values in modversion_info array

I do not think the '#' flag is useful here because adding the explicit
'0x' is clearer. Add the '0' flag to zero-pad the CRC values.

This change gives better alignment in the generated *.mod.c files.
There is no impact to the compiled modules.

[Before]

  $ grep -A5 modversion_info fs/efivarfs/efivarfs.mod.c
  static const struct modversion_info ____versions[]
  __used __section("__versions") = {
          { 0x907d14d, "blocking_notifier_chain_register" },
          { 0x53d3b64, "simple_inode_init_ts" },
          { 0x65487097, "__x86_indirect_thunk_rax" },
          { 0x122c3a7e, "_printk" },

[After]

  $ grep -A5 modversion_info fs/efivarfs/efivarfs.mod.c
  static const struct modversion_info ____versions[]
  __used __section("__versions") = {
          { 0x0907d14d, "blocking_notifier_chain_register" },
          { 0x053d3b64, "simple_inode_init_ts" },
          { 0x65487097, "__x86_indirect_thunk_rax" },
          { 0x122c3a7e, "_printk" },

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
(cherry picked from commit 5963913bb57f15f198361bc7f1389c756b98f25f
 https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Bug: 347787665
Signed-off-by: Matthew Maurer <mmaurer@google.com>

Change-Id: Iefee024610d56836cb3ddb65e1417954c7dabd2d
Signed-off-by: Matthew Maurer <mmaurer@google.com>
This commit is contained in:
Masahiro Yamada
2024-12-29 00:45:29 +09:00
committed by Giuliano Procida
parent 5134a9e0d7
commit 28a494a675
+1 -1
View File
@@ -1850,7 +1850,7 @@ static void add_versions(struct buffer *b, struct module *mod)
s->name, mod->name);
break;
}
buf_printf(b, "\t{ %#8x, \"%s\" },\n",
buf_printf(b, "\t{ 0x%08x, \"%s\" },\n",
s->crc, s->name);
}