From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [RFC 11/12] ib-mgmt: move ntohll/htonll from mad.h to umad.h Date: Sat, 23 Oct 2010 13:12:24 -0600 Message-ID: <20101023191224.GC10883@obsidianresearch.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Hefty, Sean" Cc: "linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Sasha Khapyorsky , Hal Rosenstock , Ira Weiny List-Id: linux-rdma@vger.kernel.org On Sat, Oct 23, 2010 at 12:12:58AM -0700, Hefty, Sean wrote: > +#if __BYTE_ORDER == __LITTLE_ENDIAN > + #ifndef ntohll > + #define ntohll(x) bswap_64(x) > + #endif > +#elif __BYTE_ORDER == __BIG_ENDIAN > + #ifndef ntohll > + #define ntohll(x) (x) > + #endif > +#endif > +#ifndef htonll > + #define htonll ntohll > +#endif > + The inline verions of these had the advantage that they enforce the type, particularly on BE systems, it is a nice check to have.. Jason -- 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