diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-07-10 13:08:29 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2023-07-11 13:23:15 +0300 |
commit | 274c4a6d529cff48b241b15627b46b0f65987ade (patch) | |
tree | 4b5de264da12064555d8f4552eb5a10e31689da6 /net/core/dev.c | |
parent | 6843306689aff3aea608e4d2630b2a5a0137f827 (diff) | |
download | linux-274c4a6d529cff48b241b15627b46b0f65987ade.tar.xz |
net/core: Make use of assign_bit() API
We have for some time the assign_bit() API to replace open coded
if (foo)
set_bit(n, bar);
else
clear_bit(n, bar);
Use this API in the code. No functional change intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Message-ID: <20230710100830.89936-1-andriy.shevchenko@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 69a3e544676c..d6e1b786c5c5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6316,12 +6316,8 @@ int dev_set_threaded(struct net_device *dev, bool threaded) * softirq mode will happen in the next round of napi_schedule(). * This should not cause hiccups/stalls to the live traffic. */ - list_for_each_entry(napi, &dev->napi_list, dev_list) { - if (threaded) - set_bit(NAPI_STATE_THREADED, &napi->state); - else - clear_bit(NAPI_STATE_THREADED, &napi->state); - } + list_for_each_entry(napi, &dev->napi_list, dev_list) + assign_bit(NAPI_STATE_THREADED, &napi->state, threaded); return err; } |