From: Jakub Kicinski <kuba@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
kernel-team@meta.com, kuniyu@amazon.com,
ushankar@purestorage.com
Subject: Re: [PATCH RFC net-next] net: Add dev_getbyhwaddr_rtnl() helper
Date: Fri, 7 Feb 2025 16:27:18 -0800 [thread overview]
Message-ID: <20250207162718.4f26219e@kernel.org> (raw)
In-Reply-To: <20250207-arm_fix_selftest-v1-1-487518d2fd1c@debian.org>
On Fri, 07 Feb 2025 04:11:34 -0800 Breno Leitao wrote:
> +static bool dev_comp_addr(struct net_device *dev,
> + unsigned short type,
> + const char *ha)
Weird indentation.
static bool
dev_comp_addr(struct net_device *dev, unsigned short type, const char *ha)
or
static bool dev_comp_addr(struct net_device *dev, unsigned short type,
const char *ha)
> +{
> + if (dev->type == type && !memcmp(dev->dev_addr, ha, dev->addr_len))
> + return true;
> +
> + return false;
return dev->type == type && !memcmp(dev->dev_addr, ha, dev->addr_len);
> +}
> +/**
> + * dev_getbyhwaddr_rtnl - find a device by its hardware address
I guess Eric suggested the _rtnl() suffix, tho it's quite uncommon.
Most function are either function() or function_rcu() in networking.
> + * @net: the applicable net namespace
> + * @type: media type of device
> + * @ha: hardware address
> + *
> + * Similar to dev_getbyhwaddr_rcu(), but, the owner needs to hold
unnecessary , after but
> + * RTNL.
rtnl_lock. RTNL is short for RTNetLink
> + *
document the return value kdoc style:
Return: pointer to the net_device, or NULL if not found
> + */
> +struct net_device *dev_getbyhwaddr_rtnl(struct net *net, unsigned short type,
> + const char *ha)
You missed adding this to a header file?
next prev parent reply other threads:[~2025-02-08 0:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 12:11 [PATCH RFC net-next] net: Add dev_getbyhwaddr_rtnl() helper Breno Leitao
2025-02-08 0:27 ` Jakub Kicinski [this message]
2025-02-10 11:40 ` Breno Leitao
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=20250207162718.4f26219e@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuniyu@amazon.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ushankar@purestorage.com \
/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).