提交 eb30a7a5 编写于 作者: M Miquel Raynal 提交者: Stefan Schmidt

mac802154: Clarify an expression

While going through the whole interface opening logic in my head I was
consistently bothered by the condition checking whether there was only
one interface of type NODE/COORD opened at the same time. What actually
bothered me was the fact that in one case we would use the wpan_dev
pointer directly while in the other case we would use the sdata pointer,
making it harder to differentiate both. In practice the condition should
be straightforward to read. IMHO dropping the wpan_dev indirection
allows to clarify the check.
Signed-off-by: NMiquel Raynal <miquel.raynal@bootlin.com>
Acked-by: NAlexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20221026093502.602734-3-miquel.raynal@bootlin.comSigned-off-by: NStefan Schmidt <stefan@datenfreihafen.org>
上级 4d1c7d87
...@@ -254,7 +254,6 @@ ieee802154_check_concurrent_iface(struct ieee802154_sub_if_data *sdata, ...@@ -254,7 +254,6 @@ ieee802154_check_concurrent_iface(struct ieee802154_sub_if_data *sdata,
enum nl802154_iftype iftype) enum nl802154_iftype iftype)
{ {
struct ieee802154_local *local = sdata->local; struct ieee802154_local *local = sdata->local;
struct wpan_dev *wpan_dev = &sdata->wpan_dev;
struct ieee802154_sub_if_data *nsdata; struct ieee802154_sub_if_data *nsdata;
/* we hold the RTNL here so can safely walk the list */ /* we hold the RTNL here so can safely walk the list */
...@@ -267,7 +266,7 @@ ieee802154_check_concurrent_iface(struct ieee802154_sub_if_data *sdata, ...@@ -267,7 +266,7 @@ ieee802154_check_concurrent_iface(struct ieee802154_sub_if_data *sdata,
* exist really an use case if we need to support * exist really an use case if we need to support
* multiple node types at the same time. * multiple node types at the same time.
*/ */
if (wpan_dev->iftype == NL802154_IFTYPE_NODE && if (sdata->wpan_dev.iftype == NL802154_IFTYPE_NODE &&
nsdata->wpan_dev.iftype == NL802154_IFTYPE_NODE) nsdata->wpan_dev.iftype == NL802154_IFTYPE_NODE)
return -EBUSY; return -EBUSY;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册