All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix libdvbv5 endianess function for embedded toolchains
@ 2012-08-21 18:58 Gregor Jasny
  2012-08-21 18:58 ` [PATCH] libdvbv5: Fix byte swapping " Gregor Jasny
  0 siblings, 1 reply; 3+ messages in thread
From: Gregor Jasny @ 2012-08-21 18:58 UTC (permalink / raw)
  To: linux-media; +Cc: prabhakar.lad, Gregor Jasny

Hello,

the following patch fixes compilation of libdvbv5 with the Code Sourcery
ARM toolchain. It replaces the missing be16toh and be32toh with the
available ntohs and ntohl.

IMHO the bswap16/32 macro names should be replaced because the current name
suggests unconditional swap regardless of the host architecture.

Thanks,
Gregor

Gregor Jasny (1):
  libdvbv5: Fix byte swapping for embedded toolchains

 lib/include/descriptors.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
1.7.10.4


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

* [PATCH] libdvbv5: Fix byte swapping for embedded toolchains
  2012-08-21 18:58 [PATCH] Fix libdvbv5 endianess function for embedded toolchains Gregor Jasny
@ 2012-08-21 18:58 ` Gregor Jasny
  2012-08-22  4:51   ` Prabhakar Lad
  0 siblings, 1 reply; 3+ messages in thread
From: Gregor Jasny @ 2012-08-21 18:58 UTC (permalink / raw)
  To: linux-media; +Cc: prabhakar.lad, Gregor Jasny

Reported-by: "Lad, Prabhakar" <prabhakar.lad@ti.com>
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
---
 lib/include/descriptors.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/include/descriptors.h b/lib/include/descriptors.h
index 9039014..a64370c 100644
--- a/lib/include/descriptors.h
+++ b/lib/include/descriptors.h
@@ -25,7 +25,7 @@
 #ifndef _DESCRIPTORS_H
 #define _DESCRIPTORS_H
 
-#include <endian.h>
+#include <arpa/inet.h>
 #include <unistd.h>
 #include <stdint.h>
 
@@ -46,11 +46,11 @@ extern char *default_charset;
 extern char *output_charset;
 
 #define bswap16(b) do {\
-	b = be16toh(b); \
+	b = ntohs(b); \
 } while (0)
 
 #define bswap32(b) do {\
-	b = be32toh(b); \
+	b = ntohl(b); \
 } while (0)
 
 struct dvb_desc {
-- 
1.7.10.4


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

* Re: [PATCH] libdvbv5: Fix byte swapping for embedded toolchains
  2012-08-21 18:58 ` [PATCH] libdvbv5: Fix byte swapping " Gregor Jasny
@ 2012-08-22  4:51   ` Prabhakar Lad
  0 siblings, 0 replies; 3+ messages in thread
From: Prabhakar Lad @ 2012-08-22  4:51 UTC (permalink / raw)
  To: Gregor Jasny; +Cc: linux-media

Hi Gregor,

Thanks for the patch.

On Wednesday 22 August 2012 12:28 AM, Gregor Jasny wrote:
> Reported-by: "Lad, Prabhakar" <prabhakar.lad@ti.com>
> Signed-off-by: Gregor Jasny <gjasny@googlemail.com>

  Acked-by: Prabhakar Lad <prabhakar.lad@ti.com>

Thx,
--Prabhakar

> ---
>  lib/include/descriptors.h |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/include/descriptors.h b/lib/include/descriptors.h
> index 9039014..a64370c 100644
> --- a/lib/include/descriptors.h
> +++ b/lib/include/descriptors.h
> @@ -25,7 +25,7 @@
>  #ifndef _DESCRIPTORS_H
>  #define _DESCRIPTORS_H
>  
> -#include <endian.h>
> +#include <arpa/inet.h>
>  #include <unistd.h>
>  #include <stdint.h>
>  
> @@ -46,11 +46,11 @@ extern char *default_charset;
>  extern char *output_charset;
>  
>  #define bswap16(b) do {\
> -	b = be16toh(b); \
> +	b = ntohs(b); \
>  } while (0)
>  
>  #define bswap32(b) do {\
> -	b = be32toh(b); \
> +	b = ntohl(b); \
>  } while (0)
>  
>  struct dvb_desc {
> 


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

end of thread, other threads:[~2012-08-22  4:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-21 18:58 [PATCH] Fix libdvbv5 endianess function for embedded toolchains Gregor Jasny
2012-08-21 18:58 ` [PATCH] libdvbv5: Fix byte swapping " Gregor Jasny
2012-08-22  4:51   ` Prabhakar Lad

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.