Thread (41 messages) 41 messages, 8 authors, 2023-12-08

Re: [PATCH 4/6] input/vmmouse: Use vmware_hypercall API

From: "dmitry.torokhov@gmail.com" <dmitry.torokhov@gmail.com>
Date: 2023-11-25 04:58:38
Also in: dri-devel, linux-input, lkml, virtualization

On Sat, Nov 25, 2023 at 01:22:58AM +0000, Alexey Makhalov wrote:
On Nov 24, 2023, at 11:46 AM, Simon Horman [off-list ref] wrote:
quoted
On Wed, Nov 22, 2023 at 03:30:49PM -0800, Alexey Makhalov wrote:
quoted
Switch from VMWARE_HYPERCALL macro to vmware_hypercall API.
Eliminate arch specific code. No functional changes intended.

Signed-off-by: Alexey Makhalov <redacted>
Hi Alexey,

it is not strictly related to this patch, but I notice than an x86_64
allmodconfig build with W=1 using gcc-13 fails to compile this file.

It appears that the problem relates to both priv->phys and
psmouse->ps2dev.serio->phys being 32 bytes.


drivers/input/mouse/vmmouse.c: In function ‘vmmouse_init’:
drivers/input/mouse/vmmouse.c:455:53: error: ‘/input1’ directive output may be truncated writing 7 bytes into a region of size between 1 and 32 [-Werror=format-truncation=]
 455 |         snprintf(priv->phys, sizeof(priv->phys), "%s/input1",
     |                                                     ^~~~~~~
drivers/input/mouse/vmmouse.c:455:9: note: ‘snprintf’ output between 8 and 39 bytes into a destination of size 32
 455 |         snprintf(priv->phys, sizeof(priv->phys), "%s/input1",
     |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 456 |                  psmouse->ps2dev.serio->phys);
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

...
Hi Simon, thanks for reporting the issue.
Zack, please take a look.
We want the truncation behavior and we do not want GCC to make noise
about these, that is why "format-truncation" is explicitly disabled for
normal compiles. I guess we should exclude it even when we compile with
W=1 instead of doing pointless changes in the drivers.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help