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:	Thu, 02 Oct 2014 12:19:01 -0500
From:	Timur Tabi <timur@...i.org>
To:	German Rivera <German.Rivera@...escale.com>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Arnd Bergmann <arnd@...db.de>,
	lkml <linux-kernel@...r.kernel.org>, stuart.yoder@...escale.com,
	Kim Phillips <Kim.Phillips@...escale.com>,
	Scott Wood <scottwood@...escale.com>,
	Alexander Graf <agraf@...e.de>
Subject: Re: [PATCH 3/3 v2] drivers/bus: Device driver for FSL-MC DPRC devices

German Rivera wrote:
>>
> I know that this is not necessary from the point of view of C boolean
> semantics, but doing explicit comparison improves readability IMHO.

I guess we'll have to agree to disagree.  I think it makes the code less 
readable.

> Anyway, this is subjective and largely a matter of preference.
> Besides, "Documentation/CodingStyle" does not seem to advocate one way
> or the other.

CodingStyle is a starting point, not the final word.  If I had a dime 
whenever someone insisted a code snippet is okay because it's not 
covered by CodingStyle, I could retire.

> Also, I there is evidence that explicit comparisons are allowed in
> the kernel source tree:

Allowed != preferred.  Besides, there are tons of examples of almost 
every style mistake in the kernel today.  Some code is really old, or it 
was accepted by lazy maintainers and never fixed.  You can't really use 
that as a basis for a decision.


>>> +int __must_check dprc_scan_container(struct fsl_mc_device *mc_bus_dev);
>>> +
>>> +int __must_check dprc_scan_objects(struct fsl_mc_device *mc_bus_dev);
>>
>> __must_check?  Really?

> Yes, to ensure that callers that are not checking the return code from
> dprc_scan_objects() are caught at compile-time (CHECK time).

I know what __must_check is for.  I'm just saying that you kinda need to 
justify using it.  It's like using likely() on non-time-critical code. 
Overuse is worse than not using it at all, and I don't see what's so 
special about these functions that they need __must_check.

(on a side note, you're supposed to bcc: 
linuxppc-release@...ux.freescale.net, not cc: it.)
--
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