[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220512011853.1621819-1-chi.minghao@zte.com.cn>
Date: Thu, 12 May 2022 01:18:53 +0000
From: cgel.zte@...il.com
To: jejb@...ux.ibm.com
Cc: martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] [SCSI] arcmsr: Use kobj_to_dev()
From: Minghao Chi <chi.minghao@....com.cn>
Use kobj_to_dev() instead of open-coding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
drivers/scsi/arcmsr/arcmsr_attr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c
index baeb5e795690..041e15929cd3 100644
--- a/drivers/scsi/arcmsr/arcmsr_attr.c
+++ b/drivers/scsi/arcmsr/arcmsr_attr.c
@@ -64,7 +64,7 @@ static ssize_t arcmsr_sysfs_iop_message_read(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 *ptmpQbuffer;
@@ -111,7 +111,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;
@@ -159,7 +159,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;
--
2.25.1
Powered by blists - more mailing lists