From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Konrad Dybcio <konradybcio@kernel.org>
Cc: Andreas Noever <andreas.noever@gmail.com>,
Mika Westerberg <westeri@kernel.org>,
Yehezkel Bernat <YehezkelShB@gmail.com>,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
usb4-upstream@oss.qualcomm.com,
Raghavendra Thoorpu <rthoorpu@qti.qualcomm.com>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: Re: [PATCH v3 3/4] thunderbolt: Require nhi->ops be valid
Date: Fri, 15 May 2026 08:30:58 +0200 [thread overview]
Message-ID: <20260515063058.GH84797@black.igk.intel.com> (raw)
In-Reply-To: <20260513-topic-usb4_nonpcie_prepwork-v3-3-b87b5e408ac7@oss.qualcomm.com>
On Wed, May 13, 2026 at 06:23:34PM +0200, Konrad Dybcio wrote:
> From: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>
> Because of how fundamental ops->init_interrupts() is, it no longer
> makes sense to consider cases where nhi->ops is NULL.
>
> Drop some boilerplate around it and add a single sanity-check in
> nhi_probe() instead.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> ---
> drivers/thunderbolt/nhi.c | 32 ++++++++++++++++++--------------
> drivers/thunderbolt/switch.c | 6 +++---
> 2 files changed, 21 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/thunderbolt/nhi.c b/drivers/thunderbolt/nhi.c
> index 740c10ee852b..2a8d1b3716c0 100644
> --- a/drivers/thunderbolt/nhi.c
> +++ b/drivers/thunderbolt/nhi.c
> @@ -559,7 +559,7 @@ static struct tb_ring *tb_ring_alloc(struct tb_nhi *nhi, u32 hop, int size,
> if (!ring->descriptors)
> goto err_free_ring;
>
> - if (nhi->ops && nhi->ops->request_ring_irq) {
> + if (nhi->ops->request_ring_irq) {
I wonder if it makes this more readable if we wrap these like:
if (nhi_request_ring_irq(nhi)) {
> if (nhi->ops->request_ring_irq(ring, flags & RING_FLAG_NO_SUSPEND))
> goto err_free_descs;
> }
next prev parent reply other threads:[~2026-05-15 6:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 16:23 [PATCH v3 0/4] Prepwork for non-PCIe NHI/TBT hosts Konrad Dybcio
2026-05-13 16:23 ` [PATCH v3 1/4] thunderbolt: Move pci_device out of tb_nhi Konrad Dybcio
2026-05-13 16:23 ` [PATCH v3 2/4] thunderbolt: Separate out common NHI bits Konrad Dybcio
2026-05-15 6:28 ` Mika Westerberg
2026-05-13 16:23 ` [PATCH v3 3/4] thunderbolt: Require nhi->ops be valid Konrad Dybcio
2026-05-15 6:30 ` Mika Westerberg [this message]
2026-05-15 9:34 ` Konrad Dybcio
2026-05-15 10:05 ` Mika Westerberg
2026-05-13 16:23 ` [PATCH v3 4/4] thunderbolt: Add some more descriptive probe error messages Konrad Dybcio
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=20260515063058.GH84797@black.igk.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=andreas.noever@gmail.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=rthoorpu@qti.qualcomm.com \
--cc=usb4-upstream@oss.qualcomm.com \
--cc=westeri@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