* libibnetdisc: fix cast in unmarshall16
@ 2010-07-26 18:40 Hefty, Sean
[not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25A8D7F5F5-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Hefty, Sean @ 2010-07-26 18:40 UTC (permalink / raw)
To: Sasha Khapyorsky
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org
Uri Habusha reported a build error on windows as a result of an
incorrect cast to uint64_t.
Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
.../libibnetdisc/src/ibnetdisc_cache.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
index 1de42eb..199bf33 100644
--- a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
+++ b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
@@ -183,8 +183,7 @@ static size_t _unmarshall8(uint8_t * inbuf, uint8_t * num)
static size_t _unmarshall16(uint8_t * inbuf, uint16_t * num)
{
- (*num) = (uint64_t) inbuf[0];
- (*num) |= ((uint16_t) inbuf[1] << 8);
+ (*num) = ((uint16_t) inbuf[1] << 8) | inbuf[0];
return (sizeof(*num));
}
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: libibnetdisc: fix cast in unmarshall16
[not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25A8D7F5F5-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2010-07-26 19:01 ` Sasha Khapyorsky
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Khapyorsky @ 2010-07-26 19:01 UTC (permalink / raw)
To: Hefty, Sean
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org, Albert Chu
On 11:40 Mon 26 Jul , Hefty, Sean wrote:
> Uri Habusha reported a build error on windows as a result of an
> incorrect cast to uint64_t.
>
> Signed-off-by: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Applied. Thanks.
Sasha
> ---
> .../libibnetdisc/src/ibnetdisc_cache.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
> index 1de42eb..199bf33 100644
> --- a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
> +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
> @@ -183,8 +183,7 @@ static size_t _unmarshall8(uint8_t * inbuf, uint8_t * num)
>
> static size_t _unmarshall16(uint8_t * inbuf, uint16_t * num)
> {
> - (*num) = (uint64_t) inbuf[0];
> - (*num) |= ((uint16_t) inbuf[1] << 8);
> + (*num) = ((uint16_t) inbuf[1] << 8) | inbuf[0];
>
> return (sizeof(*num));
> }
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-26 19:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26 18:40 libibnetdisc: fix cast in unmarshall16 Hefty, Sean
[not found] ` <CF9C39F99A89134C9CF9C4CCB68B8DDF25A8D7F5F5-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2010-07-26 19:01 ` Sasha Khapyorsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox