public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Chris Leech <christopher.leech@intel.com>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	Harvey Harrison <harvey.harrison@gmail.com>
Subject: Re: [PATCH] 24-bit types: typedef and functions for accessing 3-byte arrays as integers
Date: Wed, 10 Sep 2008 15:57:12 +0300	[thread overview]
Message-ID: <48C7C428.5090209@panasas.com> (raw)
In-Reply-To: <20080909225930.19495.64220.stgit@localhost.localdomain>

Chris Leech wrote:
> Both iSCSI and Fibre Channel make use of 24-bit big-endian values in
> frame headers.  This patch defines __be24 and __le24 typedefs for a
> structure wrapped around a 3-byte array, and functions to convert back and
> forth to a 32-bit integer.
> 
> The undefs in iscsi_proto.h are because of the different calling
> convention for the existing hton24 macro in the iSCSI code.  iSCSI will
> be converted in a subsequent patch.
> 
> Changes from last posting:
> 
> Switched from preprocessor macros to inline functions.  The generated assembly
> is the same with gcc 4.1.2 as long as the function is actually inlined.  I
> applied the __always_inline attribute to all of these, after seeing that with
> one of my test kernel configurations they were not being inlined without it
> and the generated instructions in the iSCSI code could be considered a
> regression from the existing macro.
> 
> Signed-off-by: Chris Leech <christopher.leech@intel.com>
> ---
> 
>  include/linux/byteorder.h         |   44 ++++++++++++++++++++++++++++++++++++
>  include/linux/byteorder/generic.h |   45 +++++++++++++++++++++++++++++++++++++
>  include/linux/types.h             |    2 ++
>  include/scsi/iscsi_proto.h        |    2 ++
>  4 files changed, 93 insertions(+), 0 deletions(-)
> 
<snip>

Thanks! Personally I like this much better.

Sorry to be nit picking but again I hate that double implementation thing.
>From what I could see, and considering a few of the ARCHs you mentioned,
it looks to me like <linux/swab.h> is common to the two implementations,
(old and new). Perhaps put the "__xxx" implementations in swab.h and
only the xxx => __xxx switching in the double byteorder headers, which
fits better with the surrounding style of these headers. 

Thanks
Boaz

  reply	other threads:[~2008-09-10 12:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-05 16:57 [PATCH 1/3] 24-bit types: typedef and macros for accessing 3-byte arrays as integers Chris Leech
     [not found] ` <20080905165732.16689.50256.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-09-05 16:57   ` [PATCH 2/3] 24-bit types: convert iSCSI to use the __be24 type and macros Chris Leech
     [not found]     ` <20080905165738.16689.31487.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-09-05 17:03       ` Mike Christie
2008-09-05 16:57   ` [PATCH 3/3] 24-bit types: Convert Open-FCoE to use " Chris Leech
2008-09-07  9:36 ` [PATCH 1/3] 24-bit types: typedef and macros for accessing 3-byte arrays as integers Boaz Harrosh
2008-09-07 15:56   ` Chris Leech
2008-09-07 17:21     ` Boaz Harrosh
2008-09-07 17:52       ` Chris Leech
2008-09-09 22:59         ` [PATCH] 24-bit types: typedef and functions " Chris Leech
2008-09-10 12:57           ` Boaz Harrosh [this message]
2008-09-07  9:57 ` [PATCH 1/3] 24-bit types: typedef and macros " Boaz Harrosh
2008-09-10 14:07 ` Christoph Hellwig
2008-09-10 15:40   ` Dave Kleikamp
2008-09-10 16:11     ` [PATCH " Boaz Harrosh
2008-09-10 16:25       ` Boaz Harrosh
     [not found]       ` <48C7F19D.3080507-C4P08NqkoRlBDgjK7y7TUQ@public.gmane.org>
2008-09-10 19:20         ` Dave Kleikamp
2008-09-11  8:30           ` Boaz Harrosh
2008-09-11  1:51       ` Chris Leech
2008-09-10 16:25     ` Chris Leech
2008-09-10 17:45       ` [Open-FCoE] " Chris Leech
2008-09-10 18:04         ` Boaz Harrosh
2008-09-10 18:23         ` Dave Kleikamp

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=48C7C428.5090209@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=christopher.leech@intel.com \
    --cc=harvey.harrison@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.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