diff options
author | Andrew Donnellan <andrew.donnellan@au1.ibm.com> | 2016-11-22 05:13:27 -0500 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-11-23 06:57:49 -0500 |
commit | 3382a6220ff3bac886d9d90766f3fe18cf25b468 (patch) | |
tree | 44b0b45a39044ccb53c45e8d2152bd2b437fd426 | |
parent | 902e06eb86cd62753974c249bd1dedae2825b430 (diff) |
cxl: Fix coccinelle warnings
Fix the following coccinelle warnings:
drivers/misc/cxl/debugfs.c:46:0-23: WARNING: fops_io_x64 should be
defined with DEFINE_DEBUGFS_ATTRIBUTE
drivers/misc/cxl/guest.c:890:5-26: WARNING: Comparison to bool
drivers/misc/cxl/irq.c:107:3-23: WARNING: Assignment of bool to 0/1
drivers/misc/cxl/native.c:57:2-3: Unneeded semicolon
drivers/misc/cxl/native.c:170:2-3: Unneeded semicolon
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | drivers/misc/cxl/debugfs.c | 6 | ||||
-rw-r--r-- | drivers/misc/cxl/guest.c | 2 | ||||
-rw-r--r-- | drivers/misc/cxl/irq.c | 2 | ||||
-rw-r--r-- | drivers/misc/cxl/native.c | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/drivers/misc/cxl/debugfs.c b/drivers/misc/cxl/debugfs.c index ec7b8a017439..9c06ac8fa5ac 100644 --- a/drivers/misc/cxl/debugfs.c +++ b/drivers/misc/cxl/debugfs.c | |||
@@ -43,12 +43,14 @@ static int debugfs_io_u64_set(void *data, u64 val) | |||
43 | out_be64((u64 __iomem *)data, val); | 43 | out_be64((u64 __iomem *)data, val); |
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
46 | DEFINE_SIMPLE_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set, "0x%016llx\n"); | 46 | DEFINE_DEBUGFS_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set, |
47 | "0x%016llx\n"); | ||
47 | 48 | ||
48 | static struct dentry *debugfs_create_io_x64(const char *name, umode_t mode, | 49 | static struct dentry *debugfs_create_io_x64(const char *name, umode_t mode, |
49 | struct dentry *parent, u64 __iomem *value) | 50 | struct dentry *parent, u64 __iomem *value) |
50 | { | 51 | { |
51 | return debugfs_create_file(name, mode, parent, (void __force *)value, &fops_io_x64); | 52 | return debugfs_create_file_unsafe(name, mode, parent, |
53 | (void __force *)value, &fops_io_x64); | ||
52 | } | 54 | } |
53 | 55 | ||
54 | void cxl_debugfs_add_adapter_psl_regs(struct cxl *adapter, struct dentry *dir) | 56 | void cxl_debugfs_add_adapter_psl_regs(struct cxl *adapter, struct dentry *dir) |
diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c index 3e102cd6ed91..e04bc4ddfd74 100644 --- a/drivers/misc/cxl/guest.c +++ b/drivers/misc/cxl/guest.c | |||
@@ -887,7 +887,7 @@ static void afu_handle_errstate(struct work_struct *work) | |||
887 | afu_guest->previous_state == H_STATE_PERM_UNAVAILABLE) | 887 | afu_guest->previous_state == H_STATE_PERM_UNAVAILABLE) |
888 | return; | 888 | return; |
889 | 889 | ||
890 | if (afu_guest->handle_err == true) | 890 | if (afu_guest->handle_err) |
891 | schedule_delayed_work(&afu_guest->work_err, | 891 | schedule_delayed_work(&afu_guest->work_err, |
892 | msecs_to_jiffies(3000)); | 892 | msecs_to_jiffies(3000)); |
893 | } | 893 | } |
diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c index dec60f58a767..1a402bbed687 100644 --- a/drivers/misc/cxl/irq.c +++ b/drivers/misc/cxl/irq.c | |||
@@ -104,7 +104,7 @@ irqreturn_t cxl_irq(int irq, struct cxl_context *ctx, struct cxl_irq_info *irq_i | |||
104 | } else { | 104 | } else { |
105 | spin_lock(&ctx->lock); | 105 | spin_lock(&ctx->lock); |
106 | ctx->afu_err = irq_info->afu_err; | 106 | ctx->afu_err = irq_info->afu_err; |
107 | ctx->pending_afu_err = 1; | 107 | ctx->pending_afu_err = true; |
108 | spin_unlock(&ctx->lock); | 108 | spin_unlock(&ctx->lock); |
109 | 109 | ||
110 | wake_up_all(&ctx->wq); | 110 | wake_up_all(&ctx->wq); |
diff --git a/drivers/misc/cxl/native.c b/drivers/misc/cxl/native.c index c336350ede94..c1216d31796c 100644 --- a/drivers/misc/cxl/native.c +++ b/drivers/misc/cxl/native.c | |||
@@ -54,7 +54,7 @@ static int afu_control(struct cxl_afu *afu, u64 command, u64 clear, | |||
54 | AFU_Cntl | command); | 54 | AFU_Cntl | command); |
55 | cpu_relax(); | 55 | cpu_relax(); |
56 | AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An); | 56 | AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An); |
57 | }; | 57 | } |
58 | 58 | ||
59 | if (AFU_Cntl & CXL_AFU_Cntl_An_RA) { | 59 | if (AFU_Cntl & CXL_AFU_Cntl_An_RA) { |
60 | /* | 60 | /* |
@@ -167,7 +167,7 @@ int cxl_psl_purge(struct cxl_afu *afu) | |||
167 | cpu_relax(); | 167 | cpu_relax(); |
168 | } | 168 | } |
169 | PSL_CNTL = cxl_p1n_read(afu, CXL_PSL_SCNTL_An); | 169 | PSL_CNTL = cxl_p1n_read(afu, CXL_PSL_SCNTL_An); |
170 | }; | 170 | } |
171 | end = local_clock(); | 171 | end = local_clock(); |
172 | pr_devel("PSL purged in %lld ns\n", end - start); | 172 | pr_devel("PSL purged in %lld ns\n", end - start); |
173 | 173 | ||