diff options
author | Tony Lindgren <tony@atomide.com> | 2012-09-12 23:42:36 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-09-12 23:42:36 -0400 |
commit | 3c101c41fbe5daf88afbbd575542aa1d047812bb (patch) | |
tree | 97b8837a7ef888f07d01ff7109303402dd8fed2e /arch/arm/plat-omap | |
parent | f191f40c1819ffdca05408e6349f7fd30ef1cc36 (diff) | |
parent | 7852ec0536ca39cefffc6301dc77f8ae55592926 (diff) |
Merge tag 'omap-cleanup-b-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/pjw/omap-pending into cleanup-makefile-sparse
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.c | 51 | ||||
-rw-r--r-- | arch/arm/plat-omap/mux.c | 2 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap-pm-noop.c | 39 | ||||
-rw-r--r-- | arch/arm/plat-omap/omap_device.c | 25 |
4 files changed, 52 insertions, 65 deletions
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 6dcad5873d57..c76ed8bff838 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c | |||
@@ -968,8 +968,7 @@ void omap_stop_dma(int lch) | |||
968 | l = p->dma_read(CCR, lch); | 968 | l = p->dma_read(CCR, lch); |
969 | } | 969 | } |
970 | if (i >= 100) | 970 | if (i >= 100) |
971 | printk(KERN_ERR "DMA drain did not complete on " | 971 | pr_err("DMA drain did not complete on lch %d\n", lch); |
972 | "lch %d\n", lch); | ||
973 | /* Restore OCP_SYSCONFIG */ | 972 | /* Restore OCP_SYSCONFIG */ |
974 | p->dma_write(sys_cf, OCP_SYSCONFIG, lch); | 973 | p->dma_write(sys_cf, OCP_SYSCONFIG, lch); |
975 | } else { | 974 | } else { |
@@ -1153,8 +1152,7 @@ void omap_dma_link_lch(int lch_head, int lch_queue) | |||
1153 | 1152 | ||
1154 | if ((dma_chan[lch_head].dev_id == -1) || | 1153 | if ((dma_chan[lch_head].dev_id == -1) || |
1155 | (dma_chan[lch_queue].dev_id == -1)) { | 1154 | (dma_chan[lch_queue].dev_id == -1)) { |
1156 | printk(KERN_ERR "omap_dma: trying to link " | 1155 | pr_err("omap_dma: trying to link non requested channels\n"); |
1157 | "non requested channels\n"); | ||
1158 | dump_stack(); | 1156 | dump_stack(); |
1159 | } | 1157 | } |
1160 | 1158 | ||
@@ -1180,15 +1178,13 @@ void omap_dma_unlink_lch(int lch_head, int lch_queue) | |||
1180 | 1178 | ||
1181 | if (dma_chan[lch_head].next_lch != lch_queue || | 1179 | if (dma_chan[lch_head].next_lch != lch_queue || |
1182 | dma_chan[lch_head].next_lch == -1) { | 1180 | dma_chan[lch_head].next_lch == -1) { |
1183 | printk(KERN_ERR "omap_dma: trying to unlink " | 1181 | pr_err("omap_dma: trying to unlink non linked channels\n"); |
1184 | "non linked channels\n"); | ||
1185 | dump_stack(); | 1182 | dump_stack(); |
1186 | } | 1183 | } |
1187 | 1184 | ||
1188 | if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) || | 1185 | if ((dma_chan[lch_head].flags & OMAP_DMA_ACTIVE) || |
1189 | (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) { | 1186 | (dma_chan[lch_queue].flags & OMAP_DMA_ACTIVE)) { |
1190 | printk(KERN_ERR "omap_dma: You need to stop the DMA channels " | 1187 | pr_err("omap_dma: You need to stop the DMA channels before unlinking\n"); |
1191 | "before unlinking\n"); | ||
1192 | dump_stack(); | 1188 | dump_stack(); |
1193 | } | 1189 | } |
1194 | 1190 | ||
@@ -1830,16 +1826,15 @@ static int omap1_dma_handle_ch(int ch) | |||
1830 | if ((csr & 0x3f) == 0) | 1826 | if ((csr & 0x3f) == 0) |
1831 | return 0; | 1827 | return 0; |
1832 | if (unlikely(dma_chan[ch].dev_id == -1)) { | 1828 | if (unlikely(dma_chan[ch].dev_id == -1)) { |
1833 | printk(KERN_WARNING "Spurious interrupt from DMA channel " | 1829 | pr_warn("Spurious interrupt from DMA channel %d (CSR %04x)\n", |
1834 | "%d (CSR %04x)\n", ch, csr); | 1830 | ch, csr); |
1835 | return 0; | 1831 | return 0; |
1836 | } | 1832 | } |
1837 | if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) | 1833 | if (unlikely(csr & OMAP1_DMA_TOUT_IRQ)) |
1838 | printk(KERN_WARNING "DMA timeout with device %d\n", | 1834 | pr_warn("DMA timeout with device %d\n", dma_chan[ch].dev_id); |
1839 | dma_chan[ch].dev_id); | ||
1840 | if (unlikely(csr & OMAP_DMA_DROP_IRQ)) | 1835 | if (unlikely(csr & OMAP_DMA_DROP_IRQ)) |
1841 | printk(KERN_WARNING "DMA synchronization event drop occurred " | 1836 | pr_warn("DMA synchronization event drop occurred with device %d\n", |
1842 | "with device %d\n", dma_chan[ch].dev_id); | 1837 | dma_chan[ch].dev_id); |
1843 | if (likely(csr & OMAP_DMA_BLOCK_IRQ)) | 1838 | if (likely(csr & OMAP_DMA_BLOCK_IRQ)) |
1844 | dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; | 1839 | dma_chan[ch].flags &= ~OMAP_DMA_ACTIVE; |
1845 | if (likely(dma_chan[ch].callback != NULL)) | 1840 | if (likely(dma_chan[ch].callback != NULL)) |
@@ -1879,21 +1874,19 @@ static int omap2_dma_handle_ch(int ch) | |||
1879 | 1874 | ||
1880 | if (!status) { | 1875 | if (!status) { |
1881 | if (printk_ratelimit()) | 1876 | if (printk_ratelimit()) |
1882 | printk(KERN_WARNING "Spurious DMA IRQ for lch %d\n", | 1877 | pr_warn("Spurious DMA IRQ for lch %d\n", ch); |
1883 | ch); | ||
1884 | p->dma_write(1 << ch, IRQSTATUS_L0, ch); | 1878 | p->dma_write(1 << ch, IRQSTATUS_L0, ch); |
1885 | return 0; | 1879 | return 0; |
1886 | } | 1880 | } |
1887 | if (unlikely(dma_chan[ch].dev_id == -1)) { | 1881 | if (unlikely(dma_chan[ch].dev_id == -1)) { |
1888 | if (printk_ratelimit()) | 1882 | if (printk_ratelimit()) |
1889 | printk(KERN_WARNING "IRQ %04x for non-allocated DMA" | 1883 | pr_warn("IRQ %04x for non-allocated DMA channel %d\n", |
1890 | "channel %d\n", status, ch); | 1884 | status, ch); |
1891 | return 0; | 1885 | return 0; |
1892 | } | 1886 | } |
1893 | if (unlikely(status & OMAP_DMA_DROP_IRQ)) | 1887 | if (unlikely(status & OMAP_DMA_DROP_IRQ)) |
1894 | printk(KERN_INFO | 1888 | pr_info("DMA synchronization event drop occurred with device %d\n", |
1895 | "DMA synchronization event drop occurred with device " | 1889 | dma_chan[ch].dev_id); |
1896 | "%d\n", dma_chan[ch].dev_id); | ||
1897 | if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { | 1890 | if (unlikely(status & OMAP2_DMA_TRANS_ERR_IRQ)) { |
1898 | printk(KERN_INFO "DMA transaction error with device %d\n", | 1891 | printk(KERN_INFO "DMA transaction error with device %d\n", |
1899 | dma_chan[ch].dev_id); | 1892 | dma_chan[ch].dev_id); |
@@ -2013,8 +2006,9 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2013 | 2006 | ||
2014 | p = pdev->dev.platform_data; | 2007 | p = pdev->dev.platform_data; |
2015 | if (!p) { | 2008 | if (!p) { |
2016 | dev_err(&pdev->dev, "%s: System DMA initialized without" | 2009 | dev_err(&pdev->dev, |
2017 | "platform data\n", __func__); | 2010 | "%s: System DMA initialized without platform data\n", |
2011 | __func__); | ||
2018 | return -EINVAL; | 2012 | return -EINVAL; |
2019 | } | 2013 | } |
2020 | 2014 | ||
@@ -2089,8 +2083,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2089 | } | 2083 | } |
2090 | ret = setup_irq(dma_irq, &omap24xx_dma_irq); | 2084 | ret = setup_irq(dma_irq, &omap24xx_dma_irq); |
2091 | if (ret) { | 2085 | if (ret) { |
2092 | dev_err(&pdev->dev, "set_up failed for IRQ %d" | 2086 | dev_err(&pdev->dev, "set_up failed for IRQ %d for DMA (error %d)\n", |
2093 | "for DMA (error %d)\n", dma_irq, ret); | 2087 | dma_irq, ret); |
2094 | goto exit_dma_lch_fail; | 2088 | goto exit_dma_lch_fail; |
2095 | } | 2089 | } |
2096 | } | 2090 | } |
@@ -2098,8 +2092,7 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2098 | /* reserve dma channels 0 and 1 in high security devices */ | 2092 | /* reserve dma channels 0 and 1 in high security devices */ |
2099 | if (cpu_is_omap34xx() && | 2093 | if (cpu_is_omap34xx() && |
2100 | (omap_type() != OMAP2_DEVICE_TYPE_GP)) { | 2094 | (omap_type() != OMAP2_DEVICE_TYPE_GP)) { |
2101 | printk(KERN_INFO "Reserving DMA channels 0 and 1 for " | 2095 | pr_info("Reserving DMA channels 0 and 1 for HS ROM code\n"); |
2102 | "HS ROM code\n"); | ||
2103 | dma_chan[0].dev_id = 0; | 2096 | dma_chan[0].dev_id = 0; |
2104 | dma_chan[1].dev_id = 1; | 2097 | dma_chan[1].dev_id = 1; |
2105 | } | 2098 | } |
@@ -2107,8 +2100,8 @@ static int __devinit omap_system_dma_probe(struct platform_device *pdev) | |||
2107 | return 0; | 2100 | return 0; |
2108 | 2101 | ||
2109 | exit_dma_irq_fail: | 2102 | exit_dma_irq_fail: |
2110 | dev_err(&pdev->dev, "unable to request IRQ %d" | 2103 | dev_err(&pdev->dev, "unable to request IRQ %d for DMA (error %d)\n", |
2111 | "for DMA (error %d)\n", dma_irq, ret); | 2104 | dma_irq, ret); |
2112 | for (irq_rel = 0; irq_rel < ch; irq_rel++) { | 2105 | for (irq_rel = 0; irq_rel < ch; irq_rel++) { |
2113 | dma_irq = platform_get_irq(pdev, irq_rel); | 2106 | dma_irq = platform_get_irq(pdev, irq_rel); |
2114 | free_irq(dma_irq, (void *)(irq_rel + 1)); | 2107 | 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 cff8712122bb..fd0d3aad00ef 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 5a97b4d98d41..9f6413324df9 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 c490240bb82c..b59edb065c70 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 | } |