Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1025985ybt; Fri, 19 Jun 2020 22:03:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx04gd/2M9lQBb+JSf7pTn0LBt5bjAla3GVrBltZAv+Fxdla0M/eKlIl3mdSybd9GqtW8W1 X-Received: by 2002:aa7:c356:: with SMTP id j22mr6285312edr.59.1592629427341; Fri, 19 Jun 2020 22:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592629427; cv=none; d=google.com; s=arc-20160816; b=n+Hj3LzI4WeEZRZLV/FLCmES6XHS96Uh41Acvqyq9zXRMxodD4pZzO+5l3cpxM0h5C qsSUDz0aiy/OQ6jW/tgIG+iPGNiQ6a/SNcJh3m8gWDYAHKpeR8k58PJyXFeApRYbYWRX iPN8HTSXUV6zNU7siJMPTNEoGdmwAki7spNLkVM4oRR+22VB9+D215e04PfSDF052E/K uqhDaDrr4WDuoIHtJIB4eJuydpX8KlDgIWtjblSW6huyrQK+i5CRrzWPaamZHoJDSChf ow+9blNauXrnbgj8qF7OI3qQURrbGqEcYQw0Nn5uV3TyxGjY2LWva/IfW0atvhYlIpmq j1YA== 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=+AE3Ti/pMEX9pgPQrbJaNx1Cbxms3KXawKb4U7QgP+A=; b=zkDAQNk+rDUWlzt+TanR7p2yx4JR4kioqz4i6mGETm6rk281TI4BkQYak5kC1aUlxm YAyMYynhXs693XIGh2+fe7qGG6djSH9Mscb5yllt7GgyhcIEBVUj4YJss8e64SAgzq8D olOIw0RAkf03DRMe2I6B9Z32MCTUYYKfoY0G233oBUvKY0xG+uYb9McKRnbKRwW0AOT4 vftUIcUs0f73osrIyjELcNwh8XtrCCXxhHHXjRq9zhuvixFlpOeVPbF3G7FFgOKOv2oY 7dOX4W2mbHlOZkhzn/9ONND+MNnVIu2Ow/5BXxy91ozKsmRMV9n3lZMHx/4NwGVBqA7O 6aIQ== 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 jz17si4894387ejb.243.2020.06.19.22.03.25; Fri, 19 Jun 2020 22:03:47 -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 S1731662AbgFTCCN (ORCPT + 99 others); Fri, 19 Jun 2020 22:02:13 -0400 Received: from m17618.mail.qiye.163.com ([59.111.176.18]:64835 "EHLO m17618.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731502AbgFTCCM (ORCPT ); Fri, 19 Jun 2020 22:02:12 -0400 X-Greylist: delayed 499 seconds by postgrey-1.27 at vger.kernel.org; Fri, 19 Jun 2020 22:02:12 EDT Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.226]) by m17618.mail.qiye.163.com (Hmail) with ESMTPA id 1CD944E1155; Sat, 20 Jun 2020 09:53:50 +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 V2] drivers/block: Use kobj_to_dev() API Date: Sat, 20 Jun 2020 09:53:43 +0800 Message-Id: <1592618024-28990-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZHUIZGk5MHU0dTkJMVkpOQklNSkNLSEtOSkxVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKTFVKS0tZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6NjI6Egw5Qjg5GQIqLRcMIVEr NQ5PCTdVSlVKTkJJTUpDS0hLQ0JIVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlJTVlXWQgBWUFKQ0hPNwY+ X-HM-Tid: 0a72cf6e95479376kuws1cd944e1155 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(-) 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