Page MenuHomeFreeBSD

linuxkpi: Define `MIN_T()` and `MAX_T()`
ClosedPublic

Authored by dumbbell on Mar 8 2026, 1:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 28, 5:37 AM
Unknown Object (File)
Mon, Apr 27, 6:53 PM
Unknown Object (File)
Mon, Apr 27, 5:39 PM
Unknown Object (File)
Sat, Apr 25, 10:47 AM
Unknown Object (File)
Wed, Apr 22, 10:55 PM
Unknown Object (File)
Wed, Apr 22, 5:44 PM
Unknown Object (File)
Wed, Apr 22, 11:52 AM
Unknown Object (File)
Tue, Apr 21, 4:43 AM
Subscribers

Details

Summary

There are the same as MIN() and MAX() except that they take a type to cast both arguments to compare.

The DRM generic code started to use it in Linux 6.11.

This is part of the update of DRM drivers to Linux 6.11.

Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

I think we want ()s
Considering uses like MIN_T(int, a - b, a + b)

sys/compat/linuxkpi/common/include/linux/minmax.h
63

Use parenthesis as suggested by @emaste.

This revision is now accepted and ready to land.Mar 9 2026, 1:13 AM
This revision was automatically updated to reflect the committed changes.