Skip to content

Commit

Permalink
mac802154: Fix an always true condition
Browse files Browse the repository at this point in the history
At this stage we simply do not care about the delayed work value,
because active scan is not yet supported, so we can blindly queue
another work once a beacon has been sent.

It fixes a smatch warning:
    mac802154_beacon_worker() warn: always true condition
    '(local->beacon_interval >= 0) => (0-u32max >= 0)'

Fixes: 3accf47 ("mac802154: Handle basic beaconing")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Stefan Schmidt <[email protected]>
  • Loading branch information
miquelraynal authored and Stefan-Schmidt committed Feb 18, 2023
1 parent 1375e3b commit 61d7ddd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/mac802154/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,9 +383,8 @@ void mac802154_beacon_worker(struct work_struct *work)
dev_err(&sdata->dev->dev,
"Beacon could not be transmitted (%d)\n", ret);

if (local->beacon_interval >= 0)
queue_delayed_work(local->mac_wq, &local->beacon_work,
local->beacon_interval);
queue_delayed_work(local->mac_wq, &local->beacon_work,
local->beacon_interval);
}

int mac802154_stop_beacons_locked(struct ieee802154_local *local,
Expand Down

0 comments on commit 61d7ddd

Please sign in to comment.