Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1602838pxb; Thu, 4 Mar 2021 16:04:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9Hu9MyeyC5nPHv7WL6BYJCmsKUj++D4kUpqgpR5c4VpAfo5OK/qhaTH+AnzFB7AL4XCBh X-Received: by 2002:a02:8801:: with SMTP id r1mr6970326jai.51.1614902656191; Thu, 04 Mar 2021 16:04:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614902656; cv=none; d=google.com; s=arc-20160816; b=sdQDVT9X+ayOS3FAq53ZoTyPmbhJA06Qz4q8WStFdriTSpfGWcazI/iBOUlKtU7Tg3 pfFi2xU/jOLw+9mSPtE/CBzmPebizqGCqMLFF+2h5vH/oDN544kJXh0UlCpEWKjU+fMK E3fOp+s2/ytwzYs4GoOQHI2tZf6wVESi9q0B4oROKfE8UUjx+vQ8eEsUHKoUTyuRqNAV tOeZfmuhUTuTiYc0HApP0EFnD2/kKWbG8dAD03DTBko5EAR23e1J1cQvfI+VnNXAtZ3W z1oxIM2fSc9zDwcsJdbtuacSNkKuHJ5kRBrFKoEfLEAVLCO/nLKB/CIBb9JeYrFHycRR 8/Sw== 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=tyOQ6dNoXx8JdJvStM8yJwpjkgQO79xlc1F8+P4W9UQ=; b=OwCFmLMJWWrLrEwK/L6H4upkUxJA78S7QRLbw/jQOzxCnyfbQMS7wGdY9u6TxIMXqy h4f1KNUn9pH5irfmmynqfF8xZENLt7qV9Hwr9lSK8D5+ceQ4NB7qJWDBBP2jGYu75otZ Yyy0OItCw8EnEuT03jWM3Tcik4sbFaMO8QyEgRzUlElmfJPV6pWscQGAW0qJDRY/tGw5 ac6dZv7Ts8AJSAyqHzyuJZFua9RolzX8QxpnHtSOf5eNeM+/G3QfBjJWtpRsjPutW2Om HRmLp5QPrc8cADs3cohgwWVgKbMBlxxADtX/mgADWA/ryQnvQ0vwVCCttKRjPY43eJ4Y 1ImA== 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 j13si605762ilu.140.2021.03.04.16.04.02; Thu, 04 Mar 2021 16:04:16 -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 S234835AbhCDGOz (ORCPT + 99 others); Thu, 4 Mar 2021 01:14:55 -0500 Received: from out4436.biz.mail.alibaba.com ([47.88.44.36]:35048 "EHLO out4436.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234733AbhCDGOp (ORCPT ); Thu, 4 Mar 2021 01:14:45 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0UQK2Dg0_1614838438; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0UQK2Dg0_1614838438) by smtp.aliyun-inc.com(127.0.0.1); Thu, 04 Mar 2021 14:14:04 +0800 From: Jiapeng Chong To: jejb@linux.ibm.com Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] arcmsr: Switch to using the new API kobj_to_dev() Date: Thu, 4 Mar 2021 14:13:57 +0800 Message-Id: <1614838437-98814-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warnings: ./drivers/scsi/arcmsr/arcmsr_attr.c:164:58-59: WARNING opportunity for kobj_to_dev(). ./drivers/scsi/arcmsr/arcmsr_attr.c:116:58-59: WARNING opportunity for kobj_to_dev(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- drivers/scsi/arcmsr/arcmsr_attr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c index 57be960..e03326e 100644 --- a/drivers/scsi/arcmsr/arcmsr_attr.c +++ b/drivers/scsi/arcmsr/arcmsr_attr.c @@ -113,7 +113,7 @@ static ssize_t arcmsr_sysfs_iop_message_write(struct file *filp, char *buf, loff_t off, size_t count) { - struct device *dev = container_of(kobj,struct device,kobj); + struct device *dev = kobj_to_dev(kobj); struct Scsi_Host *host = class_to_shost(dev); struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; int32_t user_len, cnt2end; @@ -161,7 +161,7 @@ static ssize_t arcmsr_sysfs_iop_message_clear(struct file *filp, char *buf, loff_t off, size_t count) { - struct device *dev = container_of(kobj,struct device,kobj); + struct device *dev = kobj_to_dev(kobj); struct Scsi_Host *host = class_to_shost(dev); struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; uint8_t *pQbuffer; -- 1.8.3.1