Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2403958ioo; Sat, 28 May 2022 12:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHgCI1T080v08wjdk99Sx2hdnR/oobnbRBY1MmfaOAVG+JriluFLeAOEqiCiwPfzxsZAGy X-Received: by 2002:a63:e049:0:b0:3fa:bab7:e9b4 with SMTP id n9-20020a63e049000000b003fabab7e9b4mr19370839pgj.111.1653766372049; Sat, 28 May 2022 12:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653766372; cv=none; d=google.com; s=arc-20160816; b=hggv7X5645TUcG1PxX/6uWj8D8QqkSI1IXa2xNtnCMV3ssLOr9yN9nkvL4BLH7IwCV jFSS1yMDaFUQQEwK8OJNSemH/lLfK3Xur8RyJoiT2kY/E/EqTQLUfk+nDbIw0kz0cBnx C9gVROfmY+z4SzUgrCZaAs62fimmL3TykEvzeZobs1XGy009OXpwjOR9Q0UNCEse4Vg6 981gPrAI3EQTUH+sRjeOmvbIMaEfqaJaMPjD/CmdDDnZtQUva/80gSr8Hoocljhrqc46 pbu0lGO2Em57RSZZ63QkPVOWwDBb1B8zikmBiZlwzFrKZRkmuaSDBUftGvJJGoP3+3Ws 2CVw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8mYK00a7UR4B8Uf7OoMylov9T5hCzf7730+L4Uy7mis=; b=TRFeXZpMU3uzIUwDMsBkCtjtK5nrgjzXFfohKC4CAYqlRYKllRsN70mUEuFwJyqCc+ 09Rj8tF5oB1X7xqTsmtP2jf6vA9OJm2ETvT/XCSTT1sgVDLe2ZuC9WWtHuO6k06Kynmj YulSavkSCiZ5C4cmx1z6BmeINly9DYBfHoodyS3fgozAD1uCtloiG/EE7M829JRF/z6M rgS+UiK0Bd84ZXxqdXS3gv5h0soN+vlUroeVFo26TFfqevia0DKBb/kXvHd6rXOj+UmA oqPgy712Kxs88BHi8qY6iCDd4wd1x71SVwOK8s5taqBYXSuoBKzJEiyjZoU7MuYUzVvh C1Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i6quxanQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 1-20020a170902c10100b0015d10bd48c2si9635664pli.32.2022.05.28.12.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 12:32:52 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=i6quxanQ; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 09E87590A0; Sat, 28 May 2022 12:00:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244087AbiE0GC2 (ORCPT + 99 others); Fri, 27 May 2022 02:02:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244009AbiE0GCK (ORCPT ); Fri, 27 May 2022 02:02:10 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B0821179 for ; Thu, 26 May 2022 23:01:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653631315; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8mYK00a7UR4B8Uf7OoMylov9T5hCzf7730+L4Uy7mis=; b=i6quxanQl3RsByK1SnMNFgXlmVetu3wmnU6gyeukZiqRAZ/wzuuf80gU00zEGWneM1vXhQ wR2cb/mVa92vLXWcJPksvijRGbfkOA19r4vLxn7spF3GhMTCrBb5NNpDzQjAgcWOQVkUdb XGHkRVMVFWOVJBN66HmKfmfa1K14MPc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-403-5C-lqayINPC7G6eSBY2K-A-1; Fri, 27 May 2022 02:01:49 -0400 X-MC-Unique: 5C-lqayINPC7G6eSBY2K-A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0AC562949BA6; Fri, 27 May 2022 06:01:49 +0000 (UTC) Received: from localhost.localdomain (ovpn-13-240.pek2.redhat.com [10.72.13.240]) by smtp.corp.redhat.com (Postfix) with ESMTP id F09702166B26; Fri, 27 May 2022 06:01:40 +0000 (UTC) From: Jason Wang To: mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, peterz@infradead.org, paulmck@kernel.org, maz@kernel.org, pasic@linux.ibm.com, cohuck@redhat.com, eperezma@redhat.com, lulu@redhat.com, sgarzare@redhat.com, xuanzhuo@linux.alibaba.com, Vineeth Vijayan , Peter Oberparleiter , linux-s390@vger.kernel.org Subject: [PATCH V6 2/9] virtio: use virtio_reset_device() when possible Date: Fri, 27 May 2022 14:01:13 +0800 Message-Id: <20220527060120.20964-3-jasowang@redhat.com> In-Reply-To: <20220527060120.20964-1-jasowang@redhat.com> References: <20220527060120.20964-1-jasowang@redhat.com> MIME-Version: 1.0 Content-type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 This allows us to do common extension without duplicating code. Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: "Paul E. McKenney" Cc: Marc Zyngier Cc: Halil Pasic Cc: Cornelia Huck Cc: Vineeth Vijayan Cc: Peter Oberparleiter Cc: linux-s390@vger.kernel.org Reviewed-by: Cornelia Huck Signed-off-by: Jason Wang --- drivers/virtio/virtio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index 938e975029d4..aa1eb5132767 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c @@ -430,7 +430,7 @@ int register_virtio_device(struct virtio_device *dev) /* We always start by resetting the device, in case a previous * driver messed it up. This also tests that code path a little. */ - dev->config->reset(dev); + virtio_reset_device(dev); /* Acknowledge that we've seen the device. */ virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE); @@ -496,7 +496,7 @@ int virtio_device_restore(struct virtio_device *dev) /* We always start by resetting the device, in case a previous * driver messed it up. */ - dev->config->reset(dev); + virtio_reset_device(dev); /* Acknowledge that we've seen the device. */ virtio_add_status(dev, VIRTIO_CONFIG_S_ACKNOWLEDGE); -- 2.25.1