Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4172696ybg; Tue, 29 Oct 2019 03:17:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+w1/g0eQHa4wzZHf0yX4UpoAn/21swvK6AMxEmAuGjvylJYoyJt2ImvmSK3hHg7Rp+lAP X-Received: by 2002:aa7:d60c:: with SMTP id c12mr24079587edr.14.1572344239094; Tue, 29 Oct 2019 03:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572344239; cv=none; d=google.com; s=arc-20160816; b=XNi8v1uuOrgybRXiTxXQSs8470rySjRZ19M9o1AC+m3P/WVyTofxQ/aEKgbEP/DsDd bc3aeayb/JnbDG2+LYxZv8ckjdW8hTo7sTDcVz0YqF6CjAcztQNr8WjRPaFiS93JhzUO icXcSIatINE+OlAwvlaUEUxOvPY+1+2vwFroPre1uG2cTVv0niByPdx+1T+zZzfF9xLJ 3IyzXg8DKbP7Eq+PdRrglq4ZtK4pW+QSHUHCaxJ/i2/iF0VCua+19By6G2bh7KPj/PWi SdmUN5bpEek5N11LuEhuWT3uiPUWQkUI1TbsfZCk8EzxITpp19JrG+Oa/7g27mfO7TcX tq0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date; bh=RiLpSKKtQoB1DoQMn1/zGk4ul8lGpp7KQ8YwlN2XVHI=; b=F6+n6wiEpadfdLTAmxHlCz9HoKIuau4uoKdGUoc7MmbzR1xUoG7y9B1sd86YQf95rJ THjMqHHJriMk4wwg9iUrRmH7RgayTpgULbMhmckTnNZetANaBa0WE0Jpu2hDhxH0LK4b B8jCQ7BxTXv6Opl68umV0AgiDo2ex8wFaPsXA2m+gMYsxB9DCmMBxc3wbwB/ALByQrNH Jb+3S62+eQqC0b88j673DEZisNhBjZ11LVkCBb/LaZKvoCKXxX9+igv78IcqeL5PV2mb kGsnsTSD3E1WcmNnRMs2baubIFL3j9nXlQCr91e7vhBxTM2ER+7TMLeNVxIzpmnoh2Gn fzjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si10797965edv.82.2019.10.29.03.16.55; Tue, 29 Oct 2019 03:17:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730551AbfJ2JDU (ORCPT + 99 others); Tue, 29 Oct 2019 05:03:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:35266 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730528AbfJ2JDT (ORCPT ); Tue, 29 Oct 2019 05:03:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D521FAD8C; Tue, 29 Oct 2019 09:03:17 +0000 (UTC) Date: Tue, 29 Oct 2019 10:03:16 +0100 Message-ID: From: Takashi Iwai To: Saurav Girepunje Cc: perex@perex.cz, tiwai@suse.com, rfontana@redhat.com, gregkh@linuxfoundation.org, allison@lohutok.net, tglx@linutronix.de, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, saurav.girepunje@hotmail.com Subject: Re: [PATCH] usb: clock.c : usb true/false for bool return type In-Reply-To: <20191029083509.GA8293@saurav> References: <20191029083509.GA8293@saurav> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Oct 2019 09:35:11 +0100, Saurav Girepunje wrote: > > Use true/false for bool type return in uac_clock_source_is_valid(). > > Signed-off-by: Saurav Girepunje > --- > sound/usb/clock.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/sound/usb/clock.c b/sound/usb/clock.c > index 6b8c14f9b5d4..8b8ab83fac0d 100644 > --- a/sound/usb/clock.c > +++ b/sound/usb/clock.c > @@ -165,21 +165,21 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, > snd_usb_find_clock_source_v3(chip->ctrl_intf, source_id); > > if (!cs_desc) > - return 0; > + return false; > bmControls = le32_to_cpu(cs_desc->bmControls); > } else { /* UAC_VERSION_1/2 */ > struct uac_clock_source_descriptor *cs_desc = > snd_usb_find_clock_source(chip->ctrl_intf, source_id); > > if (!cs_desc) > - return 0; > + return false; > bmControls = cs_desc->bmControls; > } > > /* If a clock source can't tell us whether it's valid, we assume it is */ > if (!uac_v2v3_control_is_readable(bmControls, > UAC2_CS_CONTROL_CLOCK_VALID)) > - return 1; > + return true; > > err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR, > USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_IN, > @@ -191,10 +191,10 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, > dev_warn(&dev->dev, > "%s(): cannot get clock validity for id %d\n", > __func__, source_id); > - return 0; > + return false; > } > > - return !!data; > + return !!data ? true : false; This doesn't need the ternary operator here. Or drop "!!". (Actually it would work just return data without "!!" for bool type, but maybe it's still clearer to have it.) Also, please align the subject line with other commits. For USB-audio, it's "ALSA: usb-audio: Subject..." thanks, Takashi