summaryrefslogtreecommitdiff
path: root/tools/lib/python/kdoc/kdoc_parser.py
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@linaro.org>2025-10-27 10:08:51 +0300
committerMathieu Poirier <mathieu.poirier@linaro.org>2025-11-10 10:40:44 -0700
commit5a3d530caab22c235c994b38a860549da04171a4 (patch)
tree9ac0b9e365c0f7d405affd8d40922c6cf13db656 /tools/lib/python/kdoc/kdoc_parser.py
parent12dc929c6cc5fb5f82d6f245ceb3548b4c800121 (diff)
remoteproc: mediatek: Change the snprintf() checking
The snprintf() calls here work but they have several minor style issues: 1) It uses ARRAY_SIZE() which is the number of elements in an array. Since were talking about char that works, but it's more common to use sizeof() which is the number of bytes. 2) The printf format is "%1d". The "1" ensures we always print at least 1 character but since numbers all have at least 1 digit this can be removed. 3) The kernel implementation of snprintf() cannot return negative error codes. Also these particular calls to snprintf() can't return zero and the code to handle that zero return is sort of questionable. 4) In the current kernel the only "core_id" we print is "0" but if it was more than 9 then the output would be truncated so GCC complains. Add an "a >= sizeof(scp_fw_file)" check for output which is too long. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/aP8agyKj73bLZrTQ@stanley.mountain Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Diffstat (limited to 'tools/lib/python/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions