[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191029175200.GA7320@saurav>
Date: Tue, 29 Oct 2019 23:22:00 +0530
From: Saurav Girepunje <saurav.girepunje@...il.com>
To: perex@...ex.cz, tiwai@...e.com, allison@...utok.net,
rfontana@...hat.com, saurav.girepunje@...il.com,
tglx@...utronix.de, gregkh@...uxfoundation.org,
alsa-devel@...a-project.org, linux-kernel@...r.kernel.org
Cc: saurav.girepunje@...mail.com
Subject: [PATCH v1] ALSA: usb-audio: sound: usb: usb true/false for bool
return type
Use true/false for bool type return in uac_clock_source_is_valid().
Signed-off-by: Saurav Girepunje <saurav.girepunje@...il.com>
---
Changes in v1:
- Update the patch subject suggested by Takashi Iwai <tiwai@...e.de>
- 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
Powered by blists - more mailing lists