lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0805162022050.13416-100000@netrider.rowland.org>
Date:	Fri, 16 May 2008 20:35:56 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	Harvey Harrison <harvey.harrison@...il.com>
cc:	Bryan Wu <cooloney@...nel.org>, Jie Zhang <jie.zhang@...log.com>,
	Oliver Neukum <oliver@...kum.org>, <david-b@...bell.net>,
	<greg@...ah.com>, <linux-usb@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RFC-PATCH] lib: add byteorder helpers for the aligned case

On Fri, 16 May 2008, Harvey Harrison wrote:

> Some users know the pointer they are writing to are aligned,
> rather than doing *(__le16 *)ptr = cpu_to_le16(val) add helpers
> wrapping this up that have the same convention as put_unaligned_le/be.
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@...il.com>
> ---
> Alan, as requested, I'm looking around a bit to see if there are actual
> users for this.  But it does make a nice complement to the unaligned
> versions.

This is great -- thanks!  I've wanted this sort of thing for a long
time.  There's a good chance that the SCSI core could make use of
it.  Try looking at the prep functions in sd.c and sr.c.

> +static inline void put_le16(u16 val, void *ptr)
> +{
> +	*(__le16 *)ptr = cpu_to_le16(val);
> +}

Is this able to do the byte rearrangement at compile time if val is a 
compile-time constant?  I imagine it would.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ