From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752413AbcGSFBM (ORCPT ); Tue, 19 Jul 2016 01:01:12 -0400 Received: from icp-osb-irony-out4.external.iinet.net.au ([203.59.1.220]:40261 "EHLO icp-osb-irony-out4.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbcGSFAt (ORCPT ); Tue, 19 Jul 2016 01:00:49 -0400 X-Greylist: delayed 560 seconds by postgrey-1.27 at vger.kernel.org; Tue, 19 Jul 2016 01:00:49 EDT X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AAAgCVsI1X/zXSMGcNThsBAQGEIVKNKpZKBpJegg+BeoYaAoFyFAEBAQEBAQGFaQEBAQMnUhALDQsuVwYBDAYCAQG3H452AQEBAQEBAQEBAQEBAQEBASGFYoJACIJNihsFiB+RBAGYRoVQSI9WHoJBHIFeXIgQAQEB X-IPAS-Result: A2AAAgCVsI1X/zXSMGcNThsBAQGEIVKNKpZKBpJegg+BeoYaAoFyFAEBAQEBAQGFaQEBAQMnUhALDQsuVwYBDAYCAQG3H452AQEBAQEBAQEBAQEBAQEBASGFYoJACIJNihsFiB+RBAGYRoVQSI9WHoJBHIFeXIgQAQEB X-IronPort-AV: E=Sophos;i="5.28,387,1464624000"; d="scan'208";a="103412701" Subject: Re: [PATCH v2 01/10] binfmt_flat: assorted cleanups To: Nicolas Pitre , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <1468812716-30537-1-git-send-email-nicolas.pitre@linaro.org> <1468812716-30537-2-git-send-email-nicolas.pitre@linaro.org> Cc: Alexander Viro , David Howells From: Greg Ungerer Message-ID: Date: Tue, 19 Jul 2016 14:52:24 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1468812716-30537-2-git-send-email-nicolas.pitre@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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