Commit bff9285
firmware: cs_dsp: Don't allocate temporary buffer for info text
Don't allocate a temporary buffer to hold a NUL-terminated copy
of the NAME/INFO string from the wmfw/bin. It can be printed
directly to the log. Also limit the maximum number of characters
that will be logged from this string.
The NAME/INFO blocks in the firmware files are an array of
characters with a length, not a NUL-terminated C string. The
original code allocated a temporary buffer to make a
NUL-terminated copy of the string and then passed that to
dev_info(). There's no need for this: printf formatting can
use "%.*s" to print a character array of a given length.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240710103640.78197-2-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 680e126 commit bff9285
1 file changed
Lines changed: 7 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
1470 | 1471 | | |
1471 | 1472 | | |
1472 | 1473 | | |
1473 | | - | |
1474 | 1474 | | |
1475 | 1475 | | |
1476 | 1476 | | |
| |||
1542 | 1542 | | |
1543 | 1543 | | |
1544 | 1544 | | |
1545 | | - | |
1546 | 1545 | | |
1547 | 1546 | | |
1548 | 1547 | | |
1549 | 1548 | | |
| 1549 | + | |
1550 | 1550 | | |
1551 | | - | |
1552 | | - | |
1553 | | - | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
1554 | 1554 | | |
1555 | 1555 | | |
1556 | 1556 | | |
1557 | 1557 | | |
1558 | 1558 | | |
1559 | 1559 | | |
1560 | 1560 | | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
1564 | | - | |
1565 | | - | |
1566 | 1561 | | |
1567 | 1562 | | |
1568 | 1563 | | |
| |||
1596 | 1591 | | |
1597 | 1592 | | |
1598 | 1593 | | |
1599 | | - | |
1600 | | - | |
1601 | | - | |
1602 | | - | |
1603 | | - | |
1604 | | - | |
1605 | | - | |
1606 | 1594 | | |
1607 | 1595 | | |
1608 | 1596 | | |
| |||
1644 | 1632 | | |
1645 | 1633 | | |
1646 | 1634 | | |
1647 | | - | |
1648 | 1635 | | |
1649 | 1636 | | |
1650 | 1637 | | |
| |||
2177 | 2164 | | |
2178 | 2165 | | |
2179 | 2166 | | |
2180 | | - | |
2181 | 2167 | | |
2182 | 2168 | | |
2183 | 2169 | | |
| |||
2246 | 2232 | | |
2247 | 2233 | | |
2248 | 2234 | | |
2249 | | - | |
| 2235 | + | |
| 2236 | + | |
2250 | 2237 | | |
2251 | 2238 | | |
2252 | 2239 | | |
| |||
2318 | 2305 | | |
2319 | 2306 | | |
2320 | 2307 | | |
2321 | | - | |
2322 | | - | |
2323 | | - | |
2324 | | - | |
2325 | | - | |
2326 | | - | |
2327 | | - | |
2328 | 2308 | | |
2329 | 2309 | | |
2330 | 2310 | | |
| |||
2364 | 2344 | | |
2365 | 2345 | | |
2366 | 2346 | | |
2367 | | - | |
2368 | 2347 | | |
2369 | 2348 | | |
2370 | 2349 | | |
| |||
0 commit comments