Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1334605

Re: [PATCH] Bluetooth: hci_uart: fix boolreturn.cocci warnings

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] Bluetooth: hci_uart: fix boolreturn.cocci warnings
Date 2016-02-15 18:10 +0100
Message-ID <r2uOS-3Y1-15@gated-at.bofh.it> (permalink)
References <r2uca-3qG-27@gated-at.bofh.it> <r2uca-3qG-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2016-02-16 at 00:25 +0800, kbuild test robot wrote:
> drivers/bluetooth/hci_mrvl.c:411:9-10: WARNING: return of 0/1 in
> function 'mrvl_fw_loaded' with return type bool
> 
>  Return statements in functions returning bool should use
>  true/false instead of 1/0.
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
> 
> CC: Ganapathi Bhat <gbhat@marvell.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
>  hci_mrvl.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/drivers/bluetooth/hci_mrvl.c
> +++ b/drivers/bluetooth/hci_mrvl.c
> @@ -408,9 +408,9 @@ static bool mrvl_fw_loaded(struct hci_ua
>  	struct fw_data *fw_data = mrvl->fwdata;
>  
>  	if ((get_cts(hu->tty)) || (fw_data->fw_loaded))
> -		return 1;
> +		return true;
>  	else
> -		return 0;
> +		return false;
>  }

Nicer might be

	return get_cts(hu->tty) || fw_data->fw_loaded;
 
>  /* Set the baud rate */

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] Bluetooth: hci_uart: Support firmware download for Marvell Amitkumar Karwar <akarwar@marvell.com> - 2016-02-15 16:40 +0100
  [PATCH] Bluetooth: hci_uart: fix boolreturn.cocci warnings kbuild test robot <lkp@intel.com> - 2016-02-15 17:30 +0100
    Re: [PATCH] Bluetooth: hci_uart: fix boolreturn.cocci warnings Joe Perches <joe@perches.com> - 2016-02-15 18:10 +0100

csiph-web