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.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 BCE1FC2D0E4 for ; Tue, 24 Nov 2020 12:20:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F83220708 for ; Tue, 24 Nov 2020 12:20:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387542AbgKXMTy (ORCPT ); Tue, 24 Nov 2020 07:19:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387521AbgKXMTy (ORCPT ); Tue, 24 Nov 2020 07:19:54 -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 AE5AAC0613D6 for ; Tue, 24 Nov 2020 04:19:53 -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 1khXIQ-0001FJ-1W; Tue, 24 Nov 2020 13:19:46 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1khXIO-0005Ik-NF; Tue, 24 Nov 2020 13:19:44 +0100 Date: Tue, 24 Nov 2020 13:19:43 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Arnd Bergmann Cc: Rob Herring , Ulf Hansson , Arnd Bergmann , Greg Kroah-Hartman , Linus Walleij , Russell King , "linux-kernel@vger.kernel.org" , Sascha Hauer , Linux ARM Subject: Re: [PATCH 3/4] amba: Make the remove callback return void Message-ID: <20201124121943.72etfmpubis6jw3l@pengutronix.de> References: <20201124103242.2971199-1-u.kleine-koenig@pengutronix.de> <20201124103242.2971199-3-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zq5jbqs3ok2srepm" 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-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --zq5jbqs3ok2srepm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 24, 2020 at 12:48:05PM +0100, Arnd Bergmann wrote: > On Tue, Nov 24, 2020 at 11:32 AM Uwe Kleine-K=F6nig > wrote: > > > > Most amba drivers return 0 in their remove callback. Together with the > > driver core ignoring the return value anyhow, it doesn't make sense to > > return a value here. > > > > So add a warning to the only driver that could return an error code and > > change the remove prototype to return void, which makes it explicit that > > returning an error value doesn't work as expected. This simplifies chan= ging > > the core remove callback to return void, too. > > > > Signed-off-by: Uwe Kleine-K=F6nig >=20 > Makes sense, I checked that the vfio driver cannot actually return an err= or > either, the 'if (vdev)' check seems to be done out of unnecessary caution, > as the probe would never have succeeded if that was NULL. Yes I thought this possible, but didn't tried to wrap my head around the logic there. IMHO this warrants a cleanup, will address this in v2. Thanks for your feedback, Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --zq5jbqs3ok2srepm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl+8+lwACgkQwfwUeK3K 7Al8rwf/UqPq57uXKYh4PV+Y3o/wPKv35dYocyH9HfrXmi0+4MtUV4p2WRSj/w5y SJwUJWSlCHHS4E/htNSAGeMU/4uWQ0hWCVDJeEenPaP7RFC8UZwePSwQw9XM7uL/ y+DL+yyCxIBtRX7+hbhmMOJqa2Dzmr1XzcFCzRddOOrtRriUQ2LA9tLI8Ql6fuMg i/nb84oyw70yHBxqON9d3zOLNFDj+PHxjXaWuKP/GpjqpdcXLpnkn0yCndR6te8c qLpsaDfp6/zA18K22t7yfQu251Qd9OUpbOnaCtTEDUeTJtQ6hzYH1QlZwaLwNCeu +gxFJj3v0yXphIMpmUGRT3IlhTtbVA== =qTCK -----END PGP SIGNATURE----- --zq5jbqs3ok2srepm-- 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.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 90EBFC2D0E4 for ; Tue, 24 Nov 2020 12:21:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0C68E20708 for ; Tue, 24 Nov 2020 12:21:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IzbyklGr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C68E20708 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hkb4SfuiVGtuMKkfXx7Z2mM/uvEFQMK5GlBphvJOP2M=; b=IzbyklGrGka04wpnNpdJ1Wrok 3iSWnZM1JSrooj84wRhz6mEpG5mDncaJeD6k+LkA94fU3DKRzH5WwVBt+AQfsDlcixQ3oouCTyQJS mQGsojUdyqmWRpgCxdIiB3SHx4EoAVGnX4Y9YUwv4ivErbYk8KJLf0eiONZ5EgJtxT2uklU5iGKkZ I7OKB5bRmromyRl4T/DcnNa/fGg829BXXK76hniGnBZiNMsLM3pr9jg/SLvb3JdtjkthmmdgWiGXy t9fpm77v3J3prNLw3/RwxWrdWu2MgqZxSJhWOsGsTqSSCrHftjQrlbNirlbUVzIlmnw7dDGtsV4g3 QlMMeJDAw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khXIa-00012y-EU; Tue, 24 Nov 2020 12:19:56 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khXIX-00012B-4E for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2020 12:19:54 +0000 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 1khXIQ-0001FJ-1W; Tue, 24 Nov 2020 13:19:46 +0100 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1khXIO-0005Ik-NF; Tue, 24 Nov 2020 13:19:44 +0100 Date: Tue, 24 Nov 2020 13:19:43 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Arnd Bergmann Subject: Re: [PATCH 3/4] amba: Make the remove callback return void Message-ID: <20201124121943.72etfmpubis6jw3l@pengutronix.de> References: <20201124103242.2971199-1-u.kleine-koenig@pengutronix.de> <20201124103242.2971199-3-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 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-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201124_071953_264240_6A61AE90 X-CRM114-Status: GOOD ( 24.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Ulf Hansson , Arnd Bergmann , Greg Kroah-Hartman , Linus Walleij , Russell King , "linux-kernel@vger.kernel.org" , Sascha Hauer , Linux ARM Content-Type: multipart/mixed; boundary="===============7558264827609348298==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7558264827609348298== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zq5jbqs3ok2srepm" Content-Disposition: inline --zq5jbqs3ok2srepm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 24, 2020 at 12:48:05PM +0100, Arnd Bergmann wrote: > On Tue, Nov 24, 2020 at 11:32 AM Uwe Kleine-K=F6nig > wrote: > > > > Most amba drivers return 0 in their remove callback. Together with the > > driver core ignoring the return value anyhow, it doesn't make sense to > > return a value here. > > > > So add a warning to the only driver that could return an error code and > > change the remove prototype to return void, which makes it explicit that > > returning an error value doesn't work as expected. This simplifies chan= ging > > the core remove callback to return void, too. > > > > Signed-off-by: Uwe Kleine-K=F6nig >=20 > Makes sense, I checked that the vfio driver cannot actually return an err= or > either, the 'if (vdev)' check seems to be done out of unnecessary caution, > as the probe would never have succeeded if that was NULL. Yes I thought this possible, but didn't tried to wrap my head around the logic there. IMHO this warrants a cleanup, will address this in v2. Thanks for your feedback, Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --zq5jbqs3ok2srepm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAl+8+lwACgkQwfwUeK3K 7Al8rwf/UqPq57uXKYh4PV+Y3o/wPKv35dYocyH9HfrXmi0+4MtUV4p2WRSj/w5y SJwUJWSlCHHS4E/htNSAGeMU/4uWQ0hWCVDJeEenPaP7RFC8UZwePSwQw9XM7uL/ y+DL+yyCxIBtRX7+hbhmMOJqa2Dzmr1XzcFCzRddOOrtRriUQ2LA9tLI8Ql6fuMg i/nb84oyw70yHBxqON9d3zOLNFDj+PHxjXaWuKP/GpjqpdcXLpnkn0yCndR6te8c qLpsaDfp6/zA18K22t7yfQu251Qd9OUpbOnaCtTEDUeTJtQ6hzYH1QlZwaLwNCeu +gxFJj3v0yXphIMpmUGRT3IlhTtbVA== =qTCK -----END PGP SIGNATURE----- --zq5jbqs3ok2srepm-- --===============7558264827609348298== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7558264827609348298==--