Backports Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] backport-include: add newly introduced macros in cordic.h
@ 2019-03-13  8:57 Arend van Spriel
  2019-03-13 20:33 ` Hauke Mehrtens
  0 siblings, 1 reply; 2+ messages in thread
From: Arend van Spriel @ 2019-03-13  8:57 UTC (permalink / raw)
  To: backports; +Cc: Arend van Spriel

The kernel header file linux/cordic.h changed in v5.0 kernel
resulting in backport build to fail for brcmsmac (and probably
b43 as well). So backport those definitions for older kernels.

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
Hi,

It has been a while since I submitted or did anything with the backports
repo. I was using it on Ubuntu 14.04 and had a problem building coccinelle
v1.0.7. I finally fixed that so I wanted to share here what was going on so
it may help others.

So while building coccinelle it failed with following:

make[1]: Entering directory `/projects/hnd_software_nl/work/arend/utils/coccinelle-1.0.7/bundles/parmap'
/usr/bin/ocamlc.opt -unsafe -I parmap   -c parmap/bytearray.ml -o parmap/bytearray.cmo
File "parmap/bytearray.ml", line 1:
Error: Could not find the .cmi file for interface parmap/bytearray.mli.
make[1]: *** [parmap/bytearray.cmo] Error 2
make[1]: Leaving directory `/projects/hnd_software_nl/work/arend/utils/coccinelle-1.0.7/bundles/parmap'
make: *** [all] Error 2

So what is going on. During configure it is detected that my machine does not
have the parmap ocaml library. This library is also bundled in coccinelle tarbal
so it decides to build that. However, that fails for some reason. I decided to
take a closer look. I found that if I went to bundles/parmap/parmap and run make
there the build went fine so I went along and installed it. Rerun configure picked
up the installed parmap library and the reset of coccinelle build went fine.

So I am back in business and here is the patch that should fix the cordic users.

Regards,
Arend
---
 backport/backport-include/linux/cordic.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/backport/backport-include/linux/cordic.h b/backport/backport-include/linux/cordic.h
index 67d6a4a..101da91 100644
--- a/backport/backport-include/linux/cordic.h
+++ b/backport/backport-include/linux/cordic.h
@@ -5,6 +5,16 @@

 #if (LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0))
 #include_next <linux/cordic.h>
+#if LINUX_VERSION_IS_LESS(5,0,0)
+#define CORDIC_ANGLE_GEN	39797
+#define CORDIC_PRECISION_SHIFT	16
+#define CORDIC_NUM_ITER	(CORDIC_PRECISION_SHIFT + 2)
+
+#define CORDIC_FIXED(X)	((s32)((X) << CORDIC_PRECISION_SHIFT))
+#define CORDIC_FLOAT(X)	(((X) >= 0) \
+		? ((((X) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1) \
+		: -((((-(X)) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1))
+#endif
 #else

 /*
--
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] backport-include: add newly introduced macros in cordic.h
  2019-03-13  8:57 [PATCH] backport-include: add newly introduced macros in cordic.h Arend van Spriel
@ 2019-03-13 20:33 ` Hauke Mehrtens
  0 siblings, 0 replies; 2+ messages in thread
From: Hauke Mehrtens @ 2019-03-13 20:33 UTC (permalink / raw)
  To: Arend van Spriel, backports

On 3/13/19 9:57 AM, Arend van Spriel wrote:
> The kernel header file linux/cordic.h changed in v5.0 kernel
> resulting in backport build to fail for brcmsmac (and probably
> b43 as well). So backport those definitions for older kernels.

This was already added here:
https://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git/commit/?id=77b9ee6a9f0e0c3697cbadf2fd59e46ea5c64def

Hauke

> 
> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
> ---
> Hi,
> 
> It has been a while since I submitted or did anything with the backports
> repo. I was using it on Ubuntu 14.04 and had a problem building coccinelle
> v1.0.7. I finally fixed that so I wanted to share here what was going on so
> it may help others.
> 
> So while building coccinelle it failed with following:
> 
> make[1]: Entering directory `/projects/hnd_software_nl/work/arend/utils/coccinelle-1.0.7/bundles/parmap'
> /usr/bin/ocamlc.opt -unsafe -I parmap   -c parmap/bytearray.ml -o parmap/bytearray.cmo
> File "parmap/bytearray.ml", line 1:
> Error: Could not find the .cmi file for interface parmap/bytearray.mli.
> make[1]: *** [parmap/bytearray.cmo] Error 2
> make[1]: Leaving directory `/projects/hnd_software_nl/work/arend/utils/coccinelle-1.0.7/bundles/parmap'
> make: *** [all] Error 2
> 
> So what is going on. During configure it is detected that my machine does not
> have the parmap ocaml library. This library is also bundled in coccinelle tarbal
> so it decides to build that. However, that fails for some reason. I decided to
> take a closer look. I found that if I went to bundles/parmap/parmap and run make
> there the build went fine so I went along and installed it. Rerun configure picked
> up the installed parmap library and the reset of coccinelle build went fine.
> 
> So I am back in business and here is the patch that should fix the cordic users.
> 
> Regards,
> Arend
> ---
>  backport/backport-include/linux/cordic.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/backport/backport-include/linux/cordic.h b/backport/backport-include/linux/cordic.h
> index 67d6a4a..101da91 100644
> --- a/backport/backport-include/linux/cordic.h
> +++ b/backport/backport-include/linux/cordic.h
> @@ -5,6 +5,16 @@
> 
>  #if (LINUX_VERSION_CODE > KERNEL_VERSION(3,1,0))
>  #include_next <linux/cordic.h>
> +#if LINUX_VERSION_IS_LESS(5,0,0)
> +#define CORDIC_ANGLE_GEN	39797
> +#define CORDIC_PRECISION_SHIFT	16
> +#define CORDIC_NUM_ITER	(CORDIC_PRECISION_SHIFT + 2)
> +
> +#define CORDIC_FIXED(X)	((s32)((X) << CORDIC_PRECISION_SHIFT))
> +#define CORDIC_FLOAT(X)	(((X) >= 0) \
> +		? ((((X) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1) \
> +		: -((((-(X)) >> (CORDIC_PRECISION_SHIFT - 1)) + 1) >> 1))
> +#endif
>  #else
> 
>  /*
> --
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe backports" in
> 

--
To unsubscribe from this list: send the line "unsubscribe backports" in

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13  8:57 [PATCH] backport-include: add newly introduced macros in cordic.h Arend van Spriel
2019-03-13 20:33 ` Hauke Mehrtens

Backports Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/backports/0 backports/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 backports backports/ https://lore.kernel.org/backports \
		backports@vger.kernel.org backports@archiver.kernel.org
	public-inbox-index backports


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.backports


AGPL code for this site: git clone https://public-inbox.org/ public-inbox