From: Cyrill Gorcunov <gorcunov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Harvey Harrison
<harvey.harrison-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
LKML <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-arch <linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
David Howells <dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Linus Torvalds
<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: Re: [PATCH 1/2] kernel: add common infrastructure for unaligned access
Date: Sat, 12 Apr 2008 00:22:38 +0400 [thread overview]
Message-ID: <20080411202238.GB9108@cvg> (raw)
In-Reply-To: <1207885137.22001.86.camel@brick>
[Harvey Harrison - Thu, Apr 10, 2008 at 08:38:57PM -0700]
[...]
| +
| +static inline void __put_unaligned_be16(u16 val, u8 *p)
| +{
| + *p++ = val >> 8;
| + *p++ = val;
| +}
| +
[...]
| +static inline void __put_unaligned_le16(u16 val, u8 *p)
| +{
| + *p++ = val;
| + *p++ = val >> 8;
| +}
[...]
Hi Harvey, do we really need second increments? I mean, wouldn't
be better to use *p = val >> 8 and *p << 8?
- Cyrill -
WARNING: multiple messages have this Message-ID (diff)
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-arch <linux-arch@vger.kernel.org>,
David Howells <dhowells@redhat.com>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 1/2] kernel: add common infrastructure for unaligned access
Date: Sat, 12 Apr 2008 00:22:38 +0400 [thread overview]
Message-ID: <20080411202238.GB9108@cvg> (raw)
Message-ID: <20080411202238.tUHa21YxZgscLlWv8smufPw2vMsHIrx3L8hRrw1wook@z> (raw)
In-Reply-To: <1207885137.22001.86.camel@brick>
[Harvey Harrison - Thu, Apr 10, 2008 at 08:38:57PM -0700]
[...]
| +
| +static inline void __put_unaligned_be16(u16 val, u8 *p)
| +{
| + *p++ = val >> 8;
| + *p++ = val;
| +}
| +
[...]
| +static inline void __put_unaligned_le16(u16 val, u8 *p)
| +{
| + *p++ = val;
| + *p++ = val >> 8;
| +}
[...]
Hi Harvey, do we really need second increments? I mean, wouldn't
be better to use *p = val >> 8 and *p << 8?
- Cyrill -
next prev parent reply other threads:[~2008-04-11 20:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-11 3:38 [PATCH 1/2] kernel: add common infrastructure for unaligned access Harvey Harrison
2008-04-11 3:38 ` Harvey Harrison
2008-04-11 20:22 ` Cyrill Gorcunov [this message]
2008-04-11 20:22 ` Cyrill Gorcunov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080411202238.GB9108@cvg \
--to=gorcunov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=harvey.harrison-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-arch-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox