compat: fix cordic backport header
PATCH 1/1 compat: fix cordic backport header
From: "Luis R. Rodriguez" <[email protected]>
mcgrof@frijol ~/linux-next (git::master)$ git describe --contains \ 10f8113ecb76eea72f96c7cfb72d7fed7c282565
v3.1-rc1~24^2~10^2^2~515
The cordic backport added the cordic library and the cordic header. It correctly only compiled cordic for kernels < 3.1 but the header however was left intact. This is non-issue until cordic itself gets updated with some new features or changes but also an issue was created when we switched the backort namespace. The issue is that the header declares backport_cordic_calc_iq() exists while it actually is not compiled on newer kernels.
Fix this by doing the kernel revision check on the backported header, otherwise use #include_next to get the next header, the proper kernel header.
This does not have to be added to the older releases given that the header is the same for older kernels, and we are not exporting the symbol twice given that the proper check was already in place for cordic.c.
--- include/linux/cordic.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
include/linux/cordic.h +11 -0
@@ -1,3 +1,12 @@ +#ifndef _BACKPORT_LINUX_CORDIC_H +#define _BACKPORT_LINUX_CORDIC_H 1 + +#include <linux/version.h> + +#if (LINUX_VERSION_CODE >KERNEL_VERSION (3 ,1 ,0 )) +#include_next <linux/cordic.h> +#else +/* * Copyright (c) 2011 Broadcom Corporation *
@@ -47,3 +56,5 @@ struct cordic_iq {struct cordic_iq cordic_calc_iq (s32 theta);#endif /* __CORDIC_H_ */ +#endif /* LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0)) */ +#endif /* _BACKPORT_LINUX_CORDIC_H */
Signature · 1 line
1.7.10.4
Quoted 20 lines · Luis R. Rodriguez
From: "Luis R. Rodriguez" <[email protected]>
mcgrof@frijol ~/linux-next (git::master)$ git describe --contains \ 10f8113ecb76eea72f96c7cfb72d7fed7c282565v3.1-rc1~24^2~10^2^2~515
The cordic backport added the cordic library and the cordic header. It correctly only compiled cordic for kernels < 3.1 but the header however was left intact. This is non-issue until cordic itself gets updated with some new features or changes but also an issue was created when we switched the backort namespace. The issue is that the header declares
backport_cordic_calc_iq()exists while it actually is not compiled on newer kernels.Fix this by doing the kernel revision check on the backported header, otherwise use #include_next to get the next header, the proper kernel header.
Quoted 7 lines
This does not have to be added to the older releases given that the header is the same for older kernels, and we are not exporting the symbol twice given that the proper check was already in place for
cordic.c.Reported-by Camale=C3=B3n <[email protected]>Signed-off-by Luis R. Rodriguez <[email protected]>
1 2.6.24 [ OK ] 2 2.6.25 [ OK ] 3 2.6.26 [ OK ] 4 2.6.27 [ OK ] 5 2.6.28 [ OK ] 6 2.6.29 [ OK ] 7 2.6.30 [ OK ] 8 2.6.31 [ OK ] 9 2.6.32 [ OK ] 10 2.6.33 [ OK ] 11 2.6.34 [ OK ] 12 2.6.35 [ OK ] 13 2.6.36 [ OK ] 14 2.6.37 [ OK ] 15 2.6.38 [ OK ] 16 2.6.39 [ OK ] 17 3.0.65 [ OK ] 18 3.1.10 [ OK ] 19 3.2.38 [ OK ] 20 3.3.8 [ OK ] 21 3.4.32 [ OK ] 22 3.5.7 [ OK ] 23 3.6.11 [ OK ] 24 3.7.9 [ OK ] 25 3.8.0 [ OK ] 26 3.9-rc1 [ OK ]
real 0m32.956s user 12m14.398s sys 2m12.304s
Luis