Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1111908pxf; Fri, 26 Mar 2021 01:02:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztKthUgzzWe4tjYpP6Vd74Sz5I4sYeITBxiVKXSY1UD7Q4SV9dLbweyYOhd7R0k/O8FXe2 X-Received: by 2002:a17:906:aac6:: with SMTP id kt6mr13989722ejb.260.1616745760296; Fri, 26 Mar 2021 01:02:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616745760; cv=none; d=google.com; s=arc-20160816; b=QgARGLrf7upH12nWKMV47Q+R+b8PD/POWvywnGbFNLnGVJ9CUifgR21zexUPoxZ0dx yQ8oMZNexyyUdqAkypwiFfF8idxErobd09o3mAWJSOhcMR6TeqZkBLp9y8z93Oc79QdW 44gMQo/fyhyHDxsokR1zx5Cu9PP8+Ixw3Pn+yLvuHZvNAZsmdK0ozJpeqJTUCaKCQH7I ZLjSaoS8ilUxwAv3G1njvgDN8nutl0ovjBqVjyHxHzbI2h9hnmoY07/fpAqU+56vqpnX /j2355MxUUkLEftG5ayweVWvDakHHlZuvu8JbieV0ntIzBwM+DffGz92V5XoWG7YkCuU 7sMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=vnVbGErkfdzCAjWerq+Uot388bDzJYQLccfLI/ZXY1I=; b=BYFUchBpCPNPunGyBP9v19MIQ5TAmxawGfuWy0Tb4SIYSkeoH6FSuXdY6JMV23fF7p ky5iNjHFkAYU8NzH4agvusoXan5O6JAsMDsuZzrUMz28M497YU5nz8GrT3A9DlmAySJ7 itG8Uy2TQQiyaHdzFKo8p2imPXr3GTgSMR4vJ47QPvzCvWy6tNfRS53Tcn7xcuj5J2n2 pOsZVzRAnNIiAJysSZ/0aMGYhoP1JOL1FfzOjpLJTqPX4/lq6ImuhAiKK1pCDOx0g5FS z3VHXFB5cye7pRkzXZTZJ8hTKFlZtDadtb7FotzRD2sCJbCEB3DJw/qUg47l+pFyF73N r2MQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si6024926ejr.284.2021.03.26.01.02.16; Fri, 26 Mar 2021 01:02:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229915AbhCZIBN (ORCPT + 99 others); Fri, 26 Mar 2021 04:01:13 -0400 Received: from mx2.suse.de ([195.135.220.15]:39128 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbhCZIAi (ORCPT ); Fri, 26 Mar 2021 04:00:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4B95CAE03; Fri, 26 Mar 2021 08:00:37 +0000 (UTC) Date: Fri, 26 Mar 2021 09:00:37 +0100 Message-ID: From: Takashi Iwai To: Muhammad Usama Anjum Cc: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, colin.king@canonical.com, dan.carpenter@oracle.com Subject: Re: [PATCH] ALSA: usb-audio: Don't store returned value and check for errors In-Reply-To: <20210325083641.GA644957@LEGION> References: <20210325083641.GA644957@LEGION> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Mar 2021 09:36:41 +0100, Muhammad Usama Anjum wrote: > > The returned value by create_autodetect_quirk isn't being used other > than in the success check on next line. Remove the return value > assignement. Check for error values instead of success check. > > Signed-off-by: Muhammad Usama Anjum > --- > sound/usb/quirks.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c > index 9e5e37eff10e..5ce5f4ecb9d0 100644 > --- a/sound/usb/quirks.c > +++ b/sound/usb/quirks.c > @@ -425,9 +425,9 @@ static int create_autodetect_quirks(struct snd_usb_audio *chip, > USB_CLASS_VENDOR_SPEC) > continue; > > - err = create_autodetect_quirk(chip, iface, driver); > - if (err >= 0) > - usb_driver_claim_interface(driver, iface, (void *)-1L); > + if (create_autodetect_quirk(chip, iface, driver) < 0) > + continue; > + usb_driver_claim_interface(driver, iface, (void *)-1L); Hm, basically this change is only for readability (the code optimization makes almost no sense), and the readability itself isn't improved significantly by this change, either. That is, I'm fine to take this, but OTOH, I see no compelling reason to do so... thanks, Takashi