Re: [PATCH 1/2] of: unittest: remove unneeded local return value variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 08, 2018 at 02:39:04PM -0800, frowand.list@xxxxxxxxx wrote:
> From: Frank Rowand <frank.rowand@xxxxxxxx>
> 
> 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@xxxxxxxx>
> ---
>  drivers/of/unittest.c | 89 ++++++++++++++-------------------------------------
>  1 file changed, 24 insertions(+), 65 deletions(-)

Doesn't apply. What's it based on?

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux