From c826ba419f06f9df9cded8e60633253ddc7b60ff Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sun, 14 Aug 2022 11:07:42 +0200 Subject: commonlib/clamp.h: Relicense file to be BSD-compatible I added this header in commit a6c8b4becbd12fe6043557ca1e398c1a7c691007 (nb/intel/sandybridge: Rewrite get_FRQ). Relicense it as "BSD-3-Clause OR GPL-2.0-or-later" and move it into the BSD-licensed commonlib part. Change-Id: I89ebdcdf8d06e78e624e37a443696981b3b17b7d Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/66711 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- src/commonlib/bsd/include/commonlib/bsd/clamp.h | 22 ++++++++++++++++++++++ src/commonlib/include/commonlib/clamp.h | 22 ---------------------- 2 files changed, 22 insertions(+), 22 deletions(-) create mode 100644 src/commonlib/bsd/include/commonlib/bsd/clamp.h delete mode 100644 src/commonlib/include/commonlib/clamp.h (limited to 'src/commonlib') diff --git a/src/commonlib/bsd/include/commonlib/bsd/clamp.h b/src/commonlib/bsd/include/commonlib/bsd/clamp.h new file mode 100644 index 0000000000..66513b0337 --- /dev/null +++ b/src/commonlib/bsd/include/commonlib/bsd/clamp.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later */ + +#ifndef COMMONLIB_BSD_CLAMP_H +#define COMMONLIB_BSD_CLAMP_H + +#include + +/* + * Clamp a value, so that it is between a lower and an upper bound. + */ +static inline u32 clamp_u32(const u32 min, const u32 val, const u32 max) +{ + if (val > max) + return max; + + if (val < min) + return min; + + return val; +} + +#endif /* COMMONLIB_BSD_CLAMP_H */ diff --git a/src/commonlib/include/commonlib/clamp.h b/src/commonlib/include/commonlib/clamp.h deleted file mode 100644 index e01a107ed4..0000000000 --- a/src/commonlib/include/commonlib/clamp.h +++ /dev/null @@ -1,22 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef COMMONLIB_CLAMP_H -#define COMMONLIB_CLAMP_H - -#include - -/* - * Clamp a value, so that it is between a lower and an upper bound. - */ -static inline u32 clamp_u32(const u32 min, const u32 val, const u32 max) -{ - if (val > max) - return max; - - if (val < min) - return min; - - return val; -} - -#endif /* COMMONLIB_CLAMP_H */ -- cgit v1.2.3