misc: clk_mon: Remove some of build warnings 53/159753/4 accepted/tizen/unified/20171114.062805 submit/tizen/20171113.235549
authorWook Song <wook16.song@samsung.com>
Mon, 13 Nov 2017 04:05:07 +0000 (13:05 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 13 Nov 2017 06:35:45 +0000 (06:35 +0000)
This patch removes build warnings caused by differences between
expected function argument type and actual passed function argument and
the build warning caused by a variable declaration in the middle of
code. Note that the build warning introduced by -Wframe-larger-than
remains.

Change-Id: Ia59d6c978a3692757833778bdc65a225c864713e
Signed-off-by: Wook Song <wook16.song@samsung.com>
drivers/misc/clkmon/clk_mon.c

index fddc463..aae5ac0 100644 (file)
@@ -453,7 +453,8 @@ int clk_mon_clock_gate(unsigned int *clk_status)
 
                if (addr != clk_gate_masks[i].addr) {
                        addr = clk_gate_masks[i].addr;
-                       value = __raw_readl(clk_gate_masks[i].addr);
+                       value = __raw_readl((void __iomem __force *)
+                                       clk_gate_masks[i].addr);
                }
                val = CHECK_BIT_SET(value,
                        (unsigned int) clk_gate_masks[i].bit_number);
@@ -477,7 +478,6 @@ int clk_mon_get_clock_info(unsigned int *clk_status, char *buf)
        int bit_shift, idx;
        int size = 0;
        int val, i;
-       void __iomem *v_addr = NULL;
        unsigned int value = 0;
 
        if (!clk_status || !buf)
@@ -492,7 +492,8 @@ int clk_mon_get_clock_info(unsigned int *clk_status, char *buf)
 
                if (addr != clk_gate_masks[i].addr) {
                        addr = clk_gate_masks[i].addr;
-                       value = __raw_readl(clk_gate_masks[i].addr);
+                       value = __raw_readl((void __iomem __force *)
+                                       clk_gate_masks[i].addr);
                        size += snprintf(buf + size, CLK_MON_BUF_SIZE,
                                "\n[0x%x]\n",
                                ((unsigned int) clk_gate_masks[i].addr));
@@ -557,7 +558,8 @@ static ssize_t clk_mon_show_clock_gating(struct device *dev,
        for (i = 0; clk_gate_masks[i].addr != 0; i++) {
                if(addr != clk_gate_masks[i].addr){
                        addr = clk_gate_masks[i].addr;
-                       value = __raw_readl(clk_gate_masks[i].addr);
+                       value = __raw_readl((void __iomem __force *)
+                                       clk_gate_masks[i].addr);
                        size += sprintf(buf + size, "\n[0x%x] 0x%x\n",
                        vaddr_to_paddr(addr, CLK_REG), value);
                        }
@@ -605,26 +607,10 @@ static struct miscdevice clk_mon_device = {
 
 static int __init clk_mon_init(void)
 {
-       int ret = 0;
-
-       pr_info("%s\n", __func__);
-
-       ret = misc_register(&clk_mon_device);
-
-       if (ret) {
-               pr_err("%s: Unable to register clk_mon_device\n", __func__);
-               goto err_misc_register;
-       }
-
-       ret = sysfs_create_group(&clk_mon_device.this_device->kobj,
-                       &clk_mon_attr_group);
-
-       if (ret) {
-               pr_err("%s: Unable to Create sysfs node\n", __func__);
-               goto err_create_group;
-       }
-
-/* Base addresses of the registers are located in include/soc/sprd/sci_glb_regs.h */
+       /*
+        * Base addresses of the registers are located in
+        * include/soc/sprd/sci_glb_regs.h
+        * */
 
        struct clk_gate_mask clk_gate_mask_temp[] = {
        /* System Related Clocks, Start */
@@ -779,6 +765,25 @@ static int __init clk_mon_init(void)
 
        };
 
+       int ret = 0;
+
+       pr_info("%s\n", __func__);
+
+       ret = misc_register(&clk_mon_device);
+
+       if (ret) {
+               pr_err("%s: Unable to register clk_mon_device\n", __func__);
+               goto err_misc_register;
+       }
+
+       ret = sysfs_create_group(&clk_mon_device.this_device->kobj,
+                       &clk_mon_attr_group);
+
+       if (ret) {
+               pr_err("%s: Unable to Create sysfs node\n", __func__);
+               goto err_create_group;
+       }
+
        clk_gate_masks = kmalloc(sizeof(clk_gate_mask_temp), GFP_KERNEL);
        if (!clk_gate_masks)
                return -ENOMEM;