media: fimc-is: fix code issues pointed by CPPTest tool
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 24 Nov 2015 09:33:57 +0000 (10:33 +0100)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:48:55 +0000 (13:48 +0900)
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
drivers/media/platform/exynos/fimc-is/fimc-is-companion_address.h
drivers/media/platform/exynos/fimc-is/fimc-is-device-af.h
drivers/media/platform/exynos/fimc-is/fimc-is-device-ois.c
drivers/media/platform/exynos/fimc-is/fimc-is-device-ois.h
drivers/media/platform/exynos/fimc-is/fimc-is-fan53555.h
drivers/spi/spi-exynos5433-isp.c

index a16bfad..f72ad77 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef __MEDIA_FIMC_IS_FIMC_IS_COMPANION_ADDRESS_H
+#define __MEDIA_FIMC_IS_FIMC_IS_COMPANION_ADDRESS_H
+
 /*2P2 Address*/
 #define        MEM_GRAS_B_2P2                                          0x2001A000      //      0x00000000      0x1A00  0x2001A000      0x0020
 #define        MEM_AF_10_1_2P2                                         0x2000B900      //      0x00000000      0x0200  0x2000B900      0x0020
@@ -24,3 +27,4 @@
 #define        grasTuning_actuatorPositionToShadingPowerLut_0_IMX240           0x40000984      //          0x0032      0x0002  0x2000097C      0x0002
 #define        grasTuning_actuatorPositionToShadingPowerLut_9_IMX240           0x40000996      //          0x00CF      0x0002  0x2000098E      0x0002
 
+#endif
index 47108ef..b789a80 100644 (file)
@@ -10,6 +10,9 @@
  * published by the Free Software Foundation.
  */
 
+#ifndef __MEDIA_FIMC_IS_DEVICE_AF_H
+#define __MEDIA_FIMC_IS_DEVICE_AF_H
+
 struct fimc_is_device_af {
        struct v4l2_device                              v4l2_dev;
        struct platform_device                          *pdev;
@@ -27,3 +30,5 @@ struct remove_af_noise {
 int fimc_is_af_i2c_write(struct i2c_client *client ,u16 addr, u16 data);
 int16_t fimc_is_af_enable(void *device, bool onoff);
 int16_t fimc_is_af_move_lens(struct fimc_is_core *core);
+
+#endif
index 7e375e7..ca7de86 100644 (file)
@@ -515,7 +515,7 @@ int fimc_is_ois_self_test(struct fimc_is_core *core)
        do {
                ret = fimc_is_ois_i2c_read(core->client1, 0x0014, &val);
                if (ret != 0) {
-                       val = -EIO;
+                       ret = -EIO;
                        break;
                }
                msleep(10);
@@ -527,7 +527,7 @@ int fimc_is_ois_self_test(struct fimc_is_core *core)
 
        ret = fimc_is_ois_i2c_read(core->client1, 0x0004, &val);
        if (ret != 0) {
-               val = -EIO;
+               ret = -EIO;
        }
 
        if (core->use_ois_hsi2c) {
@@ -535,7 +535,7 @@ int fimc_is_ois_self_test(struct fimc_is_core *core)
        }
 
        pr_info("%s(%d) : X\n", __FUNCTION__, val);
-       return (int)val;
+       return ret == 0 ? val : ret;
 }
 
 bool fimc_is_ois_diff_test(struct fimc_is_core *core, int *x_diff, int *y_diff)
index d79ab14..85c783f 100644 (file)
@@ -10,6 +10,9 @@
  * published by the Free Software Foundation.
  */
 
+#ifndef __MEDIA_FIMC_IS_DEVICE_OIS_H
+#define __MEDIA_FIMC_IS_DEVICE_OIS_H
+
 struct fimc_is_device_ois {
        struct v4l2_device                              v4l2_dev;
        struct platform_device                          *pdev;
@@ -47,4 +50,6 @@ void fimc_is_ois_init_thread(struct fimc_is_core *core);
 bool fimc_is_ois_read_userdata(struct fimc_is_core *core);
 void fimc_is_ois_exif_data(struct fimc_is_core *core);
 int fimc_is_ois_get_exif_data(struct fimc_is_ois_exif **exif_info);
-void fimc_is_ois_fw_status(struct fimc_is_core *core, u8 *checksum, u8 *caldata);
\ No newline at end of file
+void fimc_is_ois_fw_status(struct fimc_is_core *core, u8 *checksum, u8 *caldata);
+
+#endif
index deb9029..43a88a8 100644 (file)
@@ -14,6 +14,9 @@
 #include <linux/slab.h>
 #include "fimc-is-core.h"
 
+#ifndef __MEDIA_FIMC_IS_FAN53555_H
+#define __MEDIA_FIMC_IS_FAN53555_H
+
 typedef unsigned char BYTE;
 
 #define REG_VSEL0              0x00
@@ -106,4 +109,4 @@ int fan53555_get_vout_val(int sel);
 const char *fan53555_get_vout_str(int sel);
 int fan53555_set_vsel0_vout(struct i2c_client *client, int vout);
 
-
+#endif
index fabe897..674a88d 100644 (file)
 
 #define S3C64XX_SPI_TRAILCNT           S3C64XX_SPI_MAX_TRAILCNT
 
-#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * t)
+#define msecs_to_loops(t) (loops_per_jiffy / 1000 * HZ * (t))
 
 #define RXBUSY    (1<<2)
 #define TXBUSY    (1<<3)