lkml.org 
[lkml]   [2013]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] ALSA: intel8x0: Check return value before assigning
At Sun, 27 Jan 2013 17:40:02 +0100,
Emil Goode wrote:
>
> The first patch in this series changes the return type of function
> kvm_para_available to bool. In the function snd_intel8x0_inside_vm
> we now need to check it's return value before assigning a value to
> the result variable.
>
> Signed-off-by: Emil Goode <emilgoode@gmail.com>
> ---
> sound/pci/intel8x0.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
> index 3b9be75..fa9337e 100644
> --- a/sound/pci/intel8x0.c
> +++ b/sound/pci/intel8x0.c
> @@ -2982,7 +2982,7 @@ static int snd_intel8x0_inside_vm(struct pci_dev *pci)
> }
>
> /* detect KVM and Parallels virtual environments */
> - result = kvm_para_available();
> + result = kvm_para_available() ? 1 : 0;

This is superfluous. The conversion from bool to int works implicitly
like that.


Takashi


\
 
 \ /
  Last update: 2013-01-28 10:42    [W:0.083 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site