Re: [Qemu-devel] [PATCH 05/14] nbd/client: Drop pointless buf variable

2018-12-05 Thread Eric Blake
On 12/5/18 10:38 AM, Vladimir Sementsov-Ogievskiy wrote: -    magic = ldq_be_p(buf); +    magic = be64_to_cpu(magic); Isn't it better to use be64_to_cpus? No. We're intentionally getting rid of that because of clang; see commit 80c7c2b0. Ok, thanks. In this case it should be safe, but i

Re: [Qemu-devel] [PATCH 05/14] nbd/client: Drop pointless buf variable

2018-12-05 Thread Vladimir Sementsov-Ogievskiy
05.12.2018 19:29, Eric Blake wrote: > On 12/5/18 9:59 AM, Vladimir Sementsov-Ogievskiy wrote: >> 01.12.2018 1:03, Eric Blake wrote: >>> There's no need to read into a temporary buffer (oversized >>> since commit 7d3123e1) followed by a byteswap into a uint64_t >>> to check for a magic number via me

Re: [Qemu-devel] [PATCH 05/14] nbd/client: Drop pointless buf variable

2018-12-05 Thread Eric Blake
On 12/5/18 9:59 AM, Vladimir Sementsov-Ogievskiy wrote: 01.12.2018 1:03, Eric Blake wrote: There's no need to read into a temporary buffer (oversized since commit 7d3123e1) followed by a byteswap into a uint64_t to check for a magic number via memcmp(), when the code immediately below demonstrat

Re: [Qemu-devel] [PATCH 05/14] nbd/client: Drop pointless buf variable

2018-12-05 Thread Vladimir Sementsov-Ogievskiy
01.12.2018 1:03, Eric Blake wrote: > There's no need to read into a temporary buffer (oversized > since commit 7d3123e1) followed by a byteswap into a uint64_t > to check for a magic number via memcmp(), when the code > immediately below demonstrates reading into the uint64_t then > byteswapping in

Re: [Qemu-devel] [PATCH 05/14] nbd/client: Drop pointless buf variable

2018-11-30 Thread Eric Blake
On 11/30/18 4:30 PM, Richard W.M. Jones wrote: On Fri, Nov 30, 2018 at 04:03:34PM -0600, Eric Blake wrote: There's no need to read into a temporary buffer (oversized since commit 7d3123e1) followed by a byteswap into a uint64_t to check for a magic number via memcmp(), when the code immediately

Re: [Qemu-devel] [PATCH 05/14] nbd/client: Drop pointless buf variable

2018-11-30 Thread Richard W.M. Jones
On Fri, Nov 30, 2018 at 04:03:34PM -0600, Eric Blake wrote: > There's no need to read into a temporary buffer (oversized > since commit 7d3123e1) followed by a byteswap into a uint64_t > to check for a magic number via memcmp(), when the code > immediately below demonstrates reading into the uint64

[Qemu-devel] [PATCH 05/14] nbd/client: Drop pointless buf variable

2018-11-30 Thread Eric Blake
There's no need to read into a temporary buffer (oversized since commit 7d3123e1) followed by a byteswap into a uint64_t to check for a magic number via memcmp(), when the code immediately below demonstrates reading into the uint64_t then byteswapping in place and checking for a magic number via in