Skip to contentSkip to conversation

ion: improve ion_phys error message

PATCH In review Mitchel Humpherys 2 participants 2 messages Mar 10, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ion: improve ion_phys error message

Clients often get confused when ion_phys errors out due to some heap being used that they didn't expect. Add the heap name and heap type to the error message to make it more obvious.

---
 drivers/staging/android/ion/ion.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/android/ion/ion.c +2 -2
index 296d347660fc..966b7fdc9ecf 100644
@@ -566,8 +566,8 @@ int ion_phys(struct ion_client *client, struct ion_handle *handle,
 	buffer = handle->buffer;
 
 	if (!buffer->heap->ops->phys) {
-		pr_err("%s: ion_phys is not implemented by this heap.\n",
-		       __func__);
+		pr_err("%s: ion_phys is not implemented by this heap (name=%s, type=%d).\n",
+			__func__, buffer->heap->name, buffer->heap->type);
 		mutex_unlock(&client->lock);
 		return -ENODEV;
 	}
Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Mitchel Humpherys

Clients often get confused when ion_phys errors out due to some heap being used that they didn't expect. Add the heap name and heap type to the error message to make it more obvious.

Hm... You sent this exact same patch a month ago. I'm not sure what went wrong. You should probably CC Greg next time. It looks ok to me.

regards,
dan carpenter