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=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 75EA9C64E75 for ; Fri, 27 Nov 2020 09:47:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 28F4B221F7 for ; Fri, 27 Nov 2020 09:47:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728161AbgK0JrQ (ORCPT ); Fri, 27 Nov 2020 04:47:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726802AbgK0JrQ (ORCPT ); Fri, 27 Nov 2020 04:47:16 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D556C0613D1 for ; Fri, 27 Nov 2020 01:47:15 -0800 (PST) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kiaKC-0005UC-C7; Fri, 27 Nov 2020 10:45:56 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1kiaK4-0002Ad-OH; Fri, 27 Nov 2020 10:45:48 +0100 Date: Fri, 27 Nov 2020 10:45:47 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Geert Uytterhoeven Cc: Geoff Levand , Jaroslav Kysela , Takashi Iwai , Michael Ellerman , Jens Axboe , Jim Paris , Arnd Bergmann , Greg Kroah-Hartman , "David S. Miller" , Jakub Kicinski , "James E.J. Bottomley" , "Martin K. Petersen" , Alan Stern , Bartlomiej Zolnierkiewicz , Benjamin Herrenschmidt , Paul Mackerras , linuxppc-dev , ALSA Development Mailing List , linux-block@vger.kernel.org, netdev , scsi , USB list , DRI Development , Linux Fbdev development list Subject: Re: [PATCH 1/2] ALSA: ppc: drop if block with always false condition Message-ID: <20201127094547.4zcyeycfrriitkqx@pengutronix.de> References: <20201126165950.2554997-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="taccm5e5wyznne4d" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-fbdev@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org --taccm5e5wyznne4d Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 27, 2020 at 09:35:39AM +0100, Geert Uytterhoeven wrote: > Hi Uwe, >=20 > On Thu, Nov 26, 2020 at 6:03 PM Uwe Kleine-K=F6nig > wrote: > > The remove callback is only called for devices that were probed > > successfully before. As the matching probe function cannot complete > > without error if dev->match_id !=3D PS3_MATCH_ID_SOUND, we don't have to > > check this here. > > > > Signed-off-by: Uwe Kleine-K=F6nig >=20 > Thanks for your patch! >=20 > Reviewed-by: Geert Uytterhoeven >=20 > Note that there are similar checks in snd_ps3_driver_probe(), which > can be removed, too: >=20 > if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1))) > return -ENODEV; > if (WARN_ON(dev->match_id !=3D PS3_MATCH_ID_SOUND)) > return -ENODEV; I had to invest some brain cycles here. For the first: Assuming firmware_has_feature(FW_FEATURE_PS3_LV1) always returns the same value, snd_ps3_driver_probe is only used after this check succeeds because the driver is registered only after this check in snd_ps3_init(). The second is superflous because ps3_system_bus_match() yields false if this doesn't match the driver's match_id. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --taccm5e5wyznne4d Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl/AyscACgkQwfwUeK3K 7AmVbAf/fRHKZiIEMqPckqCjNor4UCILZvO1NJYHzctpPGBT8dETRjBW1ZmWu6MS qxv4y7aGSfc8pP5G0LU1rJJYOf7x8PpHEbm5uNM1UOIxzSIniALG7VIeoFIBrGoQ QuMcTv73n6ypzsNu87ynqrILEVYNrubD+Sb6B2xZEfPbIcvvwKfUvr8+lBEkabHX LbBbYbLL/ivRvUFm/YKvY3vcnTTAj88lURLp6V8EPT+8/TDr7Bfuy5LyjFsKAYsq QXNTBRLT8unlG99XvN4urWFVs9NMPKKWgV/e14LGumeL+mM8EQi+UPCnMTPOErWb F4a+SZgp6g00Syvd8mJVlWUKEkQUOg== =P7Le -----END PGP SIGNATURE----- --taccm5e5wyznne4d--