All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/1] lib/vsprintf: define special_hex_number_unsigned_long()
Date: Tue, 26 Jan 2016 20:44:46 -0800	[thread overview]
Message-ID: <20160126204446.8757302d.akpm@linux-foundation.org> (raw)
In-Reply-To: <1452774889-84863-1-git-send-email-andriy.shevchenko@linux.intel.com>

On Thu, 14 Jan 2016 14:34:49 +0200 Andy Shevchenko <andriy.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.

  reply	other threads:[~2016-01-27  4:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 12:34 [PATCH v1 1/1] lib/vsprintf: define special_hex_number_unsigned_long() Andy Shevchenko
2016-01-27  4:44 ` Andrew Morton [this message]
2016-01-27 12:19   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160126204446.8757302d.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.