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]
Date:	Wed, 02 Jan 2008 14:18:27 +0200
From:	Boaz Harrosh <bharrosh@...asas.com>
To:	Christoph Hellwig <hch@...radead.org>
CC:	linux-kernel <linux-kernel@...r.kernel.org>,
	Andy Whitcroft <apw@...dowen.org>,
	Randy Dunlap <rdunlap@...otime.net>,
	Joel Schopp <jschopp@...tin.ibm.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: WARNING: do not add new typedefs - is that for real?

On Wed, Jan 02 2008 at 12:08 +0200, Christoph Hellwig <hch@...radead.org> wrote:
> On Tue, Jan 01, 2008 at 06:15:46PM +0200, Boaz Harrosh wrote:
>> I have this code:
>>
>> <c_code>
>> /* 
>>  * osd-r10 4.12.5 Data-In and Data-Out buffer offsets
>>  * byte offset = mantissa * (2^(exponent+8))
>>  */
>> typedef __be32 osd_cdb_offset;
> 
> Given that you can't do normal arithmetic on this type it should't
> really be a __be32 but it's own __bitwise type with proper accessors.
There are all the proper accessors, and arithmetic is certainly not possible.

> 
> But yes, this is one of the rare cases where a typedef makes sense,
> but �'d call it osd_off_t or something like that.
> 

You mean osd_cdb_offset_t. I thought of dropping that _t, I hate it,
just a personal preference.

Point taken about the typedef + __bitwise. Because with __bitwise we
tell the compiler that the new type is assembly equivalent to some type
but otherwise un-mixable and unique type. Checkpatch actually allows
it. Code fixed! Thanks Christoph.

Boaz

--
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