[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201124094209.GD31963@infradead.org>
Date: Tue, 24 Nov 2020 09:42:09 +0000
From: Christoph Hellwig <hch@...radead.org>
To: Jani Nikula <jani.nikula@...el.com>
Cc: linux-kernel@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
intel-gfx@...ts.freedesktop.org, linux-block@...r.kernel.org,
Jens Axboe <axboe@...nel.dk>, ath11k@...ts.infradead.org,
ath10k@...ts.infradead.org, Kalle Valo <kvalo@...eaurora.org>,
linux-wireless@...r.kernel.org,
QCA ath9k Development <ath9k-devel@....qualcomm.com>
Subject: Re: [PATCH 4/9] relay: allow the use of const callback structs
> +/* subbuf_start callback wrapper */
> +static int cb_subbuf_start(struct rchan_buf *buf, void *subbuf,
> + void *prev_subbuf, size_t prev_padding)
I don't think the comment adds any information over just looking at the
function and the two callers. I'd also name it relay_subbuf_start
instead of the cb_ prefix not used anywhere else in the file.
> {
> + if (buf->chan->cb->subbuf_start)
> + return buf->chan->cb->subbuf_start(buf, subbuf,
> + prev_subbuf, prev_padding);
> +
> if (relay_buf_full(buf))
> return 0;
This could also be simplified a bit more to:
if (!buf->chan->cb->subbuf_start)
return !relay_buf_full(buf);
return buf->chan->cb->subbuf_start(buf, subbuf, prev_subbuf,
prev_padding);
Otherwise this looks good to me:
Reviewed-by: Christoph Hellwig <hch@....de>
Powered by blists - more mailing lists