kernel_samsung_a53x/drivers/leds
Christophe JAILLET a811e4bc69 leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu'
[ Upstream commit ff50f53276131a3059e8307d11293af388ed2bcd ]

In order to teach the compiler that 'trig->name' will never be truncated,
we need to tell it that 'cpu' is not negative.

When building with W=1, this fixes the following warnings:

  drivers/leds/trigger/ledtrig-cpu.c: In function ‘ledtrig_cpu_init’:
  drivers/leds/trigger/ledtrig-cpu.c:155:56: error: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 5 [-Werror=format-truncation=]
    155 |                 snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu);
        |                                                        ^~
  drivers/leds/trigger/ledtrig-cpu.c:155:52: note: directive argument in the range [-2147483648, 7]
    155 |                 snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu);
        |                                                    ^~~~~~~
  drivers/leds/trigger/ledtrig-cpu.c:155:17: note: ‘snprintf’ output between 5 and 15 bytes into a destination of size 8
    155 |                 snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fixes: 8f88731d052d ("led-triggers: create a trigger for CPU activity")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/3f4be7a99933cf8566e630da54f6ab913caac432.1695453322.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-18 11:43:05 +01:00
..
trigger leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' 2024-11-18 11:43:05 +01:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
led-class-flash.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
led-class-multicolor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
led-class.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
led-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
led-triggers.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-88pm860x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-aat1290.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-acer-a500.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-adp5520.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-an30259a.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-apu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-ariel.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-as3645a.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-asic3.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-aw2013.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-bcm6328.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-bcm6358.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-bd2802.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-blinkm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-clevo-mail.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-cobalt-qube.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-cobalt-raq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-cpcap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-cr0014114.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-da903x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-da9052.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-dac124s085.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-el15203000.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-fsg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-gpio-register.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-gpio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-hp6xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-ip30.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-ipaq-micro.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-is31fl32xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-is31fl319x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-ktd2692.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm355x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm3530.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm3532.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm3533.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm3601x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm3642.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm3692x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm3697.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lm36274.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-locomo.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp50xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp55xx-common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp55xx-common.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp3944.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp3952.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp5521.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp5523.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp5562.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp8501.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp8788.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lp8860.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-lt3593.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-max8997.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-max77650.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-max77693.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-mc13783.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-menf21bmc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-mlxcpld.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-mlxreg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-mt6323.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-net48xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-netxbig.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-nic78bx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-ns2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-ot200.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-pca955x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-pca963x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-pca9532.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-pm8058.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-powernv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-pwm.c leds: pwm: Don't disable the PWM when the LED should be off 2024-11-18 11:43:05 +01:00
leds-rb532.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-regulator.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-s2mf301.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-s2mpb02.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-s2mu106.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-s3c24xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-sc27xx-bltc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-sgm3140.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-sm5714-fled.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-spi-byte.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-ss4200.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-sunfire.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-syscon.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-tca6507.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-ti-lmu-common.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-tlc591xx.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-tps6105x.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-turris-omnia.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-wm831x-status.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-wm8350.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds-wrap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
leds.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
TODO Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uleds.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00