// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2024 BayLibre SAS */ #define pr_fmt(fmt) … #include <linux/init.h> #include <linux/module.h> #include <linux/printk.h> #include <linux/math64.h> test_params; static test_params test_values[] = …; /* * The above table can be verified with the following shell script: * * #!/bin/sh * sed -ne 's/^{ \+\(.*\), \+\(.*\), \+\(.*\), \+\(.*\) },$/\1 \2 \3 \4/p' \ * lib/math/test_mul_u64_u64_div_u64.c | * while read a b c r; do * expected=$( printf "obase=16; ibase=16; %X * %X / %X\n" $a $b $c | bc ) * given=$( printf "%X\n" $r ) * if [ "$expected" = "$given" ]; then * echo "$a * $b / $c = $r OK" * else * echo "$a * $b / $c = $r is wrong" >&2 * echo "should be equivalent to 0x$expected" >&2 * exit 1 * fi * done */ static int __init test_init(void) { … } static void __exit test_exit(void) { … } module_init(…) …; module_exit(test_exit); MODULE_AUTHOR(…) …; MODULE_LICENSE(…) …; MODULE_DESCRIPTION(…) …;