Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4819036ybg; Tue, 29 Oct 2019 12:52:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrxHJShRR85CNrpfH33qyduP8/Lypvhg7q0hde0QzsP74QZpc/VZJDktkw8s4JIlWrp2LP X-Received: by 2002:a17:906:4d45:: with SMTP id b5mr5120782ejv.157.1572378771660; Tue, 29 Oct 2019 12:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572378771; cv=none; d=google.com; s=arc-20160816; b=C/5Plbqy0HN2kNz/FMl9fWF5XHbJwdcdq/6NiSdAn16das1jvvp/f3OM3SjuN2IiNI aQ3TKT5mXGNbNRzGyyg05PotRpmTI1NTPHiFyW+9nO/znAEbqUgaqy/2ApRPDo6gFz9S b/7gIfrrK6zAUbK/IvhjZGRF6xh9+d0xjpk54Ua7Ps+8alJ6HAHc/E5lqTcZjVD5u0sJ GQ4i99qR8OdsLm2pMALexMsM1/Ist2cM61f48Z89vKLWtF4NlXq5M03OyY3Kv0MLqwJC m2lu3hLlPXxZIzl2ltaK7XubUbrrFoRR2kxfQCfPVYQVIGFPxDzQfD3WThhRjEqFV/lO t+EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=WQuaGhw+j/L1GECLdxkL+IQAboSwYNwdTLYnLHvyPs8=; b=t3Hnvz8axhTn3QnwCSPGalDq+yz6YFD9CGiyIvVWY6k/jZzLi1Q2+V6FHI0yfHmTB+ 25v1mYL2LmgVMuPzHlJNmRb/gBPdpwJKlv24hHFMT919In6CibCundPdhKqcKAM1mqsa TYOlKGq7ZceZ4tP6KsqfLAlHC3aMuCTOOUO3ub0pvtu/sFfA3ejJeeX9ilE/Fc561xfK xqz4WWiff9+sVEtY+KF3sGhOZYYmD0oh/06KXGxaDzjQoFVjNjl6KKRZuhp4LvvdgImT xtDSnhHvzwVcq1IsQpXYHACPcNJ2zYtwdnAm8c1Z9Jj6P07+YJW80bZ5XlSfpbtjTPkw J7jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eMG+GuYW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qx10si8100920ejb.27.2019.10.29.12.52.28; Tue, 29 Oct 2019 12:52:51 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eMG+GuYW; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbfJ2RwK (ORCPT + 99 others); Tue, 29 Oct 2019 13:52:10 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46037 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbfJ2RwK (ORCPT ); Tue, 29 Oct 2019 13:52:10 -0400 Received: by mail-pg1-f194.google.com with SMTP id r1so10059608pgj.12 for ; Tue, 29 Oct 2019 10:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=WQuaGhw+j/L1GECLdxkL+IQAboSwYNwdTLYnLHvyPs8=; b=eMG+GuYW0OmhY6ro8Yeeu1abzM+LR/mzcdQEofubIIHWWpsksdJybinfj19OxIPIfV 2F/h4pVMuFWoK3OZR3aNK1N4LvBM7hwCpwHrGOrnTBTeA2l5MGwLpBXNxolXYTiNdsZi +r4xnfjZcf1F1AD7+FotPnmSKvKT7FJ9ke0Cx0M1wpcO019m9SRWj5DrvPDBk80byObM V8J6Fdc6HN4gB319c6v7TulUONDQuiWf8aCtAgkNddCyesnMvBkfqPdePR7LguFh3xTW Vr+atD2bGf7HMjywS1koa0GnrKT58QtG6hLSFE5+uuT4djFo80FRXdp2bYwLJ61Wuars jJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=WQuaGhw+j/L1GECLdxkL+IQAboSwYNwdTLYnLHvyPs8=; b=SfhF7WhEsPl1nPtQ8IT49I4NkNQaHEBqtr5yQfrsTWD0Car70YecyxuxlDLo9y2+mZ p7bv7TOnJYvRQ3D6rbXo1fH7oAR2iGI2gDHgdNEpuCD9Zt5CCKxVoay3wKRbfwEJG8+Q nK+wmX2g2No/+JNNbD6HJsu2iTO+iVmsQCZt3Ua1JGAamuaTQrXUdAknaiJmMgyHgDvt a2AJWFMKJ5TSsPpCIct1J7xO94tIYqmOTPNXBkuJj1c55/cYEds2MA2CLBW3lCta+/7V Ukj56aGWYBIwlqXaQbd08b3w9vnmyXPqRHObR24TRhAsUJU81K1gTeXnI00xXktuRzky Y8dw== X-Gm-Message-State: APjAAAVSpv5Vav4boDNAWDqvkqiX04OEpF5/4T74QYrIgM8cguxji8wz izfJZKHkfB1mfMnqBwdv4fA= X-Received: by 2002:a17:90a:1424:: with SMTP id j33mr8490846pja.2.1572371528296; Tue, 29 Oct 2019 10:52:08 -0700 (PDT) Received: from saurav ([117.232.226.35]) by smtp.gmail.com with ESMTPSA id m17sm8901042pfh.79.2019.10.29.10.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Oct 2019 10:52:07 -0700 (PDT) Date: Tue, 29 Oct 2019 23:22:00 +0530 From: Saurav Girepunje To: perex@perex.cz, tiwai@suse.com, allison@lohutok.net, rfontana@redhat.com, saurav.girepunje@gmail.com, tglx@linutronix.de, gregkh@linuxfoundation.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: saurav.girepunje@hotmail.com Subject: [PATCH v1] ALSA: usb-audio: sound: usb: usb true/false for bool return type Message-ID: <20191029175200.GA7320@saurav> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use true/false for bool type return in uac_clock_source_is_valid(). Signed-off-by: Saurav Girepunje --- Changes in v1: - Update the patch subject suggested by Takashi Iwai - Drop "!!" but keep the ternary operator in last return statement so that function will return always true/false. 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 72e9bdf76115..8d5538063598 100644 --- a/sound/usb/clock.c +++ b/sound/usb/clock.c @@ -167,21 +167,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, @@ -193,10 +193,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; } static int __uac_clock_find_source(struct snd_usb_audio *chip, int entity_id, -- 2.20.1