Thread (11 messages) 11 messages, 3 authors, 2019-06-05

Re: [PATCH 2/3] i2c: slave-mqueue: add a slave backend to receive and queue messages

From: Andy Shevchenko <hidden>
Date: 2019-06-05 08:25:53
Also in: linux-i2c, lkml

On Wed, Jun 5, 2019 at 6:30 AM Eduardo Valentin [off-list ref] wrote:
Hey Andry,

Long time no seeing :-)
True!

quoted
quoted
+#define MQ_MSGBUF_SIZE             CONFIG_I2C_SLAVE_MQUEUE_MESSAGE_SIZE
+#define MQ_QUEUE_SIZE              CONFIG_I2C_SLAVE_MQUEUE_QUEUE_SIZE
quoted
+#define MQ_QUEUE_NEXT(x)   (((x) + 1) & (MQ_QUEUE_SIZE - 1))
Also possible ((x + 1) % ..._SIZE)
Right.. but I suppose the original idea is to avoid divisions on the hotpath.

So, I am actually fine with the limitation of only using power of 2.
The original code implies that anyway, so, my proposal doesn't
restrict it any farther.
quoted
quoted
+   {
+           .compatible = "i2c-slave-mqueue",
+   },
quoted
+   { },
No need for comma here.
It does not hurt to have it either :-)
It's just a protection against some weird cases of adding entries
behind the terminator.
quoted
quoted
+           .of_match_table = of_match_ptr(i2c_slave_mqueue_of_match),
Wouldn't compiler warn you due to unused data?
Perhaps drop of_match_ptr() for good...

Not sure what you meant here. I dont see any compiler warning.
Also, of_match_ptr seams to be well spread in the kernel.
If this will be compiled with CONFIG_OF=n...
Though I didn't check all dependencies to see if it even possible. In
any case of_match_ptr() is redundant in both cases here.
Either you need to protect i2c_slave_mqueue_of_match with #ifdef
CONFIG_OF, or drop the macro use.

P.S. Taking into account the last part, I would wait for v7 with that
fixed followed by fixing other nits.

-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help