From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88656CA9EAE for ; Tue, 29 Oct 2019 09:03:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 550412083E for ; Tue, 29 Oct 2019 09:03:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730565AbfJ2JDU (ORCPT ); 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