diff options
| author | Kishor Krishna Bhat <kishkris@codeaurora.org> | 2020-07-08 19:23:29 +0530 |
|---|---|---|
| committer | Kishor Krishna Bhat <kishkris@codeaurora.org> | 2020-07-13 17:25:47 +0530 |
| commit | 73ca7c6ede75a1367bcca5fbfc83b0ce0da26241 (patch) | |
| tree | dcb3f16d0445e080706145ab81aa031bd389ad5d | |
| parent | e9c0b83e0ab63f8efa01fa0a3ca85edf90611e5c (diff) | |
ASoC: Fix warnings and errors with llvm
Fix snprintf size large argument error
when llvm is enabled.
Change-Id: Icb9fa015e5d925e6c0b6aad379e422384a6fad13
Signed-off-by: Kishor Krishna Bhat <kishkris@codeaurora.org>
| -rw-r--r-- | sound/soc/codecs/wcd_cpe_core.c | 6 | ||||
| -rw-r--r-- | sound/soc/codecs/wsa881x.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/sound/soc/codecs/wcd_cpe_core.c b/sound/soc/codecs/wcd_cpe_core.c index 337c25f869d6..a4ef63bcd32e 100644 --- a/sound/soc/codecs/wcd_cpe_core.c +++ b/sound/soc/codecs/wcd_cpe_core.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2018,2020 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1987,8 +1987,8 @@ struct wcd_cpe_core *wcd_cpe_init(const char *img_fname, } card = codec->component.card->snd_card; - snprintf(proc_name, (sizeof("cpe") + sizeof("_state") + - sizeof(id) - 2), "%s%d%s", cpe_name, id, state_name); + snprintf(proc_name, sizeof(proc_name), "%s%d%s", cpe_name, id, + state_name); entry = snd_info_create_card_entry(card, proc_name, card->proc_root); if (entry) { diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c index 0c672fd89652..df2b5ff24054 100644 --- a/sound/soc/codecs/wsa881x.c +++ b/sound/soc/codecs/wsa881x.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2018,2020 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -362,8 +362,8 @@ static ssize_t wsa881x_swrslave_reg_show(char __user *ubuf, size_t count, continue; swr_read(dbgwsa881x->swr_slave, devnum, i, ®_val, 1); - len = snprintf(tmp_buf, 25, "0x%.3x: 0x%.2x\n", i, - (reg_val & 0xFF)); + len = snprintf(tmp_buf, sizeof(tmp_buf), "0x%.3x: 0x%.2x\n", + i, (reg_val & 0xFF)); if ((total + len) >= count - 1) break; if (copy_to_user((ubuf + total), tmp_buf, len)) { |
