]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
Staging: lustre: remove two build warnings
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Dec 2018 12:50:37 +0000 (13:50 +0100)
committerSultan Alsawaf <sultan.alsawaf@canonical.com>
Wed, 24 Jul 2019 15:45:04 +0000 (09:45 -0600)
commit649aa14a24c06e22d036db345e8c2da4d68e1e1f
treeb2b5b28cad434de9646760b7a2398ea1f512ffed
parente2dd7434933f16c81bc1afa3f65b314ac31fd85c
Staging: lustre: remove two build warnings

BugLink: https://bugs.launchpad.net/bugs/1837161
[for older kernels only, lustre has been removed from upstream]

When someone writes:
strncpy(dest, source, sizeof(source));
they really are just doing the same thing as:
strcpy(dest, source);
but somehow they feel better because they are now using the "safe"
version of the string functions.  Cargo-cult programming at its
finest...

gcc-8 rightfully warns you about doing foolish things like this.  Now
that the stable kernels are all starting to be built using gcc-8, let's
get rid of this warning so that we do not have to gaze at this horror.

To dropt the warning, just convert the code to using strcpy() so that if
someone really wants to audit this code and find all of the obvious
problems, it will be easier to do so.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/lustre/lnet/lnet/config.c
drivers/staging/lustre/lustre/lmv/lmv_obd.c