Re: [PATCH] drm/nouveau/bl: Use kasprintf for interface name

2025-06-04 Thread Jacob Keller
On 6/4/2025 3:40 PM, Timur Tabi wrote: > On Wed, 2025-06-04 at 15:16 -0700, Jacob Keller wrote: >> Fair enough. Another alternative which saves the stack and macro would >> be to add a new version of backlight_register_device which can pass the >> integer number itself into dev_set_name, but tha

Re: [PATCH] drm/nouveau/bl: Use kasprintf for interface name

2025-06-04 Thread Timur Tabi
On Wed, 2025-06-04 at 15:16 -0700, Jacob Keller wrote: > Fair enough. Another alternative which saves the stack and macro would > be to add a new version of backlight_register_device which can pass the > integer number itself into dev_set_name, but thats probably not worth > the churn either. (Curr

Re: [PATCH] drm/nouveau/bl: Use kasprintf for interface name

2025-06-04 Thread Jacob Keller
On 6/4/2025 3:01 PM, Timur Tabi wrote: > On Wed, 2025-06-04 at 14:03 -0700, Jacob Keller wrote: >> This could also be fixed by simply increasing BL_NAME_SIZE to 24, making it >> large enough to fit any size integer into its format string, or by checking >> the return value of snprintf. > > I th

Re: [PATCH] drm/nouveau/bl: Use kasprintf for interface name

2025-06-04 Thread Timur Tabi
On Wed, 2025-06-04 at 14:03 -0700, Jacob Keller wrote: > This could also be fixed by simply increasing BL_NAME_SIZE to 24, making it > large enough to fit any size integer into its format string, or by checking > the return value of snprintf. I think this would be a better approach. backlist_name

[PATCH] drm/nouveau/bl: Use kasprintf for interface name

2025-06-04 Thread Jacob Keller
The nouveau_get_backlight_name() function generates a unique name for the backlight interface, appending an id from 1 to 99 for all backlight devices after the first. GCC 15 (and likely other compilers) produce the following -Wformat-truncation warning: nouveau_backlight.c: In function ‘nouveau_b