lkml.org 
[lkml]   [2018]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 2/9] vsprintf: Consistent %pK handling for kptr_restrict == 0
From
Date
On Thu, 2018-04-05 at 16:46 +0200, Petr Mladek wrote:
> On Thu 2018-04-05 16:04:45, Andy Shevchenko wrote:
> > On Wed, 2018-04-04 at 10:58 +0200, Petr Mladek wrote:
> > > restricted_pointer() pretends that it prints the address when
> > > kptr_restrict
> > > is set to zero. But it is never called in this situation. Instead,
> > > pointer() falls back to ptr_to_id() and hashes the pointer.
> > >
> > > This patch removes the potential confusion. klp_restrict is
> > > checked
> > > only
> > > in restricted_pointer().
> > >
> >
> >
> > > /* Maps a pointer to a 32 bit unique identifier. */
> > > -static char *ptr_to_id(char *buf, char *end, void *ptr, struct
> > > printf_spec spec)
> > > +static char *ptr_to_id(char *buf, char *end,
> > > + const void *ptr, struct printf_spec spec)
> >
> > I don't think this change belongs to the patch.
>
> The const should have been there from the beginning. I have found it
> because this patch added a call to ptr_to_id() which had the const
> and compiler warned about cast problems.

So, why not to do a separate patch with clear intention?

> IMHO, it is rather cosmetic change.

From my experience I'm afraid of cosmetic changes in the patches which
might focus out attention on real fix.

--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

\
 
 \ /
  Last update: 2018-04-07 16:09    [W:0.092 / U:2.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site