]> git.karo-electronics.de Git - linux-beck.git/commitdiff
cxl: Fix coccinelle warnings
authorAndrew Donnellan <andrew.donnellan@au1.ibm.com>
Tue, 22 Nov 2016 10:13:27 +0000 (21:13 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 23 Nov 2016 11:57:49 +0000 (22:57 +1100)
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>
drivers/misc/cxl/debugfs.c
drivers/misc/cxl/guest.c
drivers/misc/cxl/irq.c
drivers/misc/cxl/native.c

index ec7b8a0174393204667915175d6a01dba48d35ee..9c06ac8fa5acad874975d3d5e8d87c5c6e4fbc4a 100644 (file)
@@ -43,12 +43,14 @@ static int debugfs_io_u64_set(void *data, u64 val)
        out_be64((u64 __iomem *)data, val);
        return 0;
 }
-DEFINE_SIMPLE_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set, "0x%016llx\n");
+DEFINE_DEBUGFS_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set,
+                        "0x%016llx\n");
 
 static struct dentry *debugfs_create_io_x64(const char *name, umode_t mode,
                                            struct dentry *parent, u64 __iomem *value)
 {
-       return debugfs_create_file(name, mode, parent, (void __force *)value, &fops_io_x64);
+       return debugfs_create_file_unsafe(name, mode, parent,
+                                         (void __force *)value, &fops_io_x64);
 }
 
 void cxl_debugfs_add_adapter_psl_regs(struct cxl *adapter, struct dentry *dir)
index 3e102cd6ed914d992152128423cce8cbab33e830..e04bc4ddfd742527e0a649540795c97a25a6cfab 100644 (file)
@@ -887,7 +887,7 @@ static void afu_handle_errstate(struct work_struct *work)
            afu_guest->previous_state == H_STATE_PERM_UNAVAILABLE)
                return;
 
-       if (afu_guest->handle_err == true)
+       if (afu_guest->handle_err)
                schedule_delayed_work(&afu_guest->work_err,
                                      msecs_to_jiffies(3000));
 }
index dec60f58a7677b8999af2a246613e03a19b0d3bc..1a402bbed687fb69817d0cdf2cde58e59d8cc2b5 100644 (file)
@@ -104,7 +104,7 @@ irqreturn_t cxl_irq(int irq, struct cxl_context *ctx, struct cxl_irq_info *irq_i
                } else {
                        spin_lock(&ctx->lock);
                        ctx->afu_err = irq_info->afu_err;
-                       ctx->pending_afu_err = 1;
+                       ctx->pending_afu_err = true;
                        spin_unlock(&ctx->lock);
 
                        wake_up_all(&ctx->wq);
index c336350ede942e3928a7e67962fa4782d5d5b388..c1216d31796ccd7045434cb1f569a2af67597d37 100644 (file)
@@ -54,7 +54,7 @@ static int afu_control(struct cxl_afu *afu, u64 command, u64 clear,
                                     AFU_Cntl | command);
                cpu_relax();
                AFU_Cntl = cxl_p2n_read(afu, CXL_AFU_Cntl_An);
-       };
+       }
 
        if (AFU_Cntl & CXL_AFU_Cntl_An_RA) {
                /*
@@ -167,7 +167,7 @@ int cxl_psl_purge(struct cxl_afu *afu)
                        cpu_relax();
                }
                PSL_CNTL = cxl_p1n_read(afu, CXL_PSL_SCNTL_An);
-       };
+       }
        end = local_clock();
        pr_devel("PSL purged in %lld ns\n", end - start);