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=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,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 40778C433E0 for ; Tue, 4 Aug 2020 08:41:15 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (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 35DE82076C for ; Tue, 4 Aug 2020 08:41:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UenKH3yB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 35DE82076C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B053720480; Tue, 4 Aug 2020 08:41:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZurXKkn6r7rG; Tue, 4 Aug 2020 08:41:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 478C4203BB; Tue, 4 Aug 2020 08:41:13 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1CC87C0051; Tue, 4 Aug 2020 08:41:13 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 196C9C004C for ; Tue, 4 Aug 2020 08:41:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 100CF851AA for ; Tue, 4 Aug 2020 08:41:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KD9ZtAMR5Y0o for ; Tue, 4 Aug 2020 08:41:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 51104849B8 for ; Tue, 4 Aug 2020 08:41:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596530467; 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: in-reply-to:in-reply-to:references:references; bh=UPWrZPY2tCatq3YfkH4vc2wJlD6QQa6/byy70189PQ0=; b=UenKH3yBZqe8fucCSyxjDK5L8nxnnhLRUUaEgQSV89FKZMusrXits5920JFF5IjWDIBgck +Ke8/MKizasO/Vr4z2EKb26TdfJ3+a00B1r5acAGHYqj2Ky/Xq39GG9ZK1G1noNIdrRMuM UaeT+SX58yg7juStLBVlKc8ClEA0EPM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-242-kZw6m6UZOKqF8QBlq6GAqQ-1; Tue, 04 Aug 2020 04:41:04 -0400 X-MC-Unique: kZw6m6UZOKqF8QBlq6GAqQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6662D80BCBC; Tue, 4 Aug 2020 08:41:03 +0000 (UTC) Received: from T590 (ovpn-13-169.pek2.redhat.com [10.72.13.169]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7895388D58; Tue, 4 Aug 2020 08:40:46 +0000 (UTC) Date: Tue, 4 Aug 2020 16:40:41 +0800 From: Ming Lei To: Wang Qing Subject: Re: [PATCH] drivers\block: Use kobj_to_dev() API Message-ID: <20200804084041.GB1958244@T590> References: <1591945856-14749-1-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1591945856-14749-1-git-send-email-wangqing@vivo.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Cc: Jens Axboe , "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, Stefan Hajnoczi , Paolo Bonzini X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Fri, Jun 12, 2020 at 03:10:56PM +0800, Wang Qing wrote: > Use kobj_to_dev() API instead of container_of(). > > Signed-off-by: Wang Qing > --- > drivers/block/virtio_blk.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > mode change 100644 => 100755 drivers/block/virtio_blk.c > > diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c > index 9d21bf0..c808405 > --- a/drivers/block/virtio_blk.c > +++ b/drivers/block/virtio_blk.c > @@ -630,7 +630,7 @@ static struct attribute *virtblk_attrs[] = { > static umode_t virtblk_attrs_are_visible(struct kobject *kobj, > struct attribute *a, int n) > { > - struct device *dev = container_of(kobj, struct device, kobj); > + struct device *dev = kobj_to_dev(kobj); > struct gendisk *disk = dev_to_disk(dev); > struct virtio_blk *vblk = disk->private_data; > struct virtio_device *vdev = vblk->vdev; > -- > 2.7.4 > Reviewed-by: Ming Lei -- Ming _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization