diff mbox

linux-generic: netmap pktio fix clang build

Message ID 1446194130-18406-1-git-send-email-maxim.uvarov@linaro.org
State Accepted
Commit 5854d6f86f3742630161abeb4d2c8bf15f3ba16f
Headers show

Commit Message

Maxim Uvarov Oct. 30, 2015, 8:35 a.m. UTC
Cast to (void *) before casting to struct pointer to fix:
pktio/netmap.c:193:31: error: cast increases required alignment from 1 to 8
        struct dispatch_args *args = (struct dispatch_args *)arg;

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
---
 platform/linux-generic/pktio/netmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mike Holmes Oct. 30, 2015, 1:08 p.m. UTC | #1
On 30 October 2015 at 04:35, Maxim Uvarov <maxim.uvarov@linaro.org> wrote:

> Cast to (void *) before casting to struct pointer to fix:

> pktio/netmap.c:193:31: error: cast increases required alignment from 1 to 8

>         struct dispatch_args *args = (struct dispatch_args *)arg;

>

> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>

>


Reviewed-and-tested-by: Mike Holmes <Mike.holmes@linaro.org>


> ---

>  platform/linux-generic/pktio/netmap.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

>

> diff --git a/platform/linux-generic/pktio/netmap.c

> b/platform/linux-generic/pktio/netmap.c

> index 67ff95e..794c82e 100644

> --- a/platform/linux-generic/pktio/netmap.c

> +++ b/platform/linux-generic/pktio/netmap.c

> @@ -190,7 +190,7 @@ error:

>  static void netmap_recv_cb(u_char *arg, const struct nm_pkthdr *hdr,

>                            const u_char *buf)

>  {

> -       struct dispatch_args *args = (struct dispatch_args *)arg;

> +       struct dispatch_args *args = (struct dispatch_args *)(void *)arg;

>         pkt_netmap_t *pkt_nm = &args->pktio_entry->s.pkt_nm;

>         odp_packet_t pkt;

>         odp_packet_hdr_t *pkt_hdr;

> --

> 1.9.1

>

> _______________________________________________

> lng-odp mailing list

> lng-odp@lists.linaro.org

> https://lists.linaro.org/mailman/listinfo/lng-odp

>




-- 
Mike Holmes
Technical Manager - Linaro Networking Group
Linaro.org <http://www.linaro.org/> *│ *Open source software for ARM SoCs
Maxim Uvarov Oct. 30, 2015, 1:13 p.m. UTC | #2
Merged,
Maxim.

On 10/30/2015 16:08, Mike Holmes wrote:
>
>
> On 30 October 2015 at 04:35, Maxim Uvarov <maxim.uvarov@linaro.org 
> <mailto:maxim.uvarov@linaro.org>> wrote:
>
>     Cast to (void *) before casting to struct pointer to fix:
>     pktio/netmap.c:193:31: error: cast increases required alignment
>     from 1 to 8
>             struct dispatch_args *args = (struct dispatch_args *)arg;
>
>     Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org
>     <mailto:maxim.uvarov@linaro.org>>
>
>
> Reviewed-and-tested-by: Mike Holmes <Mike.holmes@linaro.org 
> <mailto:Mike.holmes@linaro.org>>
>
>     ---
>      platform/linux-generic/pktio/netmap.c | 2 +-
>      1 file changed, 1 insertion(+), 1 deletion(-)
>
>     diff --git a/platform/linux-generic/pktio/netmap.c
>     b/platform/linux-generic/pktio/netmap.c
>     index 67ff95e..794c82e 100644
>     --- a/platform/linux-generic/pktio/netmap.c
>     +++ b/platform/linux-generic/pktio/netmap.c
>     @@ -190,7 +190,7 @@ error:
>      static void netmap_recv_cb(u_char *arg, const struct nm_pkthdr *hdr,
>                                const u_char *buf)
>      {
>     -       struct dispatch_args *args = (struct dispatch_args *)arg;
>     +       struct dispatch_args *args = (struct dispatch_args *)(void
>     *)arg;
>             pkt_netmap_t *pkt_nm = &args->pktio_entry->s.pkt_nm;
>             odp_packet_t pkt;
>             odp_packet_hdr_t *pkt_hdr;
>     --
>     1.9.1
>
>     _______________________________________________
>     lng-odp mailing list
>     lng-odp@lists.linaro.org <mailto:lng-odp@lists.linaro.org>
>     https://lists.linaro.org/mailman/listinfo/lng-odp
>
>
>
>
> -- 
> Mike Holmes
> Technical Manager - Linaro Networking Group
> Linaro.org <http://www.linaro.org/>***│ *Open source software for ARM SoCs
>
diff mbox

Patch

diff --git a/platform/linux-generic/pktio/netmap.c b/platform/linux-generic/pktio/netmap.c
index 67ff95e..794c82e 100644
--- a/platform/linux-generic/pktio/netmap.c
+++ b/platform/linux-generic/pktio/netmap.c
@@ -190,7 +190,7 @@  error:
 static void netmap_recv_cb(u_char *arg, const struct nm_pkthdr *hdr,
 			   const u_char *buf)
 {
-	struct dispatch_args *args = (struct dispatch_args *)arg;
+	struct dispatch_args *args = (struct dispatch_args *)(void *)arg;
 	pkt_netmap_t *pkt_nm = &args->pktio_entry->s.pkt_nm;
 	odp_packet_t pkt;
 	odp_packet_hdr_t *pkt_hdr;