Page MenuHomeFreeBSD

ifnet/API: Change if_set*bit accessors to clear first
ClosedPublic

Authored by jhibbits on Jan 9 2023, 7:22 PM.
Tags
None
Referenced Files
F107078509: D37993.id114879.diff
Thu, Jan 9, 7:00 PM
Unknown Object (File)
Sun, Jan 5, 4:13 AM
Unknown Object (File)
Sat, Dec 14, 4:23 PM
Unknown Object (File)
Sat, Dec 14, 3:05 PM
Unknown Object (File)
Thu, Dec 12, 2:12 PM
Unknown Object (File)
Dec 11 2024, 8:39 AM
Unknown Object (File)
Nov 28 2024, 5:05 PM
Unknown Object (File)
Nov 28 2024, 2:39 PM
Subscribers

Details

Summary

A common pattern has been to:

if (foo)

		caps = IFCAP_FOO;

ifp->if_capenable &= ~IFCAP_FOO;
ifp->if_capenable |= caps;

which in the new order of things would be:

if (foo)

		caps = IF_FOO;

if_setcapenablebits(ifp, 0, IFCAP_FOO);
if_setcapenablebits(ifp, caps, 0);

This change streamlines this into:

if (foo)

		caps = IF_FOO;

if_setcapenablebits(ifp, caps, IFCAP_FOO);

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable