Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp258505ybg; Fri, 12 Jun 2020 00:16:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3IeJAK3yvN+sUbgAvL3kCMD41jK/d6TfZC3tOmEmG5TG6xut3TB9Qnyfb8aDNLOScLwLP X-Received: by 2002:a17:906:138b:: with SMTP id f11mr11719209ejc.288.1591946197176; Fri, 12 Jun 2020 00:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591946197; cv=none; d=google.com; s=arc-20160816; b=HXPIESmLPW6HU3pwaZAKPJoeSzYEqNIlEqj5W34/Z32tFYqhZkCOJ/RhA9LNGN5wq5 1C0HM2KnqlhLvj1v83F8BUP2oeC8qlVD5o5++XfsmOUaCj0cTwRHZ02/O4MhAKkK0fyu uCla4TlJ6VCz5s1ycHy2RAV8Yw81YthJGzavZLrdnFXN2b7jKQzGcdpQcc0zyPjg6Z/3 93Lv3G15cg0ofP2nxOe46aijYNd1tyIrlDG1Bon3dY+UW1IaHgtAFo5CbX5/CH0tLfrM DxKfuApF3NiUsLSFQx8dt4+sVL51wQjvG5BrozpJ1kjdriIWB4smu0Uw6VTIZasyH4hY FmMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=iKWPjfFV+CEKFyzucEE14XffBbgTQeNLvqzRLPguWk0=; b=Io9z1bLotTH0xHXGTpPFr0WrVo3OyUzZYh6I+qBD0ndw2aq1dr251DJwpBFA/Ls/vb Fc9aYd0zg03eEUvxUBJAOsyyaP4nuoW/njo1AcijPKA6jntcNCwYg+Zr3N2l22KpxJmn htkISbrfU5eQSwtTb9cMrTVmF1qQc6bMfZyH+AHvsb4gJCuas+a8VLBU3a5xwLGlv6dn mhcpVq0drm75IPJriuBG+JQV9IPyJgLyzMocbi4i2LMoOtqhaTIPnsFThoHZ2mL2eHO8 rAZLGhlnue4HPeWh0W15Mq9Vf3eI6uH6/nkwG07NMklAGhs/ZyoKNznVGR4rjC7vDo/z YjIA== ARC-Authentication-Results: i=1; mx.google.com; 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 h6si3463943edn.503.2020.06.12.00.16.14; Fri, 12 Jun 2020 00:16:37 -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; 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 S1726718AbgFLHLM (ORCPT + 99 others); Fri, 12 Jun 2020 03:11:12 -0400 Received: from m17617.mail.qiye.163.com ([59.111.176.17]:10377 "EHLO m17617.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726536AbgFLHLK (ORCPT ); Fri, 12 Jun 2020 03:11:10 -0400 Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.226]) by m17617.mail.qiye.163.com (Hmail) with ESMTPA id 209C72618FF; Fri, 12 Jun 2020 15:11:06 +0800 (CST) From: Wang Qing To: "Michael S. Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Jens Axboe , virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wang Qing Subject: [PATCH] drivers\block: Use kobj_to_dev() API Date: Fri, 12 Jun 2020 15:10:56 +0800 Message-Id: <1591945856-14749-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZS0oZQkNPGUJDSE5PVkpOQkpCT05DTU1OSk5VEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VKS0tZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MyI6PSo4EjgyLwtIFxk9TT9L FygwCg9VSlVKTkJKQk9OQ01MS0tNVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlJTVlXWQgBWUFKQ0NNNwY+ X-HM-Tid: 0a72a75e2cb19375kuws209c72618ff Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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