Skip to content
Commit 0c668477 authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

overflow.h: Add arithmetic shift helper



Add shift_overflow() helper to assist driver authors in ensuring that
shift operations don't cause overflows or other odd conditions.

Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
[kees: tweaked comments and commit log, dropped unneeded assignment]
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent 58796e67
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment