dpenkler / linux-usbtmc

Experimental linux usbtmc driver
GNU General Public License v2.0
21 stars 12 forks source link

"fallthrough" compile error on kernel < 5.4 #5

Closed celane closed 3 years ago

celane commented 3 years ago

From 2f5cb7d22560f01acef2df59ea2b346fdb6740dd Mon Sep 17 00:00:00 2001 From: Charles Lane lane@duphy4.physics.drexel.edu Date: Wed, 23 Dec 2020 12:02:24 -0500 Subject: [PATCH] Add #define fallthrough if missing in the kernel include/linux/compiler_attributes.h (the fallthrough was added in kernel 5.4), needed to compile cleanly. Tested on Fedora31 (kernel 5.8.18, patch not needed, but works) and Centos8 (kernel 4.18.0, patch needed, works).


usbtmc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)

diff --git a/usbtmc.c b/usbtmc.c index 36d3e71..9b8dec6 100644 --- a/usbtmc.c +++ b/usbtmc.c @@ -24,6 +24,19 @@

include <linux/compat.h>

include "tmc.h"

+/* Linux kernel 5.4 has a definition of 'fallthrough', earlier kernels

dpenkler commented 3 years ago

Thanks