diff mbox series

modpost: Join broken long printed messages

Message ID d7365c44c13b563e9576cf23bd68d64e5ea57f6f.1668000538.git.geert+renesas@glider.be (mailing list archive)
State New, archived
Headers show
Series modpost: Join broken long printed messages | expand

Commit Message

Geert Uytterhoeven Nov. 9, 2022, 1:30 p.m. UTC
Breaking long printed messages in multiple lines makes it very hard to
look up where they originated from.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 scripts/mod/file2alias.c | 18 +++++++-----------
 scripts/mod/modpost.c    |  8 +++-----
 2 files changed, 10 insertions(+), 16 deletions(-)

Comments

Nicolas Schier Nov. 9, 2022, 8:40 p.m. UTC | #1
On Wed 09 Nov 2022 14:30:55 GMT Geert Uytterhoeven wrote:
> Breaking long printed messages in multiple lines makes it very hard to
> look up where they originated from.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---

thanks, I do appreciate such changes!

Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>

>  scripts/mod/file2alias.c | 18 +++++++-----------
>  scripts/mod/modpost.c    |  8 +++-----
>  2 files changed, 10 insertions(+), 16 deletions(-)
> 
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 80d973144fded3b1..7df23905fdf1cb36 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -140,25 +140,22 @@ static void device_id_check(const char *modname, const char *device_id,
>  	int i;
>  
>  	if (size % id_size || size < id_size) {
> -		fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
> -		      "of the size of "
> -		      "section __mod_%s__<identifier>_device_table=%lu.\n"
> -		      "Fix definition of struct %s_device_id "
> -		      "in mod_devicetable.h\n",
> +		fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo of the size of section __mod_%s__<identifier>_device_table=%lu.\n"
> +		      "Fix definition of struct %s_device_id in mod_devicetable.h\n",
>  		      modname, device_id, id_size, device_id, size, device_id);
>  	}
>  	/* Verify last one is a terminator */
>  	for (i = 0; i < id_size; i++ ) {
>  		if (*(uint8_t*)(symval+size-id_size+i)) {
> -			fprintf(stderr,"%s: struct %s_device_id is %lu bytes.  "
> -				"The last of %lu is:\n",
> +			fprintf(stderr,
> +				"%s: struct %s_device_id is %lu bytes.  The last of %lu is:\n",
>  				modname, device_id, id_size, size / id_size);
>  			for (i = 0; i < id_size; i++ )
>  				fprintf(stderr,"0x%02x ",
>  					*(uint8_t*)(symval+size-id_size+i) );
>  			fprintf(stderr,"\n");
> -			fatal("%s: struct %s_device_id is not terminated "
> -				"with a NULL entry!\n", modname, device_id);
> +			fatal("%s: struct %s_device_id is not terminated with a NULL entry!\n",
> +			      modname, device_id);
>  		}
>  	}
>  }
> @@ -1154,8 +1151,7 @@ static int do_amba_entry(const char *filename,
>  	DEF_FIELD(symval, amba_id, mask);
>  
>  	if ((id & mask) != id)
> -		fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: "
> -		      "id=0x%08X, mask=0x%08X.  Please fix this driver.\n",
> +		fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: id=0x%08X, mask=0x%08X.  Please fix this driver.\n",
>  		      filename, id, mask);
>  
>  	p += sprintf(alias, "amba:d");
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 2c80da0220c326ef..56d856f2e5115150 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -519,9 +519,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
>  		int nobits = sechdrs[i].sh_type == SHT_NOBITS;
>  
>  		if (!nobits && sechdrs[i].sh_offset > info->size) {
> -			fatal("%s is truncated. sechdrs[i].sh_offset=%lu > "
> -			      "sizeof(*hrd)=%zu\n", filename,
> -			      (unsigned long)sechdrs[i].sh_offset,
> +			fatal("%s is truncated. sechdrs[i].sh_offset=%lu > sizeof(*hrd)=%zu\n",
> +			      filename, (unsigned long)sechdrs[i].sh_offset,
>  			      sizeof(*hdr));
>  			return 0;
>  		}
> @@ -1355,8 +1354,7 @@ static void report_extable_warnings(const char* modname, struct elf_info* elf,
>  	get_pretty_name(is_function(tosym),
>  			&to_pretty_name, &to_pretty_name_p);
>  
> -	warn("%s(%s+0x%lx): Section mismatch in reference"
> -	     " from the %s %s%s to the %s %s:%s%s\n",
> +	warn("%s(%s+0x%lx): Section mismatch in reference from the %s %s%s to the %s %s:%s%s\n",
>  	     modname, fromsec, (long)r->r_offset, from_pretty_name,
>  	     fromsym_name, from_pretty_name_p,
>  	     to_pretty_name, tosec, tosym_name, to_pretty_name_p);
> -- 
> 2.25.1
Masahiro Yamada Nov. 13, 2022, 10:51 a.m. UTC | #2
On Thu, Nov 10, 2022 at 5:47 AM Nicolas Schier <nicolas@fjasle.eu> wrote:
>
> On Wed 09 Nov 2022 14:30:55 GMT Geert Uytterhoeven wrote:
> > Breaking long printed messages in multiple lines makes it very hard to
> > look up where they originated from.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
>
> thanks, I do appreciate such changes!
>
> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>


Applied to linux-kbuild.
Thanks.

>
> >  scripts/mod/file2alias.c | 18 +++++++-----------
> >  scripts/mod/modpost.c    |  8 +++-----
> >  2 files changed, 10 insertions(+), 16 deletions(-)
> >
> > diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> > index 80d973144fded3b1..7df23905fdf1cb36 100644
> > --- a/scripts/mod/file2alias.c
> > +++ b/scripts/mod/file2alias.c
> > @@ -140,25 +140,22 @@ static void device_id_check(const char *modname, const char *device_id,
> >       int i;
> >
> >       if (size % id_size || size < id_size) {
> > -             fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
> > -                   "of the size of "
> > -                   "section __mod_%s__<identifier>_device_table=%lu.\n"
> > -                   "Fix definition of struct %s_device_id "
> > -                   "in mod_devicetable.h\n",
> > +             fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo of the size of section __mod_%s__<identifier>_device_table=%lu.\n"
> > +                   "Fix definition of struct %s_device_id in mod_devicetable.h\n",
> >                     modname, device_id, id_size, device_id, size, device_id);
> >       }
> >       /* Verify last one is a terminator */
> >       for (i = 0; i < id_size; i++ ) {
> >               if (*(uint8_t*)(symval+size-id_size+i)) {
> > -                     fprintf(stderr,"%s: struct %s_device_id is %lu bytes.  "
> > -                             "The last of %lu is:\n",
> > +                     fprintf(stderr,
> > +                             "%s: struct %s_device_id is %lu bytes.  The last of %lu is:\n",
> >                               modname, device_id, id_size, size / id_size);
> >                       for (i = 0; i < id_size; i++ )
> >                               fprintf(stderr,"0x%02x ",
> >                                       *(uint8_t*)(symval+size-id_size+i) );
> >                       fprintf(stderr,"\n");
> > -                     fatal("%s: struct %s_device_id is not terminated "
> > -                             "with a NULL entry!\n", modname, device_id);
> > +                     fatal("%s: struct %s_device_id is not terminated with a NULL entry!\n",
> > +                           modname, device_id);
> >               }
> >       }
> >  }
> > @@ -1154,8 +1151,7 @@ static int do_amba_entry(const char *filename,
> >       DEF_FIELD(symval, amba_id, mask);
> >
> >       if ((id & mask) != id)
> > -             fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: "
> > -                   "id=0x%08X, mask=0x%08X.  Please fix this driver.\n",
> > +             fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: id=0x%08X, mask=0x%08X.  Please fix this driver.\n",
> >                     filename, id, mask);
> >
> >       p += sprintf(alias, "amba:d");
> > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> > index 2c80da0220c326ef..56d856f2e5115150 100644
> > --- a/scripts/mod/modpost.c
> > +++ b/scripts/mod/modpost.c
> > @@ -519,9 +519,8 @@ static int parse_elf(struct elf_info *info, const char *filename)
> >               int nobits = sechdrs[i].sh_type == SHT_NOBITS;
> >
> >               if (!nobits && sechdrs[i].sh_offset > info->size) {
> > -                     fatal("%s is truncated. sechdrs[i].sh_offset=%lu > "
> > -                           "sizeof(*hrd)=%zu\n", filename,
> > -                           (unsigned long)sechdrs[i].sh_offset,
> > +                     fatal("%s is truncated. sechdrs[i].sh_offset=%lu > sizeof(*hrd)=%zu\n",
> > +                           filename, (unsigned long)sechdrs[i].sh_offset,
> >                             sizeof(*hdr));
> >                       return 0;
> >               }
> > @@ -1355,8 +1354,7 @@ static void report_extable_warnings(const char* modname, struct elf_info* elf,
> >       get_pretty_name(is_function(tosym),
> >                       &to_pretty_name, &to_pretty_name_p);
> >
> > -     warn("%s(%s+0x%lx): Section mismatch in reference"
> > -          " from the %s %s%s to the %s %s:%s%s\n",
> > +     warn("%s(%s+0x%lx): Section mismatch in reference from the %s %s%s to the %s %s:%s%s\n",
> >            modname, fromsec, (long)r->r_offset, from_pretty_name,
> >            fromsym_name, from_pretty_name_p,
> >            to_pretty_name, tosec, tosym_name, to_pretty_name_p);
> > --
> > 2.25.1
>
> --
> epost|xmpp: nicolas@fjasle.eu          irc://oftc.net/nsc
> ↳ gpg: 18ed 52db e34f 860e e9fb  c82b 7d97 0932 55a0 ce7f
>      -- frykten for herren er opphav til kunnskap --
diff mbox series

Patch

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 80d973144fded3b1..7df23905fdf1cb36 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -140,25 +140,22 @@  static void device_id_check(const char *modname, const char *device_id,
 	int i;
 
 	if (size % id_size || size < id_size) {
-		fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "
-		      "of the size of "
-		      "section __mod_%s__<identifier>_device_table=%lu.\n"
-		      "Fix definition of struct %s_device_id "
-		      "in mod_devicetable.h\n",
+		fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo of the size of section __mod_%s__<identifier>_device_table=%lu.\n"
+		      "Fix definition of struct %s_device_id in mod_devicetable.h\n",
 		      modname, device_id, id_size, device_id, size, device_id);
 	}
 	/* Verify last one is a terminator */
 	for (i = 0; i < id_size; i++ ) {
 		if (*(uint8_t*)(symval+size-id_size+i)) {
-			fprintf(stderr,"%s: struct %s_device_id is %lu bytes.  "
-				"The last of %lu is:\n",
+			fprintf(stderr,
+				"%s: struct %s_device_id is %lu bytes.  The last of %lu is:\n",
 				modname, device_id, id_size, size / id_size);
 			for (i = 0; i < id_size; i++ )
 				fprintf(stderr,"0x%02x ",
 					*(uint8_t*)(symval+size-id_size+i) );
 			fprintf(stderr,"\n");
-			fatal("%s: struct %s_device_id is not terminated "
-				"with a NULL entry!\n", modname, device_id);
+			fatal("%s: struct %s_device_id is not terminated with a NULL entry!\n",
+			      modname, device_id);
 		}
 	}
 }
@@ -1154,8 +1151,7 @@  static int do_amba_entry(const char *filename,
 	DEF_FIELD(symval, amba_id, mask);
 
 	if ((id & mask) != id)
-		fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: "
-		      "id=0x%08X, mask=0x%08X.  Please fix this driver.\n",
+		fatal("%s: Masked-off bit(s) of AMBA device ID are non-zero: id=0x%08X, mask=0x%08X.  Please fix this driver.\n",
 		      filename, id, mask);
 
 	p += sprintf(alias, "amba:d");
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 2c80da0220c326ef..56d856f2e5115150 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -519,9 +519,8 @@  static int parse_elf(struct elf_info *info, const char *filename)
 		int nobits = sechdrs[i].sh_type == SHT_NOBITS;
 
 		if (!nobits && sechdrs[i].sh_offset > info->size) {
-			fatal("%s is truncated. sechdrs[i].sh_offset=%lu > "
-			      "sizeof(*hrd)=%zu\n", filename,
-			      (unsigned long)sechdrs[i].sh_offset,
+			fatal("%s is truncated. sechdrs[i].sh_offset=%lu > sizeof(*hrd)=%zu\n",
+			      filename, (unsigned long)sechdrs[i].sh_offset,
 			      sizeof(*hdr));
 			return 0;
 		}
@@ -1355,8 +1354,7 @@  static void report_extable_warnings(const char* modname, struct elf_info* elf,
 	get_pretty_name(is_function(tosym),
 			&to_pretty_name, &to_pretty_name_p);
 
-	warn("%s(%s+0x%lx): Section mismatch in reference"
-	     " from the %s %s%s to the %s %s:%s%s\n",
+	warn("%s(%s+0x%lx): Section mismatch in reference from the %s %s%s to the %s %s:%s%s\n",
 	     modname, fromsec, (long)r->r_offset, from_pretty_name,
 	     fromsym_name, from_pretty_name_p,
 	     to_pretty_name, tosec, tosym_name, to_pretty_name_p);