aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-09-23 19:15:11 -0400
committerPaul Walmsley <paul@pwsan.com>2012-09-23 19:15:11 -0400
commit2910f14584eddf2bc0db4baec3c6950ef357b52c (patch)
tree7396768abc8e9dfcf45e9376ac7405c6ae36339c /arch/arm/plat-omap
parent5698bd757d55b1bb87edd1a9744ab09c142abfc2 (diff)
parent7852ec0536ca39cefffc6301dc77f8ae55592926 (diff)
Merge tag 'omap-cleanup-b-for-3.7' into test_v3.6-rc6_ocb3.7_cff3.7_odaf3.7
smatch and string-wrapping cleanups for the OMAP subarch code. These changes fix some of the more meaningful warnings that smatch returns for the OMAP subarch code, and unwraps strings that are wrapped at the 80-column boundary, to conform with the current practice. Basic build, boot, and PM logs are available here: http://www.pwsan.com/omap/testlogs/warnings_a_cleanup_3.7/20120912025927/
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/dma.c51
-rw-r--r--arch/arm/plat-omap/mux.c2
-rw-r--r--arch/arm/plat-omap/omap-pm-noop.c39
-rw-r--r--arch/arm/plat-omap/omap_device.c25
4 files changed, 52 insertions, 65 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 7fe626761e5..4b3829ae533 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -969,8 +969,7 @@ void omap_stop_dma(int lch)
969 l = p->dma_read(CCR, lch); 969 l = p->dma_read(CCR, lch);
970 } 970 }
971 if (i >= 100) 971 if (i >= 100)
972 printk(KERN_ERR "DMA drain did not complete on " 972 pr_err("DMA drain did not complete on lch %d\n", lch);
973 "lch %d\n", lch);
974 /* Restore OCP_SYSCONFIG */ 973 /* Restore OCP_SYSCONFIG */
975 p->dma_write(sys_cf, OCP_SYSCONFIG, lch); 974 p->dma_write(sys_cf, OCP_SYSCONFIG, lch);
976 } else { 975 } else {
@@ -1154,8 +1153,7 @@ void omap_dma_link_lch(int lch_head, int lch_queue)
1154 1153
1155 if ((dma_chan[lch_head].dev_id == -1) || 1154 if ((dma_chan[lch_head].dev_id == -1) ||
1156 (dma_chan[lch_queue].dev_id == -1)) { 1155 (dma_chan[lch_queue].dev_id == -1)) {
1157 printk(KERN_ERR "omap_dma: trying to link " 1156 pr_err("omap_dma: trying to link non requested channels\n");
1158 "non requested channels\n");
1159 dump_stack(); 1157 dump_stack();
1160 } 1158 }
1161 1159
@@ -1181,15 +1179,13 @@ void omap_dma_unlink_lch(int lch_head, int lch_queue)
1181 1179
1182 if (dma_chan[lch_head].next_lch != lch_queue || 1180 if (dma_chan[lch_head].next_lch != lch_queue ||
1183 dma_chan[lch_head].next_lch == -1) { 1181 dma_chan[lch_head].next_lch == -1) {
1184 printk(KERN_ERR "omap_dma: trying to unlink " 1182 pr_err("omap_dma: trying to unlink non linked channels\n");
1185 "non linked channels\n");
1186 dump_stack(); 1183 dump_stack();
1187 } 1184 }
1188 1185
1189 if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) || 1186 if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) ||
1190 (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) { 1187 (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) {
1191 printk(KERN_ERR "omap_dma: You need to stop the DMA channels " 1188 pr_err("omap_dma: You need to stop the DMA channels before unlinking\n");
1192 "before unlinking\n");
1193 dump_stack(); 1189 dump_stack();
1194 } 1190 }
1195 1191
@@ -1831,16 +1827,15 @@ static int omap1_dma_handle_ch(int ch)
1831 if ((csr & 0x3f) == 0) 1827 if ((csr & 0x3f) == 0)
1832 return 0; 1828 return 0;
1833 if (unlikely(dma_chan[ch].dev_id == -1)) { 1829 if (unlikely(dma_chan[ch].dev_id == -1)) {
1834 printk(KERN_WARNING "Spurious interrupt from DMA channel " 1830 pr_warn("Spurious interrupt from DMA channel %d (CSR %04x)\n",
1835 "%d (CSR %04x)\n", ch, csr); 1831 ch, csr);
1836 return 0; 1832 return 0;
1837 } 1833 }
1838 if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) 1834 if (unlikely(csr & OMAP1_DMA_TOUT_IRQ))
1839 printk(KERN_WARNING "DMA timeout with device %d\n", 1835 pr_warn("DMA timeout with device %d\n", dma_chan[ch].dev_id);
1840 dma_chan[ch].dev_id);
1841 if (unlikely(csr & OMAP_DMA_DROP_IRQ)) 1836 if (unlikely(csr & OMAP_DMA_DROP_IRQ))
1842 printk(KERN_WARNING "DMA synchronization event drop occurred " 1837 pr_warn("DMA synchronization event drop occurred with device %d\n",
1843 "with device %d\n", dma_chan[ch].dev_id); 1838 dma_chan[ch].dev_id);
1844 if (likely(csr & OMAP_DMA_BLOCK_IRQ)) 1839 if (likely(csr & OMAP_DMA_BLOCK_IRQ))
1845 dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; 1840 dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE;
1846 if (likely(dma_chan[ch].callback != NULL)) 1841 if (likely(dma_chan[ch].callback != NULL))
@@ -1880,21 +1875,19 @@ static int omap2_dma_handle_ch(int ch)
1880 1875
1881 if (!status) { 1876 if (!status) {
1882 if (printk_ratelimit()) 1877 if (printk_ratelimit())
1883 printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", 1878 pr_warn("Spurious DMA IRQ for lch %d\n", ch);
1884 ch);
1885 p->dma_write(1 << ch, IRQSTATUS_L0, ch); 1879 p->dma_write(1 << ch, IRQSTATUS_L0, ch);
1886 return 0; 1880 return 0;
1887 } 1881 }
1888 if (unlikely(dma_chan[ch].dev_id == -1)) { 1882 if (unlikely(dma_chan[ch].dev_id == -1)) {
1889 if (printk_ratelimit()) 1883 if (printk_ratelimit())
1890 printk(KERN_WARNING "IRQ %04x for non-allocated DMA" 1884 pr_warn("IRQ %04x for non-allocated DMA channel %d\n",
1891 "channel %d\n", status, ch); 1885 status, ch);
1892 return 0; 1886 return 0;
1893 } 1887 }
1894 if (unlikely(status & OMAP_DMA_DROP_IRQ)) 1888 if (unlikely(status & OMAP_DMA_DROP_IRQ))
1895 printk(KERN_INFO 1889 pr_info("DMA synchronization event drop occurred with device %d\n",
1896 "DMA synchronization event drop occurred with device " 1890 dma_chan[ch].dev_id);
1897 "%d\n", dma_chan[ch].dev_id);
1898 if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { 1891 if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) {
1899 printk(KERN_INFO "DMA transaction error with device %d\n", 1892 printk(KERN_INFO "DMA transaction error with device %d\n",
1900 dma_chan[ch].dev_id); 1893 dma_chan[ch].dev_id);
@@ -2014,8 +2007,9 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2014 2007
2015 p = pdev->dev.platform_data; 2008 p = pdev->dev.platform_data;
2016 if (!p) { 2009 if (!p) {
2017 dev_err(&pdev->dev, "%s: System DMA initialized without" 2010 dev_err(&pdev->dev,
2018 "platform data\n", __func__); 2011 "%s: System DMA initialized without platform data\n",
2012 __func__);
2019 return -EINVAL; 2013 return -EINVAL;
2020 } 2014 }
2021 2015
@@ -2090,8 +2084,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2090 } 2084 }
2091 ret = setup_irq(dma_irq, &omap24xx_dma_irq); 2085 ret = setup_irq(dma_irq, &omap24xx_dma_irq);
2092 if (ret) { 2086 if (ret) {
2093 dev_err(&pdev->dev, "set_up failed for IRQ %d" 2087 dev_err(&pdev->dev, "set_up failed for IRQ %d for DMA (error %d)\n",
2094 "for DMA (error %d)\n", dma_irq, ret); 2088 dma_irq, ret);
2095 goto exit_dma_lch_fail; 2089 goto exit_dma_lch_fail;
2096 } 2090 }
2097 } 2091 }
@@ -2099,8 +2093,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2099 /* reserve dma channels 0 and 1 in high security devices */ 2093 /* reserve dma channels 0 and 1 in high security devices */
2100 if (cpu_is_omap34xx() && 2094 if (cpu_is_omap34xx() &&
2101 (omap_type() != OMAP2_DEVICE_TYPE_GP)) { 2095 (omap_type() != OMAP2_DEVICE_TYPE_GP)) {
2102 printk(KERN_INFO "Reserving DMA channels 0 and 1 for " 2096 pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n");
2103 "HS ROM code\n");
2104 dma_chan[0].dev_id = 0; 2097 dma_chan[0].dev_id = 0;
2105 dma_chan[1].dev_id = 1; 2098 dma_chan[1].dev_id = 1;
2106 } 2099 }
@@ -2108,8 +2101,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev)
2108 return 0; 2101 return 0;
2109 2102
2110exit_dma_irq_fail: 2103exit_dma_irq_fail:
2111 dev_err(&pdev->dev, "unable to request IRQ %d" 2104 dev_err(&pdev->dev, "unable to request IRQ %d for DMA (error %d)\n",
2112 "for DMA (error %d)\n", dma_irq, ret); 2105 dma_irq, ret);
2113 for (irq_rel = 0; irq_rel < ch; irq_rel++) { 2106 for (irq_rel = 0; irq_rel < ch; irq_rel++) {
2114 dma_irq = platform_get_irq(pdev, irq_rel); 2107 dma_irq = platform_get_irq(pdev, irq_rel);
2115 free_irq(dma_irq, (void *)(irq_rel + 1)); 2108 free_irq(dma_irq, (void *)(irq_rel + 1));
diff --git a/arch/arm/plat-omap/mux.c b/arch/arm/plat-omap/mux.c
index cff8712122b..fd0d3aad00e 100644
--- a/arch/arm/plat-omap/mux.c
+++ b/arch/arm/plat-omap/mux.c
@@ -76,7 +76,7 @@ int __init_or_module omap_cfg_reg(const unsigned long index)
76 return -ENODEV; 76 return -ENODEV;
77 } 77 }
78 78
79 reg = (struct pin_config *)&mux_cfg->pins[index]; 79 reg = &mux_cfg->pins[index];
80 80
81 if (!mux_cfg->cfg_reg) 81 if (!mux_cfg->cfg_reg)
82 return -ENODEV; 82 return -ENODEV;
diff --git a/arch/arm/plat-omap/omap-pm-noop.c b/arch/arm/plat-omap/omap-pm-noop.c
index 5a97b4d98d4..9f6413324df 100644
--- a/arch/arm/plat-omap/omap-pm-noop.c
+++ b/arch/arm/plat-omap/omap-pm-noop.c
@@ -41,11 +41,11 @@ int omap_pm_set_max_mpu_wakeup_lat(struct device *dev, long t)
41 }; 41 };
42 42
43 if (t == -1) 43 if (t == -1)
44 pr_debug("OMAP PM: remove max MPU wakeup latency constraint: " 44 pr_debug("OMAP PM: remove max MPU wakeup latency constraint: dev %s\n",
45 "dev %s\n", dev_name(dev)); 45 dev_name(dev));
46 else 46 else
47 pr_debug("OMAP PM: add max MPU wakeup latency constraint: " 47 pr_debug("OMAP PM: add max MPU wakeup latency constraint: dev %s, t = %ld usec\n",
48 "dev %s, t = %ld usec\n", dev_name(dev), t); 48 dev_name(dev), t);
49 49
50 /* 50 /*
51 * For current Linux, this needs to map the MPU to a 51 * For current Linux, this needs to map the MPU to a
@@ -70,11 +70,10 @@ int omap_pm_set_min_bus_tput(struct device *dev, u8 agent_id, unsigned long r)
70 }; 70 };
71 71
72 if (r == 0) 72 if (r == 0)
73 pr_debug("OMAP PM: remove min bus tput constraint: " 73 pr_debug("OMAP PM: remove min bus tput constraint: dev %s for agent_id %d\n",
74 "dev %s for agent_id %d\n", dev_name(dev), agent_id); 74 dev_name(dev), agent_id);
75 else 75 else
76 pr_debug("OMAP PM: add min bus tput constraint: " 76 pr_debug("OMAP PM: add min bus tput constraint: dev %s for agent_id %d: rate %ld KiB\n",
77 "dev %s for agent_id %d: rate %ld KiB\n",
78 dev_name(dev), agent_id, r); 77 dev_name(dev), agent_id, r);
79 78
80 /* 79 /*
@@ -97,11 +96,11 @@ int omap_pm_set_max_dev_wakeup_lat(struct device *req_dev, struct device *dev,
97 }; 96 };
98 97
99 if (t == -1) 98 if (t == -1)
100 pr_debug("OMAP PM: remove max device latency constraint: " 99 pr_debug("OMAP PM: remove max device latency constraint: dev %s\n",
101 "dev %s\n", dev_name(dev)); 100 dev_name(dev));
102 else 101 else
103 pr_debug("OMAP PM: add max device latency constraint: " 102 pr_debug("OMAP PM: add max device latency constraint: dev %s, t = %ld usec\n",
104 "dev %s, t = %ld usec\n", dev_name(dev), t); 103 dev_name(dev), t);
105 104
106 /* 105 /*
107 * For current Linux, this needs to map the device to a 106 * For current Linux, this needs to map the device to a
@@ -127,11 +126,11 @@ int omap_pm_set_max_sdma_lat(struct device *dev, long t)
127 }; 126 };
128 127
129 if (t == -1) 128 if (t == -1)
130 pr_debug("OMAP PM: remove max DMA latency constraint: " 129 pr_debug("OMAP PM: remove max DMA latency constraint: dev %s\n",
131 "dev %s\n", dev_name(dev)); 130 dev_name(dev));
132 else 131 else
133 pr_debug("OMAP PM: add max DMA latency constraint: " 132 pr_debug("OMAP PM: add max DMA latency constraint: dev %s, t = %ld usec\n",
134 "dev %s, t = %ld usec\n", dev_name(dev), t); 133 dev_name(dev), t);
135 134
136 /* 135 /*
137 * For current Linux PM QOS params, this code should scan the 136 * For current Linux PM QOS params, this code should scan the
@@ -156,11 +155,11 @@ int omap_pm_set_min_clk_rate(struct device *dev, struct clk *c, long r)
156 } 155 }
157 156
158 if (r == 0) 157 if (r == 0)
159 pr_debug("OMAP PM: remove min clk rate constraint: " 158 pr_debug("OMAP PM: remove min clk rate constraint: dev %s\n",
160 "dev %s\n", dev_name(dev)); 159 dev_name(dev));
161 else 160 else
162 pr_debug("OMAP PM: add min clk rate constraint: " 161 pr_debug("OMAP PM: add min clk rate constraint: dev %s, rate = %ld Hz\n",
163 "dev %s, rate = %ld Hz\n", dev_name(dev), r); 162 dev_name(dev), r);
164 163
165 /* 164 /*
166 * Code in a real implementation should keep track of these 165 * Code in a real implementation should keep track of these
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index c490240bb82..b59edb065c7 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -1,4 +1,3 @@
1
2/* 1/*
3 * omap_device implementation 2 * omap_device implementation
4 * 3 *
@@ -153,21 +152,19 @@ static int _omap_device_activate(struct omap_device *od, u8 ignore_lat)
153 act_lat = timespec_to_ns(&c); 152 act_lat = timespec_to_ns(&c);
154 153
155 dev_dbg(&od->pdev->dev, 154 dev_dbg(&od->pdev->dev,
156 "omap_device: pm_lat %d: activate: elapsed time " 155 "omap_device: pm_lat %d: activate: elapsed time %llu nsec\n",
157 "%llu nsec\n", od->pm_lat_level, act_lat); 156 od->pm_lat_level, act_lat);
158 157
159 if (act_lat > odpl->activate_lat) { 158 if (act_lat > odpl->activate_lat) {
160 odpl->activate_lat_worst = act_lat; 159 odpl->activate_lat_worst = act_lat;
161 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { 160 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
162 odpl->activate_lat = act_lat; 161 odpl->activate_lat = act_lat;
163 dev_dbg(&od->pdev->dev, 162 dev_dbg(&od->pdev->dev,
164 "new worst case activate latency " 163 "new worst case activate latency %d: %llu\n",
165 "%d: %llu\n",
166 od->pm_lat_level, act_lat); 164 od->pm_lat_level, act_lat);
167 } else 165 } else
168 dev_warn(&od->pdev->dev, 166 dev_warn(&od->pdev->dev,
169 "activate latency %d " 167 "activate latency %d higher than expected. (%llu > %d)\n",
170 "higher than exptected. (%llu > %d)\n",
171 od->pm_lat_level, act_lat, 168 od->pm_lat_level, act_lat,
172 odpl->activate_lat); 169 odpl->activate_lat);
173 } 170 }
@@ -220,21 +217,19 @@ static int _omap_device_deactivate(struct omap_device *od, u8 ignore_lat)
220 deact_lat = timespec_to_ns(&c); 217 deact_lat = timespec_to_ns(&c);
221 218
222 dev_dbg(&od->pdev->dev, 219 dev_dbg(&od->pdev->dev,
223 "omap_device: pm_lat %d: deactivate: elapsed time " 220 "omap_device: pm_lat %d: deactivate: elapsed time %llu nsec\n",
224 "%llu nsec\n", od->pm_lat_level, deact_lat); 221 od->pm_lat_level, deact_lat);
225 222
226 if (deact_lat > odpl->deactivate_lat) { 223 if (deact_lat > odpl->deactivate_lat) {
227 odpl->deactivate_lat_worst = deact_lat; 224 odpl->deactivate_lat_worst = deact_lat;
228 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) { 225 if (odpl->flags & OMAP_DEVICE_LATENCY_AUTO_ADJUST) {
229 odpl->deactivate_lat = deact_lat; 226 odpl->deactivate_lat = deact_lat;
230 dev_dbg(&od->pdev->dev, 227 dev_dbg(&od->pdev->dev,
231 "new worst case deactivate latency " 228 "new worst case deactivate latency %d: %llu\n",
232 "%d: %llu\n",
233 od->pm_lat_level, deact_lat); 229 od->pm_lat_level, deact_lat);
234 } else 230 } else
235 dev_warn(&od->pdev->dev, 231 dev_warn(&od->pdev->dev,
236 "deactivate latency %d " 232 "deactivate latency %d higher than expected. (%llu > %d)\n",
237 "higher than exptected. (%llu > %d)\n",
238 od->pm_lat_level, deact_lat, 233 od->pm_lat_level, deact_lat,
239 odpl->deactivate_lat); 234 odpl->deactivate_lat);
240 } 235 }
@@ -449,8 +444,8 @@ static int omap_device_count_resources(struct omap_device *od)
449 for (i = 0; i < od->hwmods_cnt; i++) 444 for (i = 0; i < od->hwmods_cnt; i++)
450 c += omap_hwmod_count_resources(od->hwmods[i]); 445 c += omap_hwmod_count_resources(od->hwmods[i]);
451 446
452 pr_debug("omap_device: %s: counted %d total resources across %d " 447 pr_debug("omap_device: %s: counted %d total resources across %d hwmods\n",
453 "hwmods\n", od->pdev->name, c, od->hwmods_cnt); 448 od->pdev->name, c, od->hwmods_cnt);
454 449
455 return c; 450 return c;
456} 451}