Re: [PATCH] drivers:mailbox Using kfifo to store buffered message data

From: Jassi Brar
Date: Sat Nov 05 2022 - 11:24:19 EST


On Fri, Nov 4, 2022 at 10:36 PM jqlhn <jqlhn@xxxxxxx> wrote:
>
> In current mailbox, a self implemented message array to be used
> as message fifo, I am replacing it with kernel kfifo,
> in order to make code cleaner.
>
> Signed-off-by: jqlhn <jqlhn@xxxxxxx>
> ---
> drivers/mailbox/mailbox.c | 33 ++++++++----------------------
> drivers/mailbox/omap-mailbox.c | 3 +--
> drivers/mailbox/pcc.c | 3 +--
> include/linux/mailbox_controller.h | 10 ++++-----
> 4 files changed, 14 insertions(+), 35 deletions(-)
>
The circular buffer was implemented using an array because it is
simple enough and we wanted to keep tight control over the efficiency.
While you do manage to reduce 21 lines from 4 files, I am not sure
that is a reasonable tradeoff between readability and history plus
actual overhead of execution.

thanks.