Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp13465pxb; Tue, 2 Mar 2021 17:25:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJx7MwzycLUK1I0ro6nzXaQ/Qf2rimRThAyGOhKZHq5fLkcB9FCHo7+Y50RxzIbD64e5cMQ1 X-Received: by 2002:a17:906:719:: with SMTP id y25mr22800865ejb.180.1614734709820; Tue, 02 Mar 2021 17:25:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614734709; cv=none; d=google.com; s=arc-20160816; b=PjOpeSkAiakuW2jw4b7eWy8i+WlsQ7CGZcVaLfZVmIedf3swDZF8jLGKRNn6yRwZKf 9pRV4drvk8GgfYdumD3tqrIasaqerfJtCqfkLtHWnyUvMn6ElE81MFBLLvMXVF2zviKl ZY9W1XJaseYJcj3CGJe3V6PcJ/wzTsQ/nsIdHVF/rQs16tsqp/7KLu/rhZEpmth2YJFl k+AokQx9MbxbiWPfXGhu4ZHbS0i1rSDraPBPQEjXLqAUHL4qPctr795cC90eYMrGNuPa ywvt1X5GhB/fnbRiTwNiRTwIXrlHICz3XG35Lere+lkOrZJadshqW0FPLDDfSizgbgJA ZKag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=Vf8DsCDhDW0bwgYm2c+QD2rxJW5n/IODZkT8C390wS4=; b=S20LQTnsYHkbsI9u+hp5/SMTJxtt4FsRuGGCIZdxmfIyGSJeElDTvky/1ValEiu4tQ 3S+6au+W6fqGMh/uzdC5mHsVKpLsgb+Y35JX7nJEPBnYnaRDGWTF8gU1JR693GQBqKpT rmB6SVvGpGM/TMl0HYM8Y/w6UgAbKc7uW6OIr63Ai+CAXFi8kx/iZo2KeTB+dLBiDAbA 1Dvr67sggxbQTd1+0BYpuKh4rUwGVDNJDKASRQaL/RCTx9uDqCS2MzPJ+wy1tcuN1EHs t39cRnGeWfD8GSVzRL9+JWQoctFRzlcF/WLXWMUDTO/p3E6BuQ2of+f2KBZ94WElRcL7 UsnA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si13767662edx.253.2021.03.02.17.24.47; Tue, 02 Mar 2021 17:25:09 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233624AbhCAJGC (ORCPT + 99 others); Mon, 1 Mar 2021 04:06:02 -0500 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:42158 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233692AbhCAJBO (ORCPT ); Mon, 1 Mar 2021 04:01:14 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R281e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0UPwssFF_1614589231; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0UPwssFF_1614589231) by smtp.aliyun-inc.com(127.0.0.1); Mon, 01 Mar 2021 17:00:31 +0800 From: Yang Li To: martin.petersen@oracle.com Cc: jejb@linux.ibm.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li Subject: [PATCH] scsi: scsi_transport_spi: Switch to using the new API kobj_to_dev() Date: Mon, 1 Mar 2021 17:00:29 +0800 Message-Id: <1614589229-52170-1-git-send-email-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fixed the following coccicheck: ./drivers/scsi/scsi_transport_spi.c:1471:61-62: WARNING opportunity for kobj_to_dev() Reported-by: Abaci Robot Signed-off-by: Yang Li --- drivers/scsi/scsi_transport_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index c37dd15..6ea5635 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -1468,7 +1468,7 @@ static int spi_host_configure(struct transport_container *tc, static umode_t target_attribute_is_visible(struct kobject *kobj, struct attribute *attr, int i) { - struct device *cdev = container_of(kobj, struct device, kobj); + struct device *cdev = kobj_to_dev(kobj); struct scsi_target *starget = transport_class_to_starget(cdev); struct Scsi_Host *shost = transport_class_to_shost(cdev); struct spi_internal *si = to_spi_internal(shost->transportt); -- 1.8.3.1