From: Thorsten Blum <thorsten.blum@linux.dev>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
Thorsten Blum <thorsten.blum@linux.dev>,
Ingo Molnar <mingo@kernel.org>, Kohei Enju <enjuk@amazon.com>,
Thomas Gleixner <tglx@linutronix.de>
Cc: linux-hams@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next] net/rose: Remove unnecessary if check in rose_dev_first()
Date: Fri, 4 Jul 2025 10:33:08 +0200 [thread overview]
Message-ID: <20250704083309.321186-3-thorsten.blum@linux.dev> (raw)
dev_hold() already checks if its argument is NULL.
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
net/rose/rose_route.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c
index b72bf8a08d48..35e21a2bec9c 100644
--- a/net/rose/rose_route.c
+++ b/net/rose/rose_route.c
@@ -608,8 +608,7 @@ struct net_device *rose_dev_first(void)
if (first == NULL || strncmp(dev->name, first->name, 3) < 0)
first = dev;
}
- if (first)
- dev_hold(first);
+ dev_hold(first);
rcu_read_unlock();
return first;
--
2.50.0
next reply other threads:[~2025-07-04 8:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 8:33 Thorsten Blum [this message]
2025-07-07 16:05 ` Simon Horman
2025-07-14 18:03 ` Dan Carpenter
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=20250704083309.321186-3-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=enjuk@amazon.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-hams@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®