]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: fix sparse errors and warnings
authorShridhar Rasal <srasal@nvidia.com>
Thu, 6 Nov 2014 07:18:24 +0000 (12:48 +0530)
committerSachin Nikam <snikam@nvidia.com>
Fri, 7 Nov 2014 03:16:49 +0000 (19:16 -0800)
Fixes issues:
warning: symbol <SYMBOL> was not declared. Should it be static?
warning: incorrect type in initializer (different address spaces)

Bug 1573777

Change-Id: I7f223851ad8dd5ebddc2a15ce4cfa0bf298418ac
Signed-off-by: Shridhar Rasal <srasal@nvidia.com>
Reviewed-on: http://git-master/r/594764
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
drivers/video/tegra/host/bus_client.c
drivers/video/tegra/host/chip_support.c
drivers/video/tegra/host/nvhost_acm.c
drivers/video/tegra/host/nvhost_channel.c
drivers/video/tegra/host/nvhost_intr.c
drivers/video/tegra/host/pod_scaling.c
drivers/video/tegra/host/scale3d.c
drivers/video/tegra/host/t124/t124.c
drivers/video/tegra/host/tsec/tsec.c
drivers/video/tegra/host/vi/tegra_vi.c
drivers/video/tegra/host/vii2c/vii2c.c

index 6a25b1d656ac576b56838cbe9c06aff5fc62c99a..65e9a86de5404ac16f018bfe34aef274014f9227 100644 (file)
@@ -53,7 +53,7 @@
 #include "nvhost_job.h"
 #include "nvhost_sync.h"
 
-DEFINE_MUTEX(channel_lock);
+static DEFINE_MUTEX(channel_lock);
 
 int nvhost_check_bondout(unsigned int id)
 {
index 2e9b88eace75e0839fb6e12dbb7994dc47ba9c91..75f8f81e28d446acd2f901740771735da509d7b6 100644 (file)
@@ -27,7 +27,7 @@
 #include "t124/t124.h"
 #include "t210/t210.h"
 
-struct nvhost_chip_support *nvhost_chip_ops;
+static struct nvhost_chip_support *nvhost_chip_ops;
 
 struct nvhost_chip_support *nvhost_get_chip_ops(void)
 {
index 807ab1e43ee7867bf502338010bb46d06f774c81..fcc2edfcad9d7a36e4ebc6779fe47cd63219bb08 100644 (file)
@@ -61,7 +61,7 @@ static int nvhost_module_prepare_poweroff(struct device *dev);
 static int nvhost_module_finalize_poweron(struct device *dev);
 #endif
 
-DEFINE_MUTEX(client_list_lock);
+static DEFINE_MUTEX(client_list_lock);
 
 struct nvhost_module_client {
        struct list_head node;
@@ -817,9 +817,9 @@ const struct dev_pm_ops nvhost_module_pm_ops = {
 EXPORT_SYMBOL(nvhost_module_pm_ops);
 
 /*FIXME Use API to get host1x domain */
-struct generic_pm_domain *host1x_domain;
+static struct generic_pm_domain *host1x_domain;
 
-int _nvhost_module_add_domain(struct generic_pm_domain *domain,
+static int _nvhost_module_add_domain(struct generic_pm_domain *domain,
        struct platform_device *pdev, bool client)
 {
        int ret = 0;
index 8b0203d3b6e9242ce34a5b66ef0cd44c1d422aa1..44817608d3f726add923e203d7c0a186d0d2f266 100644 (file)
@@ -33,7 +33,7 @@
 #define NVHOST_CHANNEL_LOW_PRIO_MAX_WAIT 50
 
 /* Constructor for the host1x device list */
-int nvhost_channel_list_init(struct nvhost_master *host)
+static int nvhost_channel_list_init(struct nvhost_master *host)
 {
        if (host->info.nb_channels > BITS_PER_LONG) {
                WARN(1, "host1x hardware has more channels than supported\n");
@@ -98,7 +98,7 @@ struct nvhost_channel *nvhost_check_channel(struct nvhost_device_data *pdata)
 }
 
 /* Check if more than channel needed for device and assign */
-int nvhost_channel_assign(struct nvhost_device_data *pdata,
+static int nvhost_channel_assign(struct nvhost_device_data *pdata,
                          struct nvhost_channel *ch)
 {
        int i;
index b919dfa25682e8f3a6639b27a27f20b6c0d83657..09fcfa46c08cba3f66141cfc2dddecc69f019d65 100644 (file)
@@ -160,7 +160,7 @@ static void remove_completed_waiters(struct list_head *head, u32 sync,
        }
 }
 
-void reset_threshold_interrupt(struct nvhost_intr *intr,
+static void reset_threshold_interrupt(struct nvhost_intr *intr,
                               struct list_head *head,
                               unsigned int id)
 {
index d613af47c5d28bdf90672b4f587d513e3557ad3d..54af86551be0a53cf3dbce9f7dc5501c586f8504 100644 (file)
@@ -394,7 +394,8 @@ static unsigned long scaling_state_check(struct devfreq *df, ktime_t time)
  * higher compared to the target frequency.
  ******************************************************************************/
 
-int freqlist_up(struct podgov_info_rec *podgov, unsigned long target, int steps)
+static int freqlist_up(struct podgov_info_rec *podgov, unsigned long target,
+                       int steps)
 {
        int i, pos;
 
@@ -406,26 +407,6 @@ int freqlist_up(struct podgov_info_rec *podgov, unsigned long target, int steps)
        return podgov->freqlist[pos];
 }
 
-/*******************************************************************************
- * freqlist_down(podgov, target, steps)
- *
- * This function determines the frequency that is "steps" frequency steps
- * lower compared to the target frequency.
- ******************************************************************************/
-
-int freqlist_down(struct podgov_info_rec *podgov, unsigned long target,
-                 int steps)
-{
-       int i, pos;
-
-       for (i = podgov->freq_count - 1; i >= 0; i--)
-               if (podgov->freqlist[i] <= target)
-                       break;
-
-       pos = max(0, i - steps);
-       return podgov->freqlist[pos];
-}
-
 /*******************************************************************************
  * podgov_idle_handler(work)
  *
@@ -457,6 +438,26 @@ static void podgov_idle_handler(struct work_struct *work)
 }
 
 #ifdef CONFIG_TEGRA_THROUGHPUT
+/*******************************************************************************
+ * freqlist_down(podgov, target, steps)
+ *
+ * This function determines the frequency that is "steps" frequency steps
+ * lower compared to the target frequency.
+ ******************************************************************************/
+
+static int freqlist_down(struct podgov_info_rec *podgov, unsigned long target,
+                 int steps)
+{
+       int i, pos;
+
+       for (i = podgov->freq_count - 1; i >= 0; i--)
+               if (podgov->freqlist[i] <= target)
+                       break;
+
+       pos = max(0, i - steps);
+       return podgov->freqlist[pos];
+}
+
 /*******************************************************************************
  * nvhost_scale3d_set_throughput_hint(hint)
  *
index 4bd828ffa058eb9ebf1c25a05727f35f4fa700ac..e5f406fecc679e1306683242ac7ea13ac98cf9cc 100644 (file)
@@ -272,12 +272,12 @@ void nvhost_scale3d_deinit(struct platform_device *pdev)
  * int FXDIV(int x, int y)
  */
 
-int FXMUL(int x, int y)
+static int FXMUL(int x, int y)
 {
        return ((long long) x * (long long) y) >> FXFRAC;
 }
 
-int FXDIV(int x, int y)
+static int FXDIV(int x, int y)
 {
        /* long long div operation not supported, must shift manually. This
         * would have been
index f5e6e03700f9537a61b2785f277099b0ca1204e0..d9815ec274d199e362682134c1be072ee97ba59c 100644 (file)
@@ -94,7 +94,7 @@ struct nvhost_device_data t124_host1x_info = {
 };
 
 
-static struct platform_device tegra_host1x04_device = {
+struct platform_device tegra_host1x04_device = {
        .name           = "host1x",
        .id             = -1,
 #ifdef CONFIG_ARCH_TEGRA
@@ -352,7 +352,7 @@ struct nvhost_device_data t124_msenc_info = {
        .gather_filter_enabled = true,
 };
 
-struct platform_device tegra_msenc03_device = {
+static struct platform_device tegra_msenc03_device = {
        .name          = "msenc",
        .id            = -1,
        .resource      = msenc_resources,
@@ -448,7 +448,7 @@ struct nvhost_device_data t124_vic_info = {
        .num_ppc                = 2,
 };
 
-struct platform_device tegra_vic03_device = {
+static struct platform_device tegra_vic03_device = {
        .name          = "vic03",
        .num_resources = 1,
        .resource      = vic03_resources,
@@ -462,7 +462,7 @@ struct platform_device tegra_vic03_device = {
  * T132 overrides for platform data.
  */
 
-struct nvhost_device_data t132_msenc_info = {
+static struct nvhost_device_data t132_msenc_info = {
        .num_channels   = 1,
        .version        = NVHOST_ENCODE_FLCN_VER(3, 1),
        .modulemutexes  = {NVMODMUTEX_MSENC},
index 9649f5063bb19ccd4c9432c27c332808975cef02..272313140f9e9d3405d3f42c210d6c090de9517f 100644 (file)
@@ -76,7 +76,7 @@ static int nvhost_tsec_init_sw(struct platform_device *dev);
 static u8 otf_key[TSEC_KEY_LENGTH];
 
 /* Pointer to this device */
-struct platform_device *tsec;
+static struct platform_device *tsec;
 
 int tsec_hdcp_create_context(struct hdcp_context_t *hdcp_context)
 {
@@ -289,7 +289,7 @@ exit:
 
 }
 
-void tsec_execute_method(dma_addr_t dma_handle,
+static void tsec_execute_method(dma_addr_t dma_handle,
        u32 *cpuvaddr,
        u32 opcode_len)
 {
@@ -416,7 +416,7 @@ exit:
        return;
 }
 
-void tsec_write_mthd(u32 *buf, u32 mid, u32 data, u32 *offset)
+static void tsec_write_mthd(u32 *buf, u32 mid, u32 data, u32 *offset)
 {
        int i = 0;
        buf[i++] = nvhost_opcode_incr(NV_PSEC_THI_METHOD0>>2, 1);
@@ -807,7 +807,7 @@ static int tsec_setup_ucode_image(struct platform_device *dev,
        return 0;
 }
 
-int tsec_read_ucode(struct platform_device *dev, const char *fw_name)
+static int tsec_read_ucode(struct platform_device *dev, const char *fw_name)
 {
        struct tsec *m = get_tsec(dev);
        const struct firmware *ucode_fw;
index 24ec77527844d6387990f89c2b2cbfd78dca1d41..134ee2393b1f19b8d52af78cb6016e47f4af0a43 100644 (file)
@@ -243,7 +243,7 @@ static int vi_set_la(struct vi *tegra_vi1, uint vi_bw)
 }
 
 
-long vi_ioctl(struct file *file,
+static long vi_ioctl(struct file *file,
                unsigned int cmd, unsigned long arg)
 {
        struct vi *tegra_vi = file->private_data;
index c3901c8c7e9b9400b43fd484c05d631800dd114c..5f6d587bf545bb6b21a3c052258f01cdb48110ea 100644 (file)
@@ -51,7 +51,7 @@ struct vii2c {
        u32 sync_fence;
 };
 
-struct platform_device *vii2c_pdev;
+static struct platform_device *vii2c_pdev;
 
 static struct of_device_id vii2c_of_match[] = {
 #if defined(CONFIG_TEGRA_GRHOST_VII2C)