Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752688AbYHWEzn (ORCPT ); Sat, 23 Aug 2008 00:55:43 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751286AbYHWEzh (ORCPT ); Sat, 23 Aug 2008 00:55:37 -0400 Received: from rhun.apana.org.au ([64.62.148.172]:59094 "EHLO arnor.apana.org.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751148AbYHWEzg (ORCPT ); Sat, 23 Aug 2008 00:55:36 -0400 Date: Sat, 23 Aug 2008 14:55:20 +1000 From: Herbert Xu To: Andrew Morton Cc: Karen Xie , netdev@vger.kernel.org, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, jgarzik@pobox.com, davem@davemloft.net, michaelc@cs.wisc.edu, swise@opengridcomputing.com, rdreier@cisco.com, daisyc@us.ibm.com, wenxiong@us.ibm.com, bhua@us.ibm.com, divy@chelsio.com, dm@chelsio.com, leedom@chelsio.com Subject: Re: [PATCH 1/4 2.6.28] cxgb3 - manage a private ip address for iSCSI Message-ID: <20080823045520.GA4759@gondor.apana.org.au> References: <200808221838.m7MIcW6a004400@localhost.localdomain> <20080822120851.c45a90f2.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080822120851.c45a90f2.akpm@linux-foundation.org> User-Agent: Mutt/1.5.13 (2006-08-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2425 Lines: 78 On Fri, Aug 22, 2008 at 07:08:51PM +0000, Andrew Morton wrote: > >> +static ssize_t iscsi_ipaddr_attr_store(struct device *d, >> + const char *buf, size_t len) >> +{ >> + struct port_info *pi = netdev_priv(to_net_dev(d)); >> + __be32 a = 0; > > There's not really any need to use __be32 in kernel code. Plain old > be23 is fine. Sorry but where is be32 defined? I couldn't find it in linux/types.h. Perhaps we should resurrect this patch from 2005? [PATCH] Add be*/le* types without underscores I've seen a number of patches that have started to use the __le*/__be* types within the kernel. Nice as they are, the underscores are really a bit of an eye sore. Since there seems to be no name conflict within the kernel, why don't we use them without the underscores like just as we do with types like u32? Here is a patch to do just that. I've verified that there are no conflicts by grepping the current git tree and then building it with the patch. Of course userspace won't see them since they're protected by #ifdef __KERNEL__. Signed-off-by: Herbert Xu diff --git a/fs/ntfs/types.h b/fs/ntfs/types.h index 8c8053b..79b44c7 100644 --- a/fs/ntfs/types.h +++ b/fs/ntfs/types.h @@ -25,9 +25,6 @@ #include -typedef __le16 le16; -typedef __le32 le32; -typedef __le64 le64; typedef __u16 __bitwise sle16; typedef __u32 __bitwise sle32; typedef __u64 __bitwise sle64; diff --git a/include/linux/types.h b/include/linux/types.h index d4a9ce6..61747dc 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -189,6 +189,15 @@ typedef __u16 __bitwise __sum16; typedef __u32 __bitwise __wsum; #ifdef __KERNEL__ +typedef __le16 le16; +typedef __be16 be16; +typedef __le32 le32; +typedef __be32 be32; +#if defined(__GNUC__) +typedef __le64 le64; +typedef __be64 be64; +#endif + typedef unsigned __bitwise__ gfp_t; #ifdef CONFIG_RESOURCES_64BIT Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/