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: <462FC139.3040703@genesi-usa.com>
Date:	Wed, 25 Apr 2007 21:59:37 +0100
From:	Matt Sealey <matt@...esi-usa.com>
To:	Kristen Carlson Accardi <kristen.c.accardi@...el.com>
CC:	Olivier Galibert <galibert@...ox.com>,
	Alan Cox <alan@...rguk.ukuu.org.uk>, jeff@...zik.org,
	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	linux-ide@...r.kernel.org, htejun@...il.com
Subject: Re: [patch 1/7] libata: check for AN support



Kristen Carlson Accardi wrote:
> On Wed, 25 Apr 2007 20:16:51 +0100
> Matt Sealey <matt@...esi-usa.com> wrote:
> 
>>> +#define ata_id_has_AN(id)	\
>>> +	( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \
>>> +	  ((id)[78] & (1 << 5)) )
>> ??
>>
>>> --- 2.6-git.orig/include/linux/libata.h
>>> +++ 2.6-git/include/linux/libata.h
>>> @@ -136,6 +136,7 @@ enum {
>>>  	ATA_DFLAG_CDB_INTR	= (1 << 2), /* device asserts INTRQ when ready for CDB */
>>>  	ATA_DFLAG_NCQ		= (1 << 3), /* device supports NCQ */
>>>  	ATA_DFLAG_FLUSH_EXT	= (1 << 4), /* do FLUSH_EXT instead of FLUSH */
>>> +	ATA_DFLAG_AN		= (1 << 5), /* device supports Async notification */
>>>  	ATA_DFLAG_CFG_MASK	= (1 << 8) - 1,
>> Why don't the macros use the enums? It makes the code hard to read without
>> painful cross-reference doesn't it? Surely (id)[76] & (ATA_DFLAG_AN) is a
>> lot more readable than 1 << 5 - even if the flag is obviously that, a lot
>> of values and registers can have 1 << 5 as a flag and mean a lot of different
>> things.
> 
> It's really just a coincidence that the ATA_DFLAG_AN bit is the same as the bit
> in the identify device word, so this would not be appropriate.

Okay, that makes sense.. I just had a bad day cross-referencing some terrible
code in another project, was in the mood to nit :D

-- 
Matt Sealey <matt@...esi-usa.com>
Genesi, Manager, Developer Relations
-
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