Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/amlogic shut up a clang warning about snprintf(...



details:   https://anonhg.NetBSD.org/src/rev/5895a70e3257
branches:  trunk
changeset: 979719:5895a70e3257
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri Jan 08 00:13:20 2021 +0000

description:
shut up a clang warning about snprintf() called with a variable as format
string
NFCI

diffstat:

 sys/arch/arm/amlogic/meson_thermal.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 2ffd336db159 -r 5895a70e3257 sys/arch/arm/amlogic/meson_thermal.c
--- a/sys/arch/arm/amlogic/meson_thermal.c      Thu Jan 07 23:57:25 2021 +0000
+++ b/sys/arch/arm/amlogic/meson_thermal.c      Fri Jan 08 00:13:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: meson_thermal.c,v 1.1 2021/01/01 07:21:58 ryo Exp $ */
+/* $NetBSD: meson_thermal.c,v 1.2 2021/01/08 00:13:20 macallan Exp $ */
 
 /*
  * Copyright (c) 2021 Ryo Shimizu <ryo%nerv.org@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: meson_thermal.c,v 1.1 2021/01/01 07:21:58 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: meson_thermal.c,v 1.2 2021/01/08 00:13:20 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -226,7 +226,8 @@
        sc->sc_sme->sme_refresh = meson_thermal_refresh;
        sc->sc_sensor_temp.units = ENVSYS_STEMP;
        sc->sc_sensor_temp.state = ENVSYS_SINVALID;
-       snprintf(sc->sc_sensor_temp.desc, ENVSYS_DESCLEN, sc->sc_conf->name);
+       snprintf(sc->sc_sensor_temp.desc, ENVSYS_DESCLEN,
+           "%s", sc->sc_conf->name);
 
        sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor_temp);
        sysmon_envsys_register(sc->sc_sme);



Home | Main Index | Thread Index | Old Index