Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7308222rwb; Tue, 6 Dec 2022 04:12:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf5gJiEb3XU068NXruLUGc4DSAZgdxwPptvD+6Fx/s8DuwukawoxELtxyvpd2LVyWOkWEZRK X-Received: by 2002:a17:906:3e09:b0:7c0:e6d8:3e82 with SMTP id k9-20020a1709063e0900b007c0e6d83e82mr8889727eji.451.1670328762471; Tue, 06 Dec 2022 04:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670328762; cv=none; d=google.com; s=arc-20160816; b=kzNpnBA+rNtV/oh2IsQns1gEGPnLiHz9tdvizgkQfGaRd27ZDKP7ez4ryAEui7oJFq /Pdw5r1qJWPluNbr4L1FVUDIcJLOjgt+vAc0QL8s0HSKinG6dE1DhP2ksms0WH0GBzGO LTGe+sxmoCZpnewwNofEn+02nKUOKDWPRsCFglmAWH5MMSYzQ3EKnPJ/3xT4WfI04ziQ bMdv/uyr9dMg/1h/XrEAsZcBfjB+HIzewo6wmtdpI1E94NK7g5bgsbKjWD9/yNN8+qrR +CNLvgW9+RAaF+s8rqJ77vD9lnHpvgxfknaaJLZ/O9LXYuCAlxC2sGEL25rddppPC9ta im5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=2dEEPgYHWLWGN87zsbE4biUqCxTkyL0Hp4s+LmxL1OA=; b=EiEMnYQYC/hTTinbPuUKTZVW2BnM7XnkAu3Ze/5eysENAs90BshDSA9Sw6BJQFUIg3 aR9OMZepK2R0FOb+dtjv3yySesIs8fyE/inL8txjq1guzfp/P43VHlXg72KIP6yiqLeq jAUSZQFPahR1+wPukFW09hF09n1S5lJ81jNENKnSFEPJmGFqw2eFOfMes6blnsPq5zej zAbdtclAO3YSTIpodlUy8umcBT3HMN/uMgFgIlL/N4MzzZ4G0lJKEv4yCG4Un7IoG6Ui jQ9WGOsS8vjZsSV1IBneXowILpAkBTE0OOfs1L2c9ykidf0/eilk2bTrovKpS9WnhNbw TzMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw2-20020a1709066a0200b007ae4c686a4esi1936514ejc.159.2022.12.06.04.12.23; Tue, 06 Dec 2022 04:12:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235014AbiLFLhw (ORCPT + 79 others); Tue, 6 Dec 2022 06:37:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235045AbiLFLhc (ORCPT ); Tue, 6 Dec 2022 06:37:32 -0500 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 522F3BF73; Tue, 6 Dec 2022 03:37:30 -0800 (PST) Received: by mail-wr1-f49.google.com with SMTP id bs21so23059203wrb.4; Tue, 06 Dec 2022 03:37:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2dEEPgYHWLWGN87zsbE4biUqCxTkyL0Hp4s+LmxL1OA=; b=BX7ppSth1PbgamtzbcN0AJc3/Ug4pt3Jfdn6v+/AzPJi05fItfOGDcKO8MlStm73A4 dHfjwu39fJM2rLI2x2iADEVz4ACrnoX9Ms9420we9MIcuqFQ+sgK0ETW0ngJ9DvGiUwr KKGuh0POI+u8n+iSlZHkB4tLIvr+c3uckYRHG+wA3buHKdM2dj8H5ZN/iqLRsZE268jg /zZZiOgEI/xhtmZfSXd40FZlouhXbek+u55DRIdq3E+aJ0DC4JLESLAqPuNmkUyHiI6v kZoR2fBsrhA//h9738zsw6XEIfcvR9OngY2N+wnbNo89buAoaw54Bnz3kM+6y+yQhiOA Wxhg== X-Gm-Message-State: ANoB5pl5JSXlMXuuclHSwg7295J72FEPJxQPZxpF15C4F30o9cZ3CEV8 5biF6XcAXmnirHfz6j24NB8= X-Received: by 2002:a5d:5385:0:b0:242:f8d:fcee with SMTP id d5-20020a5d5385000000b002420f8dfceemr27418643wrv.86.1670326648777; Tue, 06 Dec 2022 03:37:28 -0800 (PST) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id q17-20020a05600000d100b0024207ed4ce0sm16635553wrx.58.2022.12.06.03.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 03:37:27 -0800 (PST) Date: Tue, 6 Dec 2022 11:37:26 +0000 From: Wei Liu To: Dawei Li Cc: gregkh@linuxfoundation.org, johannes@sipsolutions.net, robert.jarzmik@free.fr, jgross@suse.com, sstabellini@kernel.org, oleksandr_tyshchenko@epam.com, roger.pau@citrix.com, srinivas.kandagatla@linaro.org, bgoswami@quicinc.com, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xenproject.org, linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/6] hyperv: Make remove callback of hyperv driver void returned Message-ID: References: <20221205153644.60909-1-set_pte_at@outlook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 05, 2022 at 11:36:39PM +0800, Dawei Li wrote: > Since commit fc7a6209d571 ("bus: Make remove callback return > void") forces bus_type::remove be void-returned, it doesn't > make much sense for any bus based driver implementing remove > callbalk to return non-void to its caller. > > This change is for hyperv bus based drivers. > > Signed-off-by: Dawei Li [...] > -static int netvsc_remove(struct hv_device *dev) > +static void netvsc_remove(struct hv_device *dev) > { > struct net_device_context *ndev_ctx; > struct net_device *vf_netdev, *net; > @@ -2603,7 +2603,6 @@ static int netvsc_remove(struct hv_device *dev) > net = hv_get_drvdata(dev); > if (net == NULL) { > dev_err(&dev->device, "No net device to remove\n"); > - return 0; This is wrong. You are introducing a NULL pointer dereference. > } > > ndev_ctx = netdev_priv(net); > @@ -2637,7 +2636,6 @@ static int netvsc_remove(struct hv_device *dev) > > free_percpu(ndev_ctx->vf_stats); > free_netdev(net); > - return 0; > } > > static int netvsc_suspend(struct hv_device *dev) > diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c > index ba64284eaf9f..3a09de70d6ea 100644 > --- a/drivers/pci/controller/pci-hyperv.c > +++ b/drivers/pci/controller/pci-hyperv.c > @@ -3756,7 +3756,7 @@ static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs) > * > * Return: 0 on success, -errno on failure > */ This comment is no longer needed in the new world. But, are you sure you're modifying the correct piece of code? hv_pci_remove is not a hook in the base bus type. It is used in struct hv_driver. The same comment applies to all other modifications. Thanks, Wei.