On Wed, 29 Jan 2025 14:35:27 +0100, Thomas Weißschuh wrote: > The overflow checking has to deal with different datatypes and > edgecases. Add a new kunit testcase to make sure it works correctly. > > Signed-off-by: Thomas Weißschuh <thomas.weissschuh@xxxxxxxxxxxxx> > --- > Changes in v3: > - Avoid constant truncation warnings by using u64 for test case > expectations > - Run through 0day before submission > - Link to v2: https://lore.kernel.org/r/20250127-of-address-overflow-v2-1-61b5046044e9@xxxxxxxxxxxxx > > Changes in v2: > - Rebase on robh/for-master > - Drop already applied patch > - Add missing MODULE_IMPORT_NS() > - Fix sparse warnings: "cast truncates bits from constant value" > - Link to v1: https://lore.kernel.org/r/20250120-of-address-overflow-v1-0-dd68dbf47bce@xxxxxxxxxxxxx > --- > Technically it's possible to run this unittest with !CONFIG_OF_ADDRESS, > so there is an explicit check inside the test. > It would also be possible to add a dedicated source file, but that > seemed like a lot of churn to me. > --- > drivers/of/address.c | 5 +- > drivers/of/of_private.h | 4 ++ > drivers/of/of_test.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++- > 3 files changed, 126 insertions(+), 2 deletions(-) > Applied, thanks!