Re: [PATCH 01/12] gpiolib: acpi: Use snprintf() for ACPI event name formatting
From: Andy Shevchenko
Date: Mon May 18 2026 - 04:07:51 EST
On Mon, May 18, 2026 at 09:53:46AM +0200, Marco Scardovi (scardracs) wrote:
> Replace sprintf() with snprintf() when formatting ACPI GPIO
> event names and fix minor formatting inconsistencies.
It has also unrelated stuff. Do one thing in one patch.
...
> if (pin <= 255) {
> char ev_name[8];
> - sprintf(ev_name, "_%c%02X",
> - agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',
> - pin);
> +
> + snprintf(ev_name, sizeof(ev_name), "_%c%02X",
> + agpio->triggering == ACPI_EDGE_SENSITIVE ? 'E' : 'L',
> + pin);
> if (ACPI_SUCCESS(acpi_get_handle(handle, ev_name, &evt_handle)))
> handler = acpi_gpio_irq_handler;
> }
This doesn't seem to anyhow make code hardened or so. I'm not sure I see
the point. Also you may check the Git history around these lines.
> }
--
With Best Regards,
Andy Shevchenko