Re: [PATCH v3 2/2] Staging: bcm: InterfaceMisc.c: Outsourced doubled error checking

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

 



On Wed, Jun 11, 2014 at 09:44:31AM +0200, Matthias Beyer wrote:
> Signed-off-by: Matthias Beyer <mail@xxxxxxxxxxxxxxxx>
> ---
>  drivers/staging/bcm/InterfaceMisc.c | 74 ++++++++++++++++++-------------------
>  1 file changed, 35 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c
> index fff7d68..51f6e1f 100644
> --- a/drivers/staging/bcm/InterfaceMisc.c
> +++ b/drivers/staging/bcm/InterfaceMisc.c
> @@ -1,36 +1,49 @@
>  #include "headers.h"
>  
> +static int adapter_err_check(const struct bcm_interface_adapter *ad, int *err)

Boolean functions should have more clear names than this.  But also
don't make this a boolean, just return zero on success or the error
code.  This function is needlessly complicated.

Do preserve the error code:

	err = adapter_err_check(psIntfAdapter);
	if (err)
		return err;

Also, run your patches through checkpatch.pl before sending.

That said, I do like this function and how you are making the code more
readable as well as removing duplicate code.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux