mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list@gmail.com>
To: Rob Herring <robh@kernel.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH 1/2] of: unittest: remove unneeded local return value variables
Date: Fri, 9 Mar 2018 17:28:12 -0800	[thread overview]
Message-ID: <7f0ab50a-8a57-799d-e620-4e7f4fdf039d@gmail.com> (raw)
In-Reply-To: <20180310000213.tonovc6n7jtknycj@rob-hp-laptop>

On 03/09/18 16:02, Rob Herring wrote:
> On Thu, Mar 08, 2018 at 02:39:04PM -0800, frowand.list@gmail.com wrote:
>> From: Frank Rowand <frank.rowand@sony.com>
>>
>> A common pattern in many unittest functions is to save the return
>> value of a function in a local variable, then test the value of
>> the local variable, without using that return value for any further
>> purpose.  Remove the local return value variable for these cases.
>>
>> A second common pattern is:
>>
>>    ret = some_test_function(many, parameters, ...);
>>    if (unittest(ret == 0, "error message format", ...))
>>       return;
>>
>> This pattern is more clear when the local variable 'ret' is used, due
>> to the long lines caused by the parameters to the test function and
>> the long format and data parameters of unittest().  The local
>> variable is retained in these cases.
>>
>> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
>> ---
>>  drivers/of/unittest.c | 89 ++++++++++++++-------------------------------------
>>  1 file changed, 24 insertions(+), 65 deletions(-)
> 
> Doesn't apply. What's it based on?
> 
> Rob
> 

Sorry, I guess I should have mentioned that.

Based on top of of_overlay_fdt_apply() v7 for 4.17.

It applies with or without Dan's "[PATCH] of: unittest: fix
an error test in of_unittest_overlay_8()", which made me notice
the common pattern.

-Frank

  reply	other threads:[~2018-03-10  1:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08 22:39 frowand.list
2018-03-08 22:39 ` [PATCH 2/2] of: unittest: local return value variable related cleanups frowand.list
2018-03-10  0:02 ` [PATCH 1/2] of: unittest: remove unneeded local return value variables Rob Herring
2018-03-10  1:28   ` Frank Rowand [this message]
2018-03-12 15:27     ` Rob Herring

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=7f0ab50a-8a57-799d-e620-4e7f4fdf039d@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /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

Powered by JetHome