mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 06/14] drivers/firmware/iscsi_ibft.c: Use %pI4 to print netmask
Date: Wed, 16 Dec 2009 00:09:05 -0800	[thread overview]
Message-ID: <1bf6ccc9bbdff4243bc117d12091d6c4a208f71c.1260949674.git.joe@perches.com> (raw)
In-Reply-To: <cover.1260949674.git.joe@perches.com>

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/firmware/iscsi_ibft.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 051d1eb..f82bcda 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -381,7 +381,7 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
 	void *ibft_loc = entry->header;
 	char *str = buf;
 	char *mac;
-	int val;
+	__be32 val;
 
 	if (!nic)
 		return 0;
@@ -397,10 +397,8 @@ static ssize_t ibft_attr_show_nic(struct ibft_kobject *entry,
 		str += sprintf_ipaddr(str, nic->ip_addr);
 		break;
 	case ibft_eth_subnet_mask:
-		val = ~((1 << (32-nic->subnet_mask_prefix))-1);
-		str += sprintf(str, NIPQUAD_FMT,
-			       (u8)(val >> 24), (u8)(val >> 16),
-			       (u8)(val >> 8), (u8)(val));
+		val = cpu_to_be32(~((1 << (32-nic->subnet_mask_prefix))-1));
+		str += sprintf(str, "%pI4", &val);
 		break;
 	case ibft_eth_origin:
 		str += sprintf(str, "%d\n", nic->origin);
-- 
1.6.6.rc0.57.gad7a


  parent reply	other threads:[~2009-12-16  8:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-16  8:08 [PATCH 00/14] kernel.h cleanups Joe Perches
2009-12-16  8:09 ` [PATCH 01/14] kernel.h: Consolidate console and logging functions and defines Joe Perches
2009-12-16  8:09 ` [PATCH 02/14] kernel.h: Checkpatch cleaning Joe Perches
2009-12-16  8:09 ` [PATCH 03/14] kernel.h: ARRAY_SIZE neatening Joe Perches
2009-12-16  8:09 ` [PATCH 04/14] kernel.h: Add argument names to strtoXX, Xscanf prototypes Joe Perches
2009-12-16  8:09 ` [PATCH 05/14] kernel.h: printk neatening Joe Perches
2009-12-16  8:09 ` Joe Perches [this message]
2009-12-16  8:09 ` [PATCH 07/14] kernel.h: Move NIPQUAD and NIPQUAD_FMT to in.h Joe Perches
2009-12-16  8:09 ` [PATCH 08/14] kernel.h: Group math and limits functions, indent function args Joe Perches
2009-12-16  8:09 ` [PATCH 09/14] kernel.h: Don't use NORET_AND just use noreturn, instead Joe Perches
2009-12-16  8:09 ` [PATCH 10/14] kernel.h: Remove ATTRIB_NORET, use __attribute__((noreturn)) Joe Perches
2009-12-16  8:09 ` [PATCH 11/14] kernel.h: Remove uses of NORET_TYPE Joe Perches
2009-12-16  8:09 ` [PATCH 12/14] kernel.h: Add pr_<level>_once Joe Perches
2009-12-16  8:09 ` [PATCH 13/14] kernel.h: Kernel address utility aggregation and other neatening Joe Perches
2009-12-16  8:09 ` [PATCH 14/14] kernel/exit.c and kernel/panic.c: Remove unused NORET_TYPE Joe Perches
2009-12-16 18:51   ` Peter Zijlstra
2009-12-16 18:53     ` Peter Zijlstra
2009-12-17 20:52 ` [PATCH 00/14] kernel.h cleanups Joe Perches

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=1bf6ccc9bbdff4243bc117d12091d6c4a208f71c.1260949674.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®