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
Unknown Object (File)
Thu, Dec 12, 2:12 PM
Unknown Object (File)
Wed, Dec 11, 8:39 AM
Unknown Object (File)
Thu, Nov 28, 5:05 PM
Unknown Object (File)
Thu, Nov 28, 2:39 PM
Unknown Object (File)
Fri, Nov 22, 8:02 PM
Unknown Object (File)
Fri, Nov 22, 7:45 PM
Unknown Object (File)
Nov 13 2024, 8:21 AM
Unknown Object (File)
Nov 11 2024, 1:21 AM
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