Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp906179pxa; Wed, 19 Aug 2020 19:20:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaEWLgOlV8bUVGThJvy5NxXpU30tO4pUywjYUwNFMoeoqSP7p8uyFnaJ8e5udXjo4Q/rT0 X-Received: by 2002:aa7:c74f:: with SMTP id c15mr844830eds.331.1597890028091; Wed, 19 Aug 2020 19:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597890028; cv=none; d=google.com; s=arc-20160816; b=jypyOgNxqVCTGhqhP2ebp4ZauHZsPmUEaY35OC7NqdBHQ9lImMkl3OvCW6h6RDx44Q I1/Q8pNje5b46DDjV6eszJzef+be5NR/NSnCets1jcB3rgb/YYT0Y93XwI1UVfVM2Tqq yvcNhuOtpfd5+gyJiZGuU4DEndavqzE25bSIGDuFYSr+GfMjSaZE5QQ9oawNNK7bZzED 9s8Tw2nzJPL+2Bs2fqLpEZQOrjRg9tTSvG0g1GtDsmkyJERsJboQmbkQAkFBYhndquwy WdRWqF/xKesNZI1uc4aiuoMU8zQ3ZMeGizK3kM9/uDvoJaokHeGqCHg3yQ2620yF4E+2 MSZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=sSNQ98shBHxOB+ngeJpvyRLgiZ5KBgdqIL5t6KkDMA0=; b=KAKV7gJi3jxuO7Nrg1QIO3S/hrRdGBDMqBTzXMytMtjEKgWZoQHvepodWMNFxN/aAm yZmAqCMtQf0c98t814EEqaPBwt99u7FB516UZ6vswz1gnpAqowqaDeZn1y8Z0JIbu3Z9 HqN/dJgnn3I2j21Q344SQz/w/B3Qnil6XfrN/XRLB1riisWG4Af+xySNLHO+/juYFbRM hmAsqHmyj6SvGDXWgKhQcqatSsNvSZrd9hnrkOsE4oH94Mc4kAJTIVhgG4QyWZchMj4j pImlAcfVgx+rS+sg2Rf/mm4OxGRQ2jVvVp3HjszhBMBt0f1buWbM5PAFy/xjg6Zj2MOb spig== 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 g18si503061eds.389.2020.08.19.19.20.05; Wed, 19 Aug 2020 19:20:28 -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 S1726962AbgHTCSt (ORCPT + 99 others); Wed, 19 Aug 2020 22:18:49 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9788 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726664AbgHTCSt (ORCPT ); Wed, 19 Aug 2020 22:18:49 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id CC474BE346A7FA004031; Thu, 20 Aug 2020 10:18:46 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Thu, 20 Aug 2020 10:18:37 +0800 From: Tian Tao To: , , , , , CC: Subject: [PATCH] uacce: Use kobj_to_dev() instead of container_of() Date: Thu, 20 Aug 2020 10:16:32 +0800 Message-ID: <1597889792-53139-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kobj_to_dev() instead of container_of() Signed-off-by: Tian Tao Reviewed-by: Zhou Wang --- drivers/misc/uacce/uacce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c index a5b8dab..a9da7b1 100644 --- a/drivers/misc/uacce/uacce.c +++ b/drivers/misc/uacce/uacce.c @@ -370,7 +370,7 @@ static struct attribute *uacce_dev_attrs[] = { static umode_t uacce_dev_is_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct uacce_device *uacce = to_uacce_device(dev); if (((attr == &dev_attr_region_mmio_size.attr) && -- 2.7.4