]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
selftests/powerpc: Fix compile error on tlbie_test due to newer gcc
authorDesnes A. Nunes do Rosario <desnesn@linux.ibm.com>
Thu, 17 Oct 2019 08:05:05 +0000 (13:35 +0530)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 26 Nov 2019 12:16:02 +0000 (13:16 +0100)
commit3553136243b0db9d0686e260caca4534211bcc74
treee29325cb4cdf7d10cfac39247a6a6d84d0a9a015
parentfcc07b160b49b781b8dc543e76acd77990ade6d4
selftests/powerpc: Fix compile error on tlbie_test due to newer gcc

BugLink: https://bugs.launchpad.net/bugs/1853208
commit 5b216ea1c40cf06eead15054c70e238c9bd4729e upstream.

Newer versions of GCC (>= 9) demand that the size of the string to be
copied must be explicitly smaller than the size of the destination.
Thus, the NULL char has to be taken into account on strncpy.

This will avoid the following compiling error:

  tlbie_test.c: In function 'main':
  tlbie_test.c:639:4: error: 'strncpy' specified bound 100 equals destination size
      strncpy(logdir, optarg, LOGDIR_NAME_SIZE);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Cc: stable@vger.kernel.org # v4.14
Signed-off-by: Desnes A. Nunes do Rosario <desnesn@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191003211010.9711-1-desnesn@linux.ibm.com
[sandipan: Backported to v4.14]
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
tools/testing/selftests/powerpc/mm/tlbie_test.c