Skip to contentSkip to conversation

Input: fsia6b: Increase size of phys to hold full name

PATCH In review Markus Koch 2 participants 6 messages Mar 29, 2025 – Jun 4, 2025

Subsystems (3)
lore
Share & tools
lore

Markus Koch

author maintainer
#0 lore raw

PATCH 1/1 Input: fsia6b: Increase size of phys to hold full name

The driver appends "/input0" to the phys name of the serio device. This commit ensures that there is enough space in the variable to do so.

---
 drivers/input/joystick/fsia6b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/fsia6b.c +1 -1
index 76ffdec5c183..ef1a7a3a867c 100644
@@ -56,7 +56,7 @@ struct fsia6b {
 	struct input_dev *dev;
 	struct ibus_packet packet;
 
-	char phys[32];
+	char phys[sizeof_field(struct serio, phys)+7];
 };
 
 static irqreturn_t fsia6b_serio_irq(struct serio *serio,
Signature · 1 line
2.49.0
author maintainer
#1 lore raw

Hi,

I sent a patch 2 weeks ago [1] and haven't heard back yet. The same happened for another patch I submitted at the end of last year [2], where in the meantime the patch of someone else (doing exactly the same) got merged. Therefore I have to ask:

Am I doing something wrong? Is there a preferred way to submit patches for this subsystem that I'm missing (like Gitlab PRs or something)? I'm happy to change my workflow if it helps you.

Thank you,
Markus

[1]: https://patchwork.kernel.org/project/linux-input/patch/[email protected]/
[2]: https://patchwork.kernel.org/project/linux-input/patch/[email protected]/

author maintainer
#2 lore raw

Hi,

just following up again since I haven't heard back at all about my patch from late March [1].

It's OK if you'd like this issue solved in a completely different way, or not at all (I saw some controversy about this topic on the mailing list), just let me know so that I can act accordingly. Or, if more time is needed, a quick "we're still investigating how to handle these cases" is also appreciated.

Thanks!
Markus

[1]: https://patchwork.kernel.org/project/linux-input/patch/[email protected]/

maintainer
#3 lore raw
In reply to Markus Koch

Hi Markus,

Quoted 11 lines · Markus Koch

Hi,

I sent a patch 2 weeks ago [1] and haven't heard back yet. The same happened for another patch I submitted at the end of last year [2], where in the meantime the patch of someone else (doing exactly the same) got merged. Therefore I have to ask:

Am I doing something wrong? Is there a preferred way to submit patches for this subsystem that I'm missing (like Gitlab PRs or something)? I'm happy to change my workflow if it helps you.

No, you are not doing anything wrong, the issue is on my side. I have quite a bit of backlog and so often go through my mailbox in LIFO order. This means that I might sometimes merge a "newer" patch instead of picking up the first one.

As far as extending "phys" I indeed do not want to do that because it is perfectly fine to have truncated phys (or we can extend it when we encounter a device that actually needs it vs doing it just to appease the check). I think switching from snprintf() to scnprintf() will shut off the warning. Could you please let me know if it does it from you?

Thanks.

Signature · 1 line
Dmitry
author maintainer
#4 lore raw

PATCH v2 1/1 Input: fsia6b: Suppress buffer truncation warning for phys

---
v2: As suggested, I changed snprintf to scnprintf, which removes the warning.

 drivers/input/joystick/fsia6b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/fsia6b.c +1 -1
index 76ffdec5c183..7e3bc99d766f 100644
@@ -149,7 +149,7 @@ static int fsia6b_serio_connect(struct serio *serio, struct serio_driver *drv)
 	}
 	fsia6b->dev = input_dev;
 
-	snprintf(fsia6b->phys, sizeof(fsia6b->phys), "%s/input0", serio->phys);
+	scnprintf(fsia6b->phys, sizeof(fsia6b->phys), "%s/input0", serio->phys);
 
 	input_dev->name = DRIVER_DESC;
 	input_dev->phys = fsia6b->phys;
Signature · 1 line
2.49.0