linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Minor cleanups/improvements in rpmsg-client-sample
@ 2019-08-09 16:27 Suman Anna
  2019-08-09 16:27 ` [PATCH 1/2] samples/rpmsg: Replace print_hex_dump() with print_hex_dump_debug() Suman Anna
  2019-08-09 16:27 ` [PATCH 2/2] samples/rpmsg: Introduce a module parameter for message count Suman Anna
  0 siblings, 2 replies; 3+ messages in thread
From: Suman Anna @ 2019-08-09 16:27 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen
  Cc: linux-remoteproc, linux-kernel, linux-arm-kernel

Hi Bjorn,

The following are minor cleanup/improvement patches to the rpmsg_client_sample.
The first patch is new, and the second patch is a repost. Appreciate it if you
can pick these up for 5.4 merge window.

regards
Suman

Suman Anna (2):
  samples/rpmsg: Replace print_hex_dump() with print_hex_dump_debug()
  samples/rpmsg: Introduce a module parameter for message count

 samples/rpmsg/rpmsg_client_sample.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

-- 
2.22.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] samples/rpmsg: Replace print_hex_dump() with print_hex_dump_debug()
  2019-08-09 16:27 [PATCH 0/2] Minor cleanups/improvements in rpmsg-client-sample Suman Anna
@ 2019-08-09 16:27 ` Suman Anna
  2019-08-09 16:27 ` [PATCH 2/2] samples/rpmsg: Introduce a module parameter for message count Suman Anna
  1 sibling, 0 replies; 3+ messages in thread
From: Suman Anna @ 2019-08-09 16:27 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen
  Cc: linux-remoteproc, linux-kernel, linux-arm-kernel

Replace the raw print_hex_dump() call in the rpmsg_sample_cb() function
with the equivalent print_hex_dump_debug() better suited for dynamic
debug. This switch allows flexibility of controlling this trace through
dynamic debug when enabled.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 samples/rpmsg/rpmsg_client_sample.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/samples/rpmsg/rpmsg_client_sample.c b/samples/rpmsg/rpmsg_client_sample.c
index 2a0695573b47..b9a99e621a5c 100644
--- a/samples/rpmsg/rpmsg_client_sample.c
+++ b/samples/rpmsg/rpmsg_client_sample.c
@@ -29,8 +29,8 @@ static int rpmsg_sample_cb(struct rpmsg_device *rpdev, void *data, int len,
 	dev_info(&rpdev->dev, "incoming msg %d (src: 0x%x)\n",
 		 ++idata->rx_count, src);
 
-	print_hex_dump(KERN_DEBUG, __func__, DUMP_PREFIX_NONE, 16, 1,
-		       data, len,  true);
+	print_hex_dump_debug(__func__, DUMP_PREFIX_NONE, 16, 1, data, len,
+			     true);
 
 	/* samples should not live forever */
 	if (idata->rx_count >= MSG_LIMIT) {
-- 
2.22.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] samples/rpmsg: Introduce a module parameter for message count
  2019-08-09 16:27 [PATCH 0/2] Minor cleanups/improvements in rpmsg-client-sample Suman Anna
  2019-08-09 16:27 ` [PATCH 1/2] samples/rpmsg: Replace print_hex_dump() with print_hex_dump_debug() Suman Anna
@ 2019-08-09 16:27 ` Suman Anna
  1 sibling, 0 replies; 3+ messages in thread
From: Suman Anna @ 2019-08-09 16:27 UTC (permalink / raw)
  To: Bjorn Andersson, Ohad Ben-Cohen
  Cc: linux-remoteproc, linux-kernel, linux-arm-kernel

The current rpmsg_client_sample uses a fixed number of messages to
be sent to each instance. This is currently set at 100. Introduce
an optional module parameter 'count' so that the number of messages
to be exchanged can be made flexible.

Signed-off-by: Suman Anna <s-anna@ti.com>
---
 samples/rpmsg/rpmsg_client_sample.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/samples/rpmsg/rpmsg_client_sample.c b/samples/rpmsg/rpmsg_client_sample.c
index b9a99e621a5c..ae5081662283 100644
--- a/samples/rpmsg/rpmsg_client_sample.c
+++ b/samples/rpmsg/rpmsg_client_sample.c
@@ -14,7 +14,9 @@
 #include <linux/rpmsg.h>
 
 #define MSG		"hello world!"
-#define MSG_LIMIT	100
+
+static int count = 100;
+module_param(count, int, 0644);
 
 struct instance_data {
 	int rx_count;
@@ -33,7 +35,7 @@ static int rpmsg_sample_cb(struct rpmsg_device *rpdev, void *data, int len,
 			     true);
 
 	/* samples should not live forever */
-	if (idata->rx_count >= MSG_LIMIT) {
+	if (idata->rx_count >= count) {
 		dev_info(&rpdev->dev, "goodbye!\n");
 		return 0;
 	}
-- 
2.22.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-09 16:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-09 16:27 [PATCH 0/2] Minor cleanups/improvements in rpmsg-client-sample Suman Anna
2019-08-09 16:27 ` [PATCH 1/2] samples/rpmsg: Replace print_hex_dump() with print_hex_dump_debug() Suman Anna
2019-08-09 16:27 ` [PATCH 2/2] samples/rpmsg: Introduce a module parameter for message count Suman Anna

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).