diff options
author | 2024-02-29 22:22:26 -0800 | |
---|---|---|
committer | 2024-03-01 16:03:32 -0800 | |
commit | bd1ebf2467f9c5d157bec7b025e83f8ffdae1318 (patch) | |
tree | 57b4a79108735efa9116de055fd038ef4014b96f /scripts/gdb/linux/utils.py | |
parent | VMCI: Fix possible memcpy() run-time warning in vmci_datagram_invoke_guest_handler() (diff) | |
download | wireguard-linux-bd1ebf2467f9c5d157bec7b025e83f8ffdae1318.tar.xz wireguard-linux-bd1ebf2467f9c5d157bec7b025e83f8ffdae1318.zip |
overflow: Allow non-type arg to type_max() and type_min()
A common use of type_max() is to find the max for the type of a
variable. Using the pattern type_max(typeof(var)) is needlessly
verbose. Instead, since typeof(type) == type we can just explicitly
call typeof() on the argument to type_max() and type_min(). Add
wrappers for readability.
We can do some replacements right away:
$ git grep '\btype_\(min\|max\)(typeof' | wc -l
11
Link: https://lore.kernel.org/r/20240301062221.work.840-kees@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'scripts/gdb/linux/utils.py')
0 files changed, 0 insertions, 0 deletions