The patch titled Subject: relay-allow-the-use-of-const-callback-structs-v3 has been added to the -mm tree. Its filename is relay-allow-the-use-of-const-callback-structs-v3.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/relay-allow-the-use-of-const-callback-structs-v3.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/relay-allow-the-use-of-const-callback-structs-v3.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Jani Nikula <jani.nikula@xxxxxxxxx> Subject: relay-allow-the-use-of-const-callback-structs-v3 cleanups, per Christoph Link: https://lkml.kernel.org/r/20201124115412.32402-1-jani.nikula@xxxxxxxxx Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Cc: Jens Axboe <axboe@xxxxxxxxx> Cc: Kalle Valo <kvalo@xxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/relay.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) --- a/kernel/relay.c~relay-allow-the-use-of-const-callback-structs-v3 +++ a/kernel/relay.c @@ -252,18 +252,14 @@ EXPORT_SYMBOL_GPL(relay_buf_full); * High-level relay kernel API and associated functions. */ -/* subbuf_start callback wrapper */ -static int cb_subbuf_start(struct rchan_buf *buf, void *subbuf, - void *prev_subbuf, size_t prev_padding) -{ - 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; +static int relay_subbuf_start(struct rchan_buf *buf, void *subbuf, + void *prev_subbuf, size_t prev_padding) +{ + if (!buf->chan->cb->subbuf_start) + return !relay_buf_full(buf); - return 1; + return buf->chan->cb->subbuf_start(buf, subbuf, + prev_subbuf, prev_padding); } /** @@ -309,7 +305,7 @@ static void __relay_reset(struct rchan_b for (i = 0; i < buf->chan->n_subbufs; i++) buf->padding[i] = 0; - cb_subbuf_start(buf, buf->data, NULL, 0); + relay_subbuf_start(buf, buf->data, NULL, 0); } /** @@ -699,7 +695,7 @@ size_t relay_switch_subbuf(struct rchan_ new_subbuf = buf->subbufs_produced % buf->chan->n_subbufs; new = buf->start + new_subbuf * buf->chan->subbuf_size; buf->offset = 0; - if (!cb_subbuf_start(buf, new, old, buf->prev_padding)) { + if (!relay_subbuf_start(buf, new, old, buf->prev_padding)) { buf->offset = buf->chan->subbuf_size + 1; return 0; } _ Patches currently in -mm which might be from jani.nikula@xxxxxxxxx are relay-remove-unused-buf_mapped-and-buf_unmapped-callbacks.patch relay-require-non-null-callbacks-in-relay_open.patch relay-make-create_buf_file-and-remove_buf_file-callbacks-mandatory.patch relay-allow-the-use-of-const-callback-structs.patch relay-allow-the-use-of-const-callback-structs-v3.patch drm-i915-make-relay-callbacks-const.patch ath10k-make-relay-callbacks-const.patch ath11k-make-relay-callbacks-const.patch ath9k-make-relay-callbacks-const.patch blktrace-make-relay-callbacks-const.patch