public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@tabi.org>
To: German Rivera <German.Rivera@freescale.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	lkml <linux-kernel@vger.kernel.org>,
	stuart.yoder@freescale.com,
	Kim Phillips <Kim.Phillips@freescale.com>,
	Scott Wood <scottwood@freescale.com>,
	Alexander Graf <agraf@suse.de>
Subject: Re: [PATCH 3/3 v2] drivers/bus: Device driver for FSL-MC DPRC devices
Date: Thu, 02 Oct 2014 12:19:01 -0500	[thread overview]
Message-ID: <542D8905.2070004@tabi.org> (raw)
In-Reply-To: <542D7F16.4000304@freescale.com>

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@linux.freescale.net, not cc: it.)

  reply	other threads:[~2014-10-02 17:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 22:49 [PATCH 0/3 v2] drivers/bus: Freescale Management Complex bus driver patch series J. German Rivera
2014-09-19 22:49 ` [PATCH 1/3 v2] drivers/bus: Added Freescale Management Complex APIs J. German Rivera
2014-09-24  0:49   ` Kim Phillips
2014-09-25  2:23     ` German Rivera
2014-09-25  3:40       ` Kim Phillips
2014-09-25 15:44         ` German Rivera
2014-09-25 16:16           ` Scott Wood
2014-09-25 16:44             ` German Rivera
2014-09-25 20:05               ` Scott Wood
2014-09-19 22:49 ` [PATCH 2/3 v2] drivers/bus: Freescale Management Complex (fsl-mc) bus driver J. German Rivera
2014-09-19 22:49 ` [PATCH 3/3 v2] drivers/bus: Device driver for FSL-MC DPRC devices J. German Rivera
2014-10-01  2:19   ` Timur Tabi
2014-10-01  2:27     ` Scott Wood
2014-10-01  2:35       ` Timur Tabi
2014-10-02 16:36     ` German Rivera
2014-10-02 17:19       ` Timur Tabi [this message]
2014-09-22 16:53 ` [PATCH 0/3 v2] drivers/bus: Freescale Management Complex bus driver patch series Kim Phillips
2014-09-22 17:59   ` Stuart Yoder
2014-09-22 22:03     ` Kim Phillips
2014-09-23 14:52     ` German Rivera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=542D8905.2070004@tabi.org \
    --to=timur@tabi.org \
    --cc=German.Rivera@freescale.com \
    --cc=Kim.Phillips@freescale.com \
    --cc=agraf@suse.de \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=scottwood@freescale.com \
    --cc=stuart.yoder@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox