From: Christoph Hellwig <hch@infradead.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, intel-gfx@lists.freedesktop.org,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
ath10k@lists.infradead.org,
QCA ath9k Development <ath9k-devel@qca.qualcomm.com>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
ath11k@lists.infradead.org, Kalle Valo <kvalo@codeaurora.org>
Subject: Re: [PATCH 4/9] relay: allow the use of const callback structs
Date: Tue, 24 Nov 2020 09:42:09 +0000 [thread overview]
Message-ID: <20201124094209.GD31963@infradead.org> (raw)
In-Reply-To: <cc3ff292e4eb4fdc56bee3d690c7b8e39209cd37.1606153547.git.jani.nikula@intel.com>
> +/* 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@lst.de>
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, intel-gfx@lists.freedesktop.org,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
ath10k@lists.infradead.org,
QCA ath9k Development <ath9k-devel@qca.qualcomm.com>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
ath11k@lists.infradead.org, Kalle Valo <kvalo@codeaurora.org>
Subject: Re: [PATCH 4/9] relay: allow the use of const callback structs
Date: Tue, 24 Nov 2020 09:42:09 +0000 [thread overview]
Message-ID: <20201124094209.GD31963@infradead.org> (raw)
In-Reply-To: <cc3ff292e4eb4fdc56bee3d690c7b8e39209cd37.1606153547.git.jani.nikula@intel.com>
> +/* 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@lst.de>
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, intel-gfx@lists.freedesktop.org,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
ath10k@lists.infradead.org,
QCA ath9k Development <ath9k-devel@qca.qualcomm.com>,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
ath11k@lists.infradead.org, Kalle Valo <kvalo@codeaurora.org>
Subject: Re: [Intel-gfx] [PATCH 4/9] relay: allow the use of const callback structs
Date: Tue, 24 Nov 2020 09:42:09 +0000 [thread overview]
Message-ID: <20201124094209.GD31963@infradead.org> (raw)
In-Reply-To: <cc3ff292e4eb4fdc56bee3d690c7b8e39209cd37.1606153547.git.jani.nikula@intel.com>
> +/* 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@lst.de>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
intel-gfx@lists.freedesktop.org, linux-block@vger.kernel.org,
Jens Axboe <axboe@kernel.dk>,
ath11k@lists.infradead.org, ath10k@lists.infradead.org,
Kalle Valo <kvalo@codeaurora.org>,
linux-wireless@vger.kernel.org,
QCA ath9k Development <ath9k-devel@qca.qualcomm.com>
Subject: Re: [PATCH 4/9] relay: allow the use of const callback structs
Date: Tue, 24 Nov 2020 09:42:09 +0000 [thread overview]
Message-ID: <20201124094209.GD31963@infradead.org> (raw)
In-Reply-To: <cc3ff292e4eb4fdc56bee3d690c7b8e39209cd37.1606153547.git.jani.nikula@intel.com>
> +/* 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@lst.de>
next prev parent reply other threads:[~2020-11-24 9:42 UTC|newest]
Thread overview: 63+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-23 17:59 [PATCH 0/9] relay: cleanup and const callbacks, take 2 Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-23 17:59 ` [Intel-gfx] " Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-23 17:59 ` [Intel-gfx] [PATCH 1/9] relay: remove unused buf_mapped and buf_unmapped callbacks Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-24 9:37 ` [Intel-gfx] " Christoph Hellwig
2020-11-24 9:37 ` Christoph Hellwig
2020-11-23 17:59 ` [Intel-gfx] [PATCH 2/9] relay: require non-NULL callbacks in relay_open() Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-24 9:37 ` [Intel-gfx] " Christoph Hellwig
2020-11-24 9:37 ` Christoph Hellwig
2020-11-23 17:59 ` [Intel-gfx] [PATCH 3/9] relay: make create_buf_file and remove_buf_file callbacks mandatory Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-24 9:37 ` [Intel-gfx] " Christoph Hellwig
2020-11-24 9:37 ` Christoph Hellwig
2020-11-23 17:59 ` [PATCH 4/9] relay: allow the use of const callback structs Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-23 17:59 ` [Intel-gfx] " Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-24 9:42 ` Christoph Hellwig [this message]
2020-11-24 9:42 ` Christoph Hellwig
2020-11-24 9:42 ` [Intel-gfx] " Christoph Hellwig
2020-11-24 9:42 ` Christoph Hellwig
2020-11-24 11:54 ` [PATCH v3] " Jani Nikula
2020-11-24 11:54 ` Jani Nikula
2020-11-24 11:54 ` [Intel-gfx] " Jani Nikula
2020-11-24 11:54 ` Jani Nikula
2020-11-24 11:56 ` [PATCH 4/9] " Jani Nikula
2020-11-24 11:56 ` Jani Nikula
2020-11-24 11:56 ` [Intel-gfx] " Jani Nikula
2020-11-24 11:56 ` Jani Nikula
2020-11-24 16:15 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2020-11-23 17:59 ` [Intel-gfx] [PATCH 5/9] drm/i915: make relay callbacks const Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-24 9:42 ` [Intel-gfx] " Christoph Hellwig
2020-11-24 9:42 ` Christoph Hellwig
2020-11-23 17:59 ` [PATCH 6/9] ath10k: " Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-23 17:59 ` [Intel-gfx] " Jani Nikula
2020-11-24 9:42 ` Christoph Hellwig
2020-11-24 9:42 ` Christoph Hellwig
2020-11-24 9:42 ` [Intel-gfx] " Christoph Hellwig
2020-11-23 17:59 ` [PATCH 7/9] ath11k: " Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-23 17:59 ` [Intel-gfx] " Jani Nikula
2020-11-24 9:42 ` Christoph Hellwig
2020-11-24 9:42 ` Christoph Hellwig
2020-11-24 9:42 ` [Intel-gfx] " Christoph Hellwig
2020-11-23 17:59 ` [Intel-gfx] [PATCH 8/9] ath9k: " Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-24 9:42 ` [Intel-gfx] " Christoph Hellwig
2020-11-24 9:42 ` Christoph Hellwig
2020-11-23 17:59 ` [Intel-gfx] [PATCH 9/9] blktrace: " Jani Nikula
2020-11-23 17:59 ` Jani Nikula
2020-11-24 9:43 ` [Intel-gfx] " Christoph Hellwig
2020-11-24 9:43 ` Christoph Hellwig
2020-11-23 18:06 ` [PATCH 0/9] relay: cleanup and const callbacks, take 2 Kalle Valo
2020-11-23 18:06 ` Kalle Valo
2020-11-23 18:06 ` [Intel-gfx] " Kalle Valo
2020-11-23 18:06 ` Kalle Valo
2020-11-23 19:51 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for " Patchwork
2020-11-23 20:23 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201124094209.GD31963@infradead.org \
--to=hch@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=ath10k@lists.infradead.org \
--cc=ath11k@lists.infradead.org \
--cc=ath9k-devel@qca.qualcomm.com \
--cc=axboe@kernel.dk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=kvalo@codeaurora.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.