Thread (10 messages) read the whole thread 10 messages, 4 authors, 2016-11-28

Re: [PATCH 2/5] smd: Make packet size a constant

From: Bjorn Andersson <hidden>
Date: 2016-11-24 06:14:50
Also in: linux-arm-msm, linux-mmc

On Tue 22 Nov 17:09 PST 2016, Jeremy McNicoll wrote:
Use a macro to define the maximum size of a RPM message.
No thanks.
quoted hunk ↗ jump to hunk
Signed-off-by: Jeremy McNicoll <redacted>
---
 drivers/soc/qcom/smd-rpm.c   | 2 +-
 include/linux/soc/qcom/smd.h | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/qcom/smd-rpm.c b/drivers/soc/qcom/smd-rpm.c
index 6609d7e..b5a2836 100644
--- a/drivers/soc/qcom/smd-rpm.c
+++ b/drivers/soc/qcom/smd-rpm.c
@@ -114,7 +114,7 @@ int qcom_rpm_smd_write(struct qcom_smd_rpm *rpm,
 	size_t size = sizeof(*pkt) + count;
 
 	/* SMD packets to the RPM may not exceed 256 bytes */
-	if (WARN_ON(size >= 256))
+	if (WARN_ON(size >= SMD_RPM_MAX_SIZE))
 		return -EINVAL;
The only thing you do is to change "oh, the max packet size is 256
bytes" to "hmm, i wonder what SMD_RPM_MAX_SIZE is and if the comment is
still valid".
quoted hunk ↗ jump to hunk
 
 	pkt = kmalloc(size, GFP_KERNEL);
diff --git a/include/linux/soc/qcom/smd.h b/include/linux/soc/qcom/smd.h
index f148e0f..8039015 100644
--- a/include/linux/soc/qcom/smd.h
+++ b/include/linux/soc/qcom/smd.h
@@ -4,6 +4,13 @@
 #include <linux/device.h>
 #include <linux/mod_devicetable.h>
 
+
+/*
+ * SMD packets to the RPM may not exceed 256 bytes
+ */
+#define SMD_RPM_MAX_SIZE 256
+
And this has nothing to do with SMD, it's a limitation of RPM.

Regards,
Bjorn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help