All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: Harvey Harrison <harvey.harrison@gmail.com>, netdev@vger.kernel.org
Subject: Some NIPQUAD_FMT -> %pI4 conversions are broken
Date: Fri, 09 Jan 2009 19:47:51 -0800	[thread overview]
Message-ID: <adaprivom8o.fsf@cisco.com> (raw)

I just noticed (by getting a messed up print in my kernel log) that most
of the changes to drivers/infiniband/hw/nes in commit 63779436
("drivers: replace NIPQUAD()") were wrong: the idea was to change printk
statements like

	printk("..." NIPQUAD_FMT "...", NIPQUAD(foo));

but most of the changes in nes were to code like

	printk("..." NIPQUAD_FMT "...", HIPQUAD(foo));

ie *H* IPQUAD not *N* IPQUAD, indicating the foo is in host endian
order, and hence the new code

	printk("...%pI4...", &foo);

prints the IP in reverse order now.

I don't see a good way to fix this without introducing a temporary
variable to hold a swapped IP address... but is there a better way?

 - R.

             reply	other threads:[~2009-01-10  3:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-10  3:47 Roland Dreier [this message]
2009-01-10  6:07 ` Some NIPQUAD_FMT -> %pI4 conversions are broken Harvey Harrison
2009-01-10  6:15   ` David Miller
2009-01-10  6:24     ` Harvey Harrison
2009-01-10  6:24 ` [PATCH] nes: fix reversed IP address Harvey Harrison
2009-01-10  6:49   ` Harvey Harrison

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=adaprivom8o.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=harvey.harrison@gmail.com \
    --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.