Message ID | 20230319050130.360515-1-sensor1010@163.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp600747wrt; Sat, 18 Mar 2023 23:07:31 -0700 (PDT) X-Google-Smtp-Source: AK7set/jSydvE3JGwUO1hTqQpdU4r6eVazbl+eL+K1lgYHJEa19ewsI0Bxz1cADAbgzRm3HLUAKS X-Received: by 2002:a17:90a:5314:b0:23d:77b3:907d with SMTP id x20-20020a17090a531400b0023d77b3907dmr14177638pjh.22.1679206050785; Sat, 18 Mar 2023 23:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679206050; cv=none; d=google.com; s=arc-20160816; b=WrnAizI7G5W/z5xs1wq5kCqZJVQsTNkIgoh7XQDRoRzlCUa45c90GydugFBD4aHvdB /e5JPSRuI5Jby5CUZbzej7ESolN8iLjkfEoOyBvxjPR5kHdNnbNtH3cyqZSDZrBGxZSo /RtmgPRsVgt1Fme34je+c1nXtHGeK4W3ljkVI2yAyhHcxpLSUJqBKL1ey8lBCLbAbgPL lT5NmzkItAWiTrtZ+SsEn42rSFJemUpDSdLIeKa70FcG6lM4B9qSHxCn8WqY2vHFX7Mn n3+Ni6p8VcLWl+YnWI6MVzq06dZi6NsUcIqgRUjXLt6JFc4YVApQzWoY3eJ2HGHX27++ qDGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=RPdxJ+mggNVvNyWTw6rxBmgJTkEjs/LtozH8QDPxzBM=; b=C5hI0k1CmvYkGRJ73gwkVttParVxi16rGG+3hNogLeW+IRfe5rtmFC7nbEDWzrXAnr iNq9Lv3gQxQYb84efhBxLvItDNiLZp/AB9Jf+dCEJVzYcQ5tnP6apgc1GWZAzbNB6V6D gK070Avm3qI+gepd9R9G2aMNYy2iAKBqMI5gQoUPESgfenUj/eiGg7sY38HmAEcR4rR+ lzYoSuNyd3n2Ji4JvKxYNrnbnNxTgeMuZIUIVff0cg4XLAXFop94ct0iDAjrecE6bTZx UYAcMOHLYVXpVOJP8VrP+jVDTbo9Pwc1GGRyVJBOQsSfsDSe/6VF/GkX9XIWfRCekoIV gdfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="fe/7kvXI"; 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=163.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a17090abc4500b0023d1e317716si6744948pjv.40.2023.03.18.23.07.13; Sat, 18 Mar 2023 23:07:30 -0700 (PDT) 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; dkim=pass header.i=@163.com header.s=s110527 header.b="fe/7kvXI"; 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=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbjCSFCN (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Sun, 19 Mar 2023 01:02:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229553AbjCSFCJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 19 Mar 2023 01:02:09 -0400 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4160F24128; Sat, 18 Mar 2023 22:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=RPdxJ +mggNVvNyWTw6rxBmgJTkEjs/LtozH8QDPxzBM=; b=fe/7kvXIGCRazXfVwolvG xWZjeYN8MJFLRFx5zVfk4n821yTO/vQ6ioQTF1Z5rwB/mUK61i8w88U2pV5OH44S Sp42MW8l67kD4jctPbmzY6/jCgDATrEhntnSibVOgiJQDq5hEmygsdfRmJeLkP0N XAxH4T7V9MqgXobEQ0fryI= Received: from lizhe.. (unknown [120.245.132.192]) by zwqz-smtp-mta-g0-0 (Coremail) with SMTP id _____wBXhbYrlxZkv1DwAQ--.18069S4; Sun, 19 Mar 2023 13:01:55 +0800 (CST) From: Lizhe <sensor1010@163.com> To: kwankhede@nvidia.com, alex.williamson@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Lizhe <sensor1010@163.com> Subject: [PATCH v1] vfio/mdev: Remove redundant driver match function Date: Sun, 19 Mar 2023 13:01:30 +0800 Message-Id: <20230319050130.360515-1-sensor1010@163.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wBXhbYrlxZkv1DwAQ--.18069S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7Jr1kAr4DtrW7ZF4rXr1kZrb_yoWDtFX_Ca 4UZFZ7Wry5Gr1rtFnaqFWIvr9Fk3WDXrsYqF4Fqasayr1xX3WrZF4qqrsFqw1UZ34rAan8 ur15Xr4IvrWUWjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRNZ2-DUUUUU== X-Originating-IP: [120.245.132.192] X-CM-SenderInfo: 5vhq20jurqiii6rwjhhfrp/xtbBdAg3q1gi5motTgAAs1 X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_VALIDITY_RPBL,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760775163923655343?= X-GMAIL-MSGID: =?utf-8?q?1760775163923655343?= |
Series |
[v1] vfio/mdev: Remove redundant driver match function
|
|
Commit Message
Lizhe
March 19, 2023, 5:01 a.m. UTC
If there is no driver match function, the driver core assumes that each
candidate pair (driver, device) matches, see driver_match_device().
Drop the bus's match function that always returned 1 and so
implements the same behaviour as when there is no match function.
Signed-off-by: Lizhe <sensor1010@163.com>
---
drivers/vfio/mdev/mdev_driver.c | 10 ----------
1 file changed, 10 deletions(-)
Comments
On Sun, 19 Mar 2023 13:01:30 +0800 Lizhe <sensor1010@163.com> wrote: > If there is no driver match function, the driver core assumes that each > candidate pair (driver, device) matches, see driver_match_device(). > > Drop the bus's match function that always returned 1 and so > implements the same behaviour as when there is no match function. The removed function returns 0, not 1, so this is replacing the functionality with something that does exactly the opposite of the current behavior. Please explain. Thanks, Alex > Signed-off-by: Lizhe <sensor1010@163.com> > --- > drivers/vfio/mdev/mdev_driver.c | 10 ---------- > 1 file changed, 10 deletions(-) > > diff --git a/drivers/vfio/mdev/mdev_driver.c b/drivers/vfio/mdev/mdev_driver.c > index 7825d83a55f8..fafa4416aad9 100644 > --- a/drivers/vfio/mdev/mdev_driver.c > +++ b/drivers/vfio/mdev/mdev_driver.c > @@ -31,20 +31,10 @@ static void mdev_remove(struct device *dev) > drv->remove(to_mdev_device(dev)); > } > > -static int mdev_match(struct device *dev, struct device_driver *drv) > -{ > - /* > - * No drivers automatically match. Drivers are only bound by explicit > - * device_driver_attach() > - */ > - return 0; > -} > - > struct bus_type mdev_bus_type = { > .name = "mdev", > .probe = mdev_probe, > .remove = mdev_remove, > - .match = mdev_match, > }; > > /**
diff --git a/drivers/vfio/mdev/mdev_driver.c b/drivers/vfio/mdev/mdev_driver.c index 7825d83a55f8..fafa4416aad9 100644 --- a/drivers/vfio/mdev/mdev_driver.c +++ b/drivers/vfio/mdev/mdev_driver.c @@ -31,20 +31,10 @@ static void mdev_remove(struct device *dev) drv->remove(to_mdev_device(dev)); } -static int mdev_match(struct device *dev, struct device_driver *drv) -{ - /* - * No drivers automatically match. Drivers are only bound by explicit - * device_driver_attach() - */ - return 0; -} - struct bus_type mdev_bus_type = { .name = "mdev", .probe = mdev_probe, .remove = mdev_remove, - .match = mdev_match, }; /**