linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomas Winkler <tomas.winkler@intel.com>
To: gregkh@linuxfoundation.org
Cc: arnd@arndb.de, alan@linux.intel.com,
	linux-kernel@vger.kernel.org,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 02/15] mei: use unified format for printing mei message header
Date: Tue,  4 Dec 2012 16:04:31 +0200	[thread overview]
Message-ID: <1354629884-3202-2-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1354629884-3202-1-git-send-email-tomas.winkler@intel.com>

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/misc/mei/amthif.c    |    3 +--
 drivers/misc/mei/interface.c |    4 +---
 drivers/misc/mei/interrupt.c |   14 ++++++--------
 drivers/misc/mei/main.c      |    5 +++--
 drivers/misc/mei/mei_dev.h   |    5 +++++
 5 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/misc/mei/amthif.c b/drivers/misc/mei/amthif.c
index 8a9313a..77acd23 100644
--- a/drivers/misc/mei/amthif.c
+++ b/drivers/misc/mei/amthif.c
@@ -457,8 +457,7 @@ int mei_amthif_irq_write_complete(struct mei_device *dev, s32 *slots,
 		return 0;
 	}
 
-	dev_dbg(&dev->pdev->dev, "msg: len = %d complete = %d\n",
-			mei_hdr->length, mei_hdr->msg_complete);
+	dev_dbg(&dev->pdev->dev, MEI_HDR_FMT,  MEI_HDR_PRM(mei_hdr));
 
 	*slots -=  msg_slots;
 	if (mei_write_message(dev, mei_hdr,
diff --git a/drivers/misc/mei/interface.c b/drivers/misc/mei/interface.c
index 21ccbe6..17d93f7 100644
--- a/drivers/misc/mei/interface.c
+++ b/drivers/misc/mei/interface.c
@@ -127,9 +127,7 @@ int mei_write_message(struct mei_device *dev, struct mei_msg_hdr *header,
 	int i;
 	int empty_slots;
 
-	dev_dbg(&dev->pdev->dev,
-			"mei_write_message header=%08x.\n",
-			*((u32 *) header));
+	dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(header));
 
 	empty_slots = mei_hbuf_empty_slots(dev);
 	dev_dbg(&dev->pdev->dev, "empty slots = %hu.\n", empty_slots);
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index b72fa81..fe93d1c 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -150,8 +150,8 @@ quit:
 	dev_dbg(&dev->pdev->dev, "message read\n");
 	if (!buffer) {
 		mei_read_slots(dev, dev->rd_msg_buf, mei_hdr->length);
-		dev_dbg(&dev->pdev->dev, "discarding message, header =%08x.\n",
-				*(u32 *) dev->rd_msg_buf);
+		dev_dbg(&dev->pdev->dev, "discarding message " MEI_HDR_FMT "\n",
+				MEI_HDR_PRM(mei_hdr));
 	}
 
 	return 0;
@@ -742,8 +742,7 @@ static int mei_irq_thread_write_complete(struct mei_device *dev, s32 *slots,
 
 	dev_dbg(&dev->pdev->dev, "buf: size = %d idx = %lu\n",
 			cb->request_buffer.size, cb->buf_idx);
-	dev_dbg(&dev->pdev->dev, "msg: len = %d complete = %d\n",
-			mei_hdr->length, mei_hdr->msg_complete);
+	dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
 
 	*slots -=  msg_slots;
 	if (mei_write_message(dev, mei_hdr,
@@ -790,7 +789,7 @@ static int mei_irq_thread_read_handler(struct mei_cl_cb *cmpl_list,
 		dev_dbg(&dev->pdev->dev, "slots =%08x.\n", *slots);
 	}
 	mei_hdr = (struct mei_msg_hdr *) &dev->rd_msg_hdr;
-	dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n", mei_hdr->length);
+	dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
 
 	if (mei_hdr->reserved || !dev->rd_msg_hdr) {
 		dev_dbg(&dev->pdev->dev, "corrupted message header.\n");
@@ -835,13 +834,12 @@ static int mei_irq_thread_read_handler(struct mei_cl_cb *cmpl_list,
 		   (MEI_FILE_CONNECTED == dev->iamthif_cl.state) &&
 		   (dev->iamthif_state == MEI_IAMTHIF_READING)) {
 		dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_iamthif_message.\n");
-		dev_dbg(&dev->pdev->dev, "mei_hdr->length =%d\n",
-				mei_hdr->length);
+
+		dev_dbg(&dev->pdev->dev, MEI_HDR_FMT, MEI_HDR_PRM(mei_hdr));
 
 		ret = mei_amthif_irq_read_message(cmpl_list, dev, mei_hdr);
 		if (ret)
 			goto end;
-
 	} else {
 		dev_dbg(&dev->pdev->dev, "call mei_irq_thread_read_client_message.\n");
 		ret = mei_irq_thread_read_client_message(cmpl_list,
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index b281c23..7751b58 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -552,8 +552,9 @@ static ssize_t mei_write(struct file *file, const char __user *ubuf,
 	mei_hdr.host_addr = cl->host_client_id;
 	mei_hdr.me_addr = cl->me_client_id;
 	mei_hdr.reserved = 0;
-	dev_dbg(&dev->pdev->dev, "call mei_write_message header=%08x.\n",
-	    *((u32 *) &mei_hdr));
+
+	dev_dbg(&dev->pdev->dev, "write " MEI_HDR_FMT "\n",
+		MEI_HDR_PRM(&mei_hdr));
 	if (mei_write_message(dev, &mei_hdr, write_cb->request_buffer.data)) {
 		rets = -ENODEV;
 		goto err;
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h
index 25da045..da09805 100644
--- a/drivers/misc/mei/mei_dev.h
+++ b/drivers/misc/mei/mei_dev.h
@@ -506,4 +506,9 @@ static inline struct mei_msg_hdr *mei_hbm_hdr(u32 *buf, size_t length)
 	return hdr;
 }
 
+#define MEI_HDR_FMT "hdr:host=%02d me=%02d len=%d comp=%1d"
+#define MEI_HDR_PRM(hdr)                  \
+	(hdr)->host_addr, (hdr)->me_addr, \
+	(hdr)->length, (hdr)->msg_complete
+
 #endif
-- 
1.7.4.4


  reply	other threads:[~2012-12-04 14:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-04 14:04 [char-misc-next 01/15] mei: drop redundant length paramter from mei_write_message function Tomas Winkler
2012-12-04 14:04 ` Tomas Winkler [this message]
2012-12-04 14:04 ` [char-misc-next 03/15] mei: move internal host clients ids to mei_dev.h from hw.h Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 04/15] mei: extarct device dependent constants into hw-mei.h Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 05/15] mei: inlude local headers after the system ones Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 06/15] mei: kill not used BAR0 length and base variables Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 07/15] mei: use wrietl/readl instead of io wrappers Tomas Winkler
2012-12-04 14:31   ` Alan Cox
2012-12-04 15:28     ` Winkler, Tomas
2012-12-04 15:37       ` Alan Cox
2012-12-04 16:02         ` Winkler, Tomas
2012-12-04 16:06           ` Alan Cox
2012-12-04 14:04 ` [char-misc-next 08/15] mei: mei_me_client is not hw API move to mei_dev.h Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 09/15] mei: move hw dependent constructs to interface.c Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 10/15] mei: move host bus message handling to hbm.c Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 11/15] mei: drop non existent function prototype Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 12/15] mei: simplify preparing client host bus messages Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 13/15] mei: use structured buffer for write buffer Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 14/15] mei: add common prefix to hbm function Tomas Winkler
2012-12-04 14:04 ` [char-misc-next 15/15] mei: move hbm responses from interrupt.c to hbm.c Tomas Winkler

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=1354629884-3202-2-git-send-email-tomas.winkler@intel.com \
    --to=tomas.winkler@intel.com \
    --cc=alan@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).