From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754146AbcA0MSl (ORCPT ); Wed, 27 Jan 2016 07:18:41 -0500 Received: from mga14.intel.com ([192.55.52.115]:13601 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043AbcA0MSk (ORCPT ); Wed, 27 Jan 2016 07:18:40 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,354,1449561600"; d="scan'208";a="642160400" Message-ID: <1453897153.2521.240.camel@linux.intel.com> Subject: Re: [PATCH v1 1/1] lib/vsprintf: define special_hex_number_unsigned_long() From: Andy Shevchenko To: Andrew Morton Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org Date: Wed, 27 Jan 2016 14:19:13 +0200 In-Reply-To: <20160126204446.8757302d.akpm@linux-foundation.org> References: <1452774889-84863-1-git-send-email-andriy.shevchenko@linux.intel.com> <20160126204446.8757302d.akpm@linux-foundation.org> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-01-26 at 20:44 -0800, Andrew Morton wrote: > On Thu, 14 Jan 2016 14:34:49 +0200 Andy Shevchenko @linux.intel.com> wrote: > > > Define a macro for convenient use with values of unsigned long > > type. > > > > The value in symbol_string() is type of unsigned long. Use it > > instead of void * > > when getting sizeof() of it. > > > > ... > > > > --- a/lib/vsprintf.c > > +++ b/lib/vsprintf.c > > @@ -529,6 +529,9 @@ char *special_hex_number(char *buf, char *end, > > unsigned long long num, int size) > >   return number(buf, end, num, spec); > >  } > >   > > +#define special_hex_number_unsigned_long(buf, end, n) \ > > + special_hex_number(buf, end, (unsigned long)n, > > sizeof(unsigned long)) > > + > >  static void move_right(char *buf, char *end, unsigned len, > > unsigned spaces) > >  { > >   size_t size; > > @@ -684,7 +687,7 @@ char *symbol_string(char *buf, char *end, void > > *ptr, > >   > >   return string(buf, end, sym, spec); > >  #else > > - return special_hex_number(buf, end, value, sizeof(void > > *)); > > + return special_hex_number_unsigned_long(buf, end, value); > >  #endif > >  } > >   > > @@ -1446,7 +1449,7 @@ char *clock(char *buf, char *end, struct clk > > *clk, struct printf_spec spec, > >  #ifdef CONFIG_COMMON_CLK > >   return string(buf, end, __clk_get_name(clk), > > spec); > >  #else > > - return special_hex_number(buf, end, (unsigned > > long)clk, sizeof(unsigned long)); > > + return special_hex_number_unsigned_long(buf, end, > > clk); > >  #endif > >   } > >  } > > I'm not sure this is worth the effort. Drop it then! I'm fine with any decision. -- Andy Shevchenko Intel Finland Oy