All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Daniel Borkmann <dborkman@redhat.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-sctp@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 1/2] lib: vsprintf: add IPv4/v6 generic %p[Ii]S[pfs] format specifier
Date: Fri, 28 Jun 2013 09:30:39 -0700	[thread overview]
Message-ID: <1372437039.29380.19.camel@joe-AO722> (raw)
In-Reply-To: <1372421131-1672-2-git-send-email-dborkman@redhat.com>

On Fri, 2013-06-28 at 14:05 +0200, Daniel Borkmann wrote:

> +static noinline_for_stack
> +char *ip4_addr_string_sa(char *buf, char *end, const struct sockaddr_in *sa,
> +			 struct printf_spec spec, const char *fmt)
> +{
> +	bool have_p = (fmt[2] && fmt[2] == 'p');

	bool have_p = fmt[2] == 'p';

you don't need the first "fmt[2] &&"
but I can imagine a case where the other flow/scope types
could be specified generically and the 'p' may not be in
array index 2

I think you should probably do the same while loop like
the ip6_addr_string_sa block.


WARNING: multiple messages have this Message-ID (diff)
From: Joe Perches <joe@perches.com>
To: Daniel Borkmann <dborkman@redhat.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-sctp@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3 1/2] lib: vsprintf: add IPv4/v6 generic %p[Ii]S[pfs] format specifier
Date: Fri, 28 Jun 2013 16:30:39 +0000	[thread overview]
Message-ID: <1372437039.29380.19.camel@joe-AO722> (raw)
In-Reply-To: <1372421131-1672-2-git-send-email-dborkman@redhat.com>

On Fri, 2013-06-28 at 14:05 +0200, Daniel Borkmann wrote:

> +static noinline_for_stack
> +char *ip4_addr_string_sa(char *buf, char *end, const struct sockaddr_in *sa,
> +			 struct printf_spec spec, const char *fmt)
> +{
> +	bool have_p = (fmt[2] && fmt[2] = 'p');

	bool have_p = fmt[2] = 'p';

you don't need the first "fmt[2] &&"
but I can imagine a case where the other flow/scope types
could be specified generically and the 'p' may not be in
array index 2

I think you should probably do the same while loop like
the ip6_addr_string_sa block.


  parent reply	other threads:[~2013-06-28 16:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-28 12:05 [PATCH net-next v3 0/2] Rework SCTP debugging framework Daniel Borkmann
2013-06-28 12:05 ` Daniel Borkmann
2013-06-28 12:05 ` [PATCH net-next v3 1/2] lib: vsprintf: add IPv4/v6 generic %p[Ii]S[pfs] format specifier Daniel Borkmann
2013-06-28 12:05   ` Daniel Borkmann
2013-06-28 15:44   ` Joe Perches
2013-06-28 15:44     ` Joe Perches
2013-06-28 15:53     ` Daniel Borkmann
2013-06-28 15:53       ` Daniel Borkmann
2013-06-28 16:04       ` Joe Perches
2013-06-28 16:04         ` Joe Perches
2013-06-28 16:13         ` Daniel Borkmann
2013-06-28 16:13           ` Daniel Borkmann
2013-06-28 16:06       ` Daniel Borkmann
2013-06-28 16:06         ` Daniel Borkmann
2013-06-28 16:30   ` Joe Perches [this message]
2013-06-28 16:30     ` Joe Perches
2013-06-28 12:05 ` [PATCH net-next v3 2/2] net: sctp: rework debugging framework to use pr_debug and friends Daniel Borkmann
2013-06-28 12:05   ` Daniel Borkmann

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=1372437039.29380.19.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /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.