Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4257843pxv; Tue, 27 Jul 2021 02:52:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC1sQirY+nvSJZHqZZcTOFapDCty5Pc/CvXyMxuJ5Xu7Q0ErEmA7+0tKKdda3kTxcn7Pum X-Received: by 2002:a17:906:ce47:: with SMTP id se7mr3726861ejb.240.1627379544666; Tue, 27 Jul 2021 02:52:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627379544; cv=none; d=google.com; s=arc-20160816; b=E+Kb4+/FFAayx0/AqgrgCUJweDHqJPWKJpcA4CBLfdcKM9hlUBDHF8Hr0eZeJkSBkY TqkW6kYocmcwpqGcdEoyyCaJFf2qQz1jR+vyoEZ/cv6IHwGBR8n9SoOeKBtkJlZV1/D0 QfmDY2HdS/mZpEIUzETWA/h2gkXf4howGfXr3EVLwLNlo/kZ4eWib0qq8USWXS+iiUJM HJxIVBTWfmTCNKVBvTAf3VBFsQeKKQxq9NwsyQALijJQu1XhnemhyuWA54/CK0zu4U3F ZecE8Uuz9S7OsLo5ySfLHAxR3sMXpLbIYNHLwsqlydtS9WK29zpvjmpxEDHnf5XklWZ0 GlYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-id:mime-version:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=J3f2eYP/ypsMclzmndLPiDcKO9gMzTgRakt9f1pTvUg=; b=cRJnFhsoILu+vdyanQE2kat/cNgOUTZa6Cj25K9n5dorvBJQwVigGUM/3PrW1uX5/T gyYvOtHkb4wLIH3jfZZJ0fDiCd/3Ap3infdrkeksrDlhsuSvsdvDJB+e+TUipl0X4AsF +a8Spzd7pt43NDZP22frv0xhGgluGewKA3BvYYcaMmfX8aGSTCiNS/kuYAJHIAtp3pII N7I7c/nN/n0jfMNVHrWpaz3HGFpsSUlpzERWkOMjFApM6Sxc1v2a8JDamV1Tz9p+YEq9 IWcYOHT2q9+HlnJh60t7sjhCh66jE6ZDn9h46KbCExfLxx4KfI2adYgcbbHxh6VLbOL0 UB4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ioG4IDXG; 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 bo5si2369832edb.575.2021.07.27.02.52.01; Tue, 27 Jul 2021 02:52:24 -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; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=ioG4IDXG; 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 S235897AbhG0Jul (ORCPT + 99 others); Tue, 27 Jul 2021 05:50:41 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:52179 "EHLO wout5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235950AbhG0Jul (ORCPT ); Tue, 27 Jul 2021 05:50:41 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id AC4333200921; Tue, 27 Jul 2021 05:50:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 27 Jul 2021 05:50:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-id:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=J3f2eYP/ypsMclzmndLPiDcKO9gMzTgRakt9f1pTvUg=; b=ioG4IDXG Anz/sJRnt6VaB5HnV6qUmyr7uuV29HlVhBu9Xm1yrHhGolhiLHr0rL6bBs2/cD0D PBGwhlXBOfL0WFqeWWMAfV2AB+Thcghu9eLnwECGhYbeKJb3H/uOimPRugYECtDB WZhdT/dDfue90eJdph0GPlKMLVpbI9pc+9hbME9xeFQOwJ3oSuTdD7prfxZ9VFtI kGkuWG+cFOgP3uiIEU3Gtno3YLyfPFXrJG7M2Mc9bdpLQ7/PGgVUlAi+lZfgZi+J /2yaGGdF6je0giF60J+FX3r78y1+XMb4cREbu1B8QNNx4fnNk8hAoied0Si/VVCV ruFxXZRhrm39LA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrgeejgdduhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvufgjkfhfgggtsehmtderredttdejnecuhfhrohhmpefhihhnnhcuvfhh rghinhcuoehfthhhrghinheslhhinhhugidqmheikehkrdhorhhgqeenucggtffrrghtth gvrhhnpeefffejiefgheevheefvefhteeggfeijeeiveeihfffffdugfefkeelfffhgfeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfth hhrghinheslhhinhhugidqmheikehkrdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 27 Jul 2021 05:50:36 -0400 (EDT) Date: Tue, 27 Jul 2021 19:50:39 +1000 (AEST) From: Finn Thain To: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-m68k@lists.linux-m68k.org Subject: Re: [PATCH 1/5] nubus: Simplify check in remove callback In-Reply-To: <20210727080840.3550927-2-u.kleine-koenig@pengutronix.de> Message-ID: References: <20210727080840.3550927-1-u.kleine-koenig@pengutronix.de> <20210727080840.3550927-2-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="-1463811774-245338131-1627379007=:27" Content-ID: <7a42c831-acd5-2e2f-28c2-99efc32374e2@nippy.intranet> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463811774-245338131-1627379007=:27 Content-Type: text/plain; CHARSET=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: On Tue, 27 Jul 2021, Uwe Kleine-K=C3=B6nig wrote: > The driver core only calls a remove callback when the device was > successfully bound (aka probed) before. So dev->driver is never NULL. >=20 Are you sure dev->driver is non-NULL for the lifetime of the device? A quick glance at device_reprobe() makes me wonder about that. > Apart from that, the compiler might already assume dev->driver being > non-NULL after to_nubus_driver(dev->driver) was called. >=20 I don't understand how a compiler can make that assumption. But then, I=20 don't know why compilers do a lot of the things they do... > Signed-off-by: Uwe Kleine-K=C3=B6nig > --- > drivers/nubus/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/nubus/bus.c b/drivers/nubus/bus.c > index d9d04f27f89b..17fad660032c 100644 > --- a/drivers/nubus/bus.c > +++ b/drivers/nubus/bus.c > @@ -33,7 +33,7 @@ static void nubus_device_remove(struct device *dev) > { > =09struct nubus_driver *ndrv =3D to_nubus_driver(dev->driver); > =20 > -=09if (dev->driver && ndrv->remove) > +=09if (ndrv->remove) > =09=09ndrv->remove(to_nubus_board(dev)); > } > =20 >=20 ---1463811774-245338131-1627379007=:27--