Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1446025

Re: [PATCH v2 01/10] binfmt_flat: assorted cleanups

From Greg Ungerer <gerg@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 01/10] binfmt_flat: assorted cleanups
Date 2016-07-19 07:10 +0200
Message-ID <rWvs5-8aD-9@gated-at.bofh.it> (permalink)
References <rW7zs-T6-3@gated-at.bofh.it> <rW7zs-T6-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Nicolas,

On 18/07/16 13:31, Nicolas Pitre wrote:
> Remove excessive casts, do some code grouping, etc.
> No functional changes.
> 
> Signed-off-by: Nicolas Pitre <nico@linaro.org>
> ---
>  fs/binfmt_flat.c | 118 ++++++++++++++++++++++++++-----------------------------
>  1 file changed, 56 insertions(+), 62 deletions(-)
> 
> diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c
> index caf9e39bb8..085059d879 100644
> --- a/fs/binfmt_flat.c
> +++ b/fs/binfmt_flat.c
> @@ -80,7 +80,7 @@ struct lib_info {
>  		unsigned long text_len;			/* Length of text segment */
>  		unsigned long entry;			/* Start address for this module */
>  		unsigned long build_date;		/* When this one was compiled */
> -		short loaded;				/* Has this library been loaded? */
> +		bool loaded;				/* Has this library been loaded? */
>  	} lib_list[MAX_SHARED_LIBS];
>  };
>  
> @@ -107,7 +107,7 @@ static struct linux_binfmt flat_format = {
>  static int flat_core_dump(struct coredump_params *cprm)
>  {
>  	printk("Process %s:%d received signr %d and should have core dumped\n",
> -			current->comm, current->pid, (int) cprm->siginfo->si_signo);
> +			current->comm, current->pid, cprm->siginfo->si_signo);
>  	return(1);
>  }
>  
> @@ -190,7 +190,7 @@ static int decompress_exec(
>  	loff_t fpos;
>  	int ret, retval;
>  
> -	DBG_FLT("decompress_exec(offset=%x,buf=%x,len=%x)\n",(int)offset, (int)dst, (int)len);
> +	DBG_FLT("decompress_exec(offset=%lx,buf=%p,len=%lx)\n",offset, dst, len);
>  
>  	memset(&strm, 0, sizeof(strm));
>  	strm.workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
> @@ -358,8 +358,8 @@ calc_reloc(unsigned long r, struct lib_info *p, int curid, int internalp)
>  	text_len = p->lib_list[id].text_len;
>  
>  	if (!flat_reloc_valid(r, start_brk - start_data + text_len)) {
> -		printk("BINFMT_FLAT: reloc outside program 0x%x (0 - 0x%x/0x%x)",
> -		       (int) r,(int)(start_brk-start_data+text_len),(int)text_len);
> +		printk("BINFMT_FLAT: reloc outside program 0x%lx (0 - 0x%lx/0x%lx)",
> +		       r, start_brk-start_data+text_len, text_len);

Seeing as you have modified quite a few printk calls is it worth
while annotating them with appropriate KERN_ERR, KERN_INFO, etc?
Just a thought.

Regards
Greg

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PULL REQUEST] [PATCH v2 00/10] allow BFLT executables on systems with a MMU Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:40 +0200
  [PATCH v2 07/10] binfmt_flat: use clear_user() rather than memset() to clear .bss Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:40 +0200
  [PATCH v2 02/10] elf_fdpic_transfer_args_to_stack(): make it generic Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:40 +0200
  [PATCH v2 03/10] binfmt_flat: use generic transfer_args_to_stack() Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:40 +0200
  [PATCH v2 06/10] binfmt_flat: use proper user space accessors with old relocs code Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:40 +0200
  [PATCH v2 01/10] binfmt_flat: assorted cleanups Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:40 +0200
    Re: [PATCH v2 01/10] binfmt_flat: assorted cleanups Greg Ungerer <gerg@linux-m68k.org> - 2016-07-19 07:10 +0200
      Re: [PATCH v2 01/10] binfmt_flat: assorted cleanups Geert Uytterhoeven <geert@linux-m68k.org> - 2016-07-19 08:50 +0200
        Re: [PATCH v2 01/10] binfmt_flat: assorted cleanups Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-20 06:20 +0200
          Re: [PATCH v2 01/10] binfmt_flat: assorted cleanups Geert Uytterhoeven <geert@linux-m68k.org> - 2016-07-20 09:00 +0200
            Re: [PATCH v2 01/10] binfmt_flat: assorted cleanups Greg Ungerer <gerg@linux-m68k.org> - 2016-07-20 09:20 +0200
  [PATCH v2 09/10] binfmt_flat: add MMU-specific support Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:50 +0200
  [PATCH v2 04/10] binfmt_flat: clean up create_flat_tables() and stack accesses Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:50 +0200
  [PATCH v2 08/10] binfmt_flat: update libraries' data segment pointer with userspace accessors Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-07-18 05:50 +0200
  Re: [PULL REQUEST] [PATCH v2 00/10] allow BFLT executables on systems  with a MMU Greg Ungerer <gerg@linux-m68k.org> - 2016-07-19 09:30 +0200

csiph-web