From: Christoph Hellwig <hch@infradead.org>
To: Jani Nikula <jani.nikula@intel.com>
Cc: linux-kernel@vger.kernel.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 1/6] relay: allow the use of const callback structs
Date: Thu, 19 Nov 2020 08:11:20 +0000 [thread overview]
Message-ID: <20201119081120.GA6149@infradead.org> (raw)
In-Reply-To: <20201118165320.26829-1-jani.nikula@intel.com>
> +/*
> + * rchan_callback wrappers. Call the callbacks if available, otherwise fall back
> + * to default behaviour.
> + */
This adds an overly long line. That being said this behavior is pretty
normal for kernel APIs, so I'm not even sure we need it at all.
> +
> +/*
> + * subbuf_start() callback.
> + */
and this one is for sure completley useless. Same for all the other
similar ones.
But taking one step back: All instances implement create_buf_file
and remove_buf_file, which makes sense as that is the prime aim
of these methods. So there is no point in making those optional.
subbuf_start_callback is overriden by two instances, so making that
optional totally makes sense. buf_mapped and buf_unmapped are
never overriden, so they should be removed entirely.
More importantly there is no case that passes a NULL rchan_callbacks,
which makes complete sense as it wouldn't even create a file. So
remove that case as well and just replace it with a sanity check in
relay_open().
Please also add a patch to mark all rchan_callbacks instances const
while you're at it.
next prev parent reply other threads:[~2020-11-19 8:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-18 16:53 [PATCH 1/6] relay: allow the use of const callback structs Jani Nikula
2020-11-18 16:53 ` [PATCH 6/6] blktrace: make relay callbacks const Jani Nikula
2020-11-19 8:11 ` Christoph Hellwig [this message]
2020-11-19 8:11 ` [PATCH 1/6] relay: allow the use of const callback structs Christoph Hellwig
2020-11-23 18:01 ` Jani Nikula
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=20201119081120.GA6149@infradead.org \
--to=hch@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).