All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix warning on 32-bit systems
@ 2013-04-12  3:53 Aaron Carroll
  2013-04-12  3:55 ` Aaron Carroll
  2013-04-12  5:52 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Aaron Carroll @ 2013-04-12  3:53 UTC (permalink / raw)
  To: fio

Casting a uint64_t to a pointer emits a warning on 32 bit systems.
This patch fixes the warning, but seems a bit suspicious. Should the
type of 'tag' be uintptr_t ?

--

diff --git a/server.c b/server.c
index 9537c96..3c52083 100644
--- a/server.c
+++ b/server.c
@@ -293,7 +293,7 @@ struct fio_net_cmd *fio_net_recv_cmd(int sk)

 static void add_reply(uint64_t tag, struct flist_head *list)
 {
-       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *) tag;
+       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *)
(uintptr_t)tag;

        flist_add_tail(&reply->list, list);
 }
@@ -313,7 +313,7 @@ static uint64_t alloc_reply(uint64_t tag, uint16_t opcode)

 static void free_reply(uint64_t tag)
 {
-       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *) tag;
+       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *)
(uintptr_t)tag;

        free(reply);
 }

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

* Re: [PATCH] fix warning on 32-bit systems
  2013-04-12  3:53 [PATCH] fix warning on 32-bit systems Aaron Carroll
@ 2013-04-12  3:55 ` Aaron Carroll
  2013-04-12  5:52 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Aaron Carroll @ 2013-04-12  3:55 UTC (permalink / raw)
  To: fio

Sigh.... sorry about the line wrapping.

On 12 April 2013 13:53, Aaron Carroll <xaaronc@gmail.com> wrote:
> Casting a uint64_t to a pointer emits a warning on 32 bit systems.
> This patch fixes the warning, but seems a bit suspicious. Should the
> type of 'tag' be uintptr_t ?
>
> --
>
> diff --git a/server.c b/server.c
> index 9537c96..3c52083 100644
> --- a/server.c
> +++ b/server.c
> @@ -293,7 +293,7 @@ struct fio_net_cmd *fio_net_recv_cmd(int sk)
>
>  static void add_reply(uint64_t tag, struct flist_head *list)
>  {
> -       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *) tag;
> +       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *)
> (uintptr_t)tag;
>
>         flist_add_tail(&reply->list, list);
>  }
> @@ -313,7 +313,7 @@ static uint64_t alloc_reply(uint64_t tag, uint16_t opcode)
>
>  static void free_reply(uint64_t tag)
>  {
> -       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *) tag;
> +       struct fio_net_cmd_reply *reply = (struct fio_net_cmd_reply *)
> (uintptr_t)tag;
>
>         free(reply);
>  }

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

* Re: [PATCH] fix warning on 32-bit systems
  2013-04-12  3:53 [PATCH] fix warning on 32-bit systems Aaron Carroll
  2013-04-12  3:55 ` Aaron Carroll
@ 2013-04-12  5:52 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2013-04-12  5:52 UTC (permalink / raw)
  To: Aaron Carroll; +Cc: fio

On Fri, Apr 12 2013, Aaron Carroll wrote:
> Casting a uint64_t to a pointer emits a warning on 32 bit systems.
> This patch fixes the warning, but seems a bit suspicious. Should the
> type of 'tag' be uintptr_t ?

Thanks, applied. The tag is out of a command, so it's always 64-bits.

-- 
Jens Axboe


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

end of thread, other threads:[~2013-04-12  5:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-12  3:53 [PATCH] fix warning on 32-bit systems Aaron Carroll
2013-04-12  3:55 ` Aaron Carroll
2013-04-12  5:52 ` Jens Axboe

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.