summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-11 13:50:55 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-13 09:18:53 +0100
commita604686c468dc0ab9492dbeaa1722cc3878b0582 (patch)
tree5a0a2beafb00f8ee13a4ccb80a8f25224ae3db51
parentb4e4b85708bb31df79d6fc77661bb171e07e0868 (diff)
downloadlinux-a604686c468dc0ab9492dbeaa1722cc3878b0582.tar.gz
linux-a604686c468dc0ab9492dbeaa1722cc3878b0582.tar.bz2
linux-a604686c468dc0ab9492dbeaa1722cc3878b0582.zip
staging: atomisp: remove "fun" strncpy warning
[for older kernels only, atomisp has been removed from upstream] gcc-8 rightfully warns that this instance of strncpy is just copying from the source, to the same source, for a few bytes. Meaning this call does nothing. As the author of the code obviously meant it to do something, but this code must be working properly, just replace the call to the kernel internal strscpy() which gcc doesn't know about, so the warning goes away. As this driver was deleted from newer kernel versions, none of this really matters but now at least we do not have to worry about a build warning in the stable trees. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
index 0fa7cb2423d8..0320c089f688 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/debug/src/ia_css_debug.c
@@ -2860,9 +2860,7 @@ ia_css_debug_pipe_graph_dump_stage(
if (l <= ENABLE_LINE_MAX_LENGTH) {
/* It fits on one line, copy string and init */
/* other helper strings with empty string */
- strcpy_s(enable_info,
- sizeof(enable_info),
- ei);
+ strscpy(enable_info, ei, sizeof(enable_info));
} else {
/* Too big for one line, find last comma */
p = ENABLE_LINE_MAX_LENGTH;