gpiolib: cdev: replace strncpy() with strscpy()
authorKent Gibson <warthog618@gmail.com>
Mon, 28 Sep 2020 00:27:49 +0000 (08:27 +0800)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 30 Sep 2020 08:56:27 +0000 (10:56 +0200)
commit69e4e1368803266d0e06dba86868f64f7b277cde
tree6aa889fff1d2424090eac673aa9e018da76f7aab
parent0dc11e3ad353e19b1a119e3146c69c0930ecae5f
gpiolib: cdev: replace strncpy() with strscpy()

Replace usage of strncpy() with strscpy() to remove -Wstringop-truncation
warnings.

The structures being populated are zeroed, to prevent stack leakage as
they are returned to userspace, so strscpy() performs the equivalent
function without the warnings.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Kent Gibson <warthog618@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib-cdev.c