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] [day] [month] [year] [list]
Date:	Mon, 17 Jan 2011 09:08:07 +0100
From:	walter harms <wharms@....de>
To:	Dan Carpenter <error27@...il.com>,
	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>,
	James Bottomley <James.Bottomley@...e.de>,
	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [patch] [SCSI] target: dubious one-bit signed bitfield



Am 15.01.2011 17:54, schrieb Dan Carpenter:
> On Sat, Jan 15, 2011 at 05:36:11PM +0100, walter harms wrote:
>>
>>
>> Am 15.01.2011 15:04, schrieb Dan Carpenter:
>>> The signed one-bit types can be 0 or -1 which can cause a problem if
>>> someone ever checks if (foo->lu_gp_assoc == 1).  The current code is
>>> fine because everyone just checks zero vs non-zero.  But Sparse
>>> complains about it so lets change it.  The warnings look like this:
>>>
>>
>> Your code looks ok,
>> but to avoid that kind of errors it may be better to use int here.
>>
> 
> I'm afraid I don't understand what you are saying.
> 

IMHO, it is better to just drop the bitfield. Most people expect int as return.

re,
 wh
--
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