[PATCH] hw/input: expand trace info reported for ps2 device

Daniel P. Berrangé posted 1 patch 3 years, 4 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201208115934.3163238-1-berrange@redhat.com
There is a newer version of this series
hw/input/ps2.c        | 2 +-
hw/input/trace-events | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
[PATCH] hw/input: expand trace info reported for ps2 device
Posted by Daniel P. Berrangé 3 years, 4 months ago
It is interesting to know if the PS2 keyboard is in translated mode, and
which of the three scancode sets are in use.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 hw/input/ps2.c        | 2 +-
 hw/input/trace-events | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 72cdb80ae1..237956aca2 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -293,7 +293,7 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src,
     qcode = qemu_input_key_value_to_qcode(key->key);
 
     mod = ps2_modifier_bit(qcode);
-    trace_ps2_keyboard_event(s, qcode, key->down, mod, s->modifiers);
+    trace_ps2_keyboard_event(s, qcode, key->down, mod, s->modifiers, s->scancode_set, s->translate);
     if (key->down) {
         s->modifiers |= mod;
     } else {
diff --git a/hw/input/trace-events b/hw/input/trace-events
index 1dd8ad6018..49c70d544e 100644
--- a/hw/input/trace-events
+++ b/hw/input/trace-events
@@ -30,7 +30,7 @@ pckbd_kbd_write_data(uint64_t val) "0x%02"PRIx64
 
 # ps2.c
 ps2_put_keycode(void *opaque, int keycode) "%p keycode 0x%02x"
-ps2_keyboard_event(void *opaque, int qcode, int down, unsigned int modifier, unsigned int modifiers) "%p qcode %d down %d modifier 0x%x modifiers 0x%x"
+ps2_keyboard_event(void *opaque, int qcode, int down, unsigned int modifier, unsigned int modifiers, int set, int xlate) "%p qcode %d down %d modifier 0x%x modifiers 0x%x set %d xlate %d"
 ps2_read_data(void *opaque) "%p"
 ps2_set_ledstate(void *s, int ledstate) "%p ledstate %d"
 ps2_reset_keyboard(void *s) "%p"
-- 
2.28.0


Re: [PATCH] hw/input: expand trace info reported for ps2 device
Posted by no-reply@patchew.org 3 years, 4 months ago
Patchew URL: https://patchew.org/QEMU/20201208115934.3163238-1-berrange@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20201208115934.3163238-1-berrange@redhat.com
Subject: [PATCH] hw/input: expand trace info reported for ps2 device

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20201208115934.3163238-1-berrange@redhat.com -> patchew/20201208115934.3163238-1-berrange@redhat.com
Switched to a new branch 'test'
ef4eabf hw/input: expand trace info reported for ps2 device

=== OUTPUT BEGIN ===
ERROR: line over 90 characters
#22: FILE: hw/input/ps2.c:296:
+    trace_ps2_keyboard_event(s, qcode, key->down, mod, s->modifiers, s->scancode_set, s->translate);

total: 1 errors, 0 warnings, 16 lines checked

Commit ef4eabf7b954 (hw/input: expand trace info reported for ps2 device) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20201208115934.3163238-1-berrange@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PATCH] hw/input: expand trace info reported for ps2 device
Posted by Philippe Mathieu-Daudé 3 years, 4 months ago
On 12/8/20 12:59 PM, Daniel P. Berrangé wrote:
> It is interesting to know if the PS2 keyboard is in translated mode, and
> which of the three scancode sets are in use.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  hw/input/ps2.c        | 2 +-
>  hw/input/trace-events | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
> index 72cdb80ae1..237956aca2 100644
> --- a/hw/input/ps2.c
> +++ b/hw/input/ps2.c
> @@ -293,7 +293,7 @@ static void ps2_keyboard_event(DeviceState *dev, QemuConsole *src,
>      qcode = qemu_input_key_value_to_qcode(key->key);
>  
>      mod = ps2_modifier_bit(qcode);
> -    trace_ps2_keyboard_event(s, qcode, key->down, mod, s->modifiers);
> +    trace_ps2_keyboard_event(s, qcode, key->down, mod, s->modifiers, s->scancode_set, s->translate);

Long line...

Anyway,
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>