Skip to contentSkip to conversation

mei: add error messages for open count errors

PATCH In review Tomas Winkler 2 participants 4 messages Sep 10, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 mei: add error messages for open count errors

---
 drivers/misc/mei/main.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
drivers/misc/mei/main.c +8 -2
index ae2cd0d..e8b0858 100644
@@ -239,12 +239,18 @@ static int mei_open(struct inode *inode, struct file *file)
 		goto out_unlock;
 	}
 	err = -EMFILE;
-	if (dev->open_handle_count >= MEI_MAX_OPEN_HANDLE_COUNT)
+	if (dev->open_handle_count >= MEI_MAX_OPEN_HANDLE_COUNT) {
+		dev_err(&dev->pdev->dev, "open_handle_count exceded %d",
+			MEI_MAX_OPEN_HANDLE_COUNT);
 		goto out_unlock;
+	}
 
 	cl_id = find_first_zero_bit(dev->host_clients_map, MEI_CLIENTS_MAX);
-	if (cl_id >= MEI_CLIENTS_MAX)
+	if (cl_id >= MEI_CLIENTS_MAX) {
+		dev_err(&dev->pdev->dev, "client_id exceded %d",
+				MEI_CLIENTS_MAX) ;
 		goto out_unlock;
+	}
 
 	cl->host_client_id  = cl_id;
 
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH 2/3 mei: struct mei_message_data doesn't have to be packed

---
 drivers/misc/mei/mei_dev.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/misc/mei/mei_dev.h +1 -1
index 96d3e79..adb35fb 100644
@@ -140,7 +140,7 @@ enum mei_cb_major_types {
 struct mei_message_data {
 	u32 size;
 	unsigned char *data;
-} __packed;
+};
 
 
 struct mei_cl_cb {
Signature · 1 line
1.7.4.4
#2 lore raw

Re: [char-misc-next 2/3] mei: struct mei_message_data doesn't have to be packed

Quoted 10 lines · On Tue, 11 Sep 2012 00:43:21 +0300 Tomas Winkler <[email protected]>…
---
 drivers/misc/mei/mei_dev.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/misc/mei/mei_dev.h +0 -0
index 96d3e79..adb35fb 100644

drivers/misc/mei/mei_dev.h enum mei_cb_major_types { · line 143

Quoted 5 lines
drivers/misc/mei/mei_dev.h +1 -1
@@ -140,7 +140,7 @@ enum mei_cb_major_types {
 struct mei_message_data {
 	u32 size;
 	unsigned char *data;
-} __packed;
+};

Explanation would be useful especially for this one. The others are obvious although a one line comment would still be good form perhaps.

#3 lore raw

PATCH 3/3 mei: don't print buffer as a string

In reply to Tomas Winkler

non readable junk was printed to the logs
we will add proper buffer dumping mechanism later if needed

---
 drivers/misc/mei/interrupt.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
drivers/misc/mei/interrupt.c +1 -8
index 0900a71..3533edd 100644
@@ -221,17 +221,10 @@ static int mei_irq_thread_read_client_message(struct mei_io_list *complete_list,
 				cl->status = 0;
 				list_del(&cb_pos->cb_list);
 				dev_dbg(&dev->pdev->dev,
-					"completed read host client = %d,"
-					"ME client = %d, "
-					"data length = %lu\n",
+					"completed read H cl = %d, ME cl = %d, length = %lu\n",
 					cl->host_client_id,
 					cl->me_client_id,
 					cb_pos->information);
-
-				*(cb_pos->response_buffer.data +
-					cb_pos->information) = '\0';
-				dev_dbg(&dev->pdev->dev, "cb_pos->res_buffer - %s\n",
-					cb_pos->response_buffer.data);
 				list_add_tail(&cb_pos->cb_list,
 					&complete_list->mei_cb.cb_list);
 			}
Signature · 1 line
1.7.4.4