mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
tools/kdd: alternative way of muting spurious gcc warning
Older gcc does not support #pragma GCC diagnostics, so use alternative
approach - change variable type to uint32_t (this code handle 32-bit
requests only anyway), which apparently also avoid gcc complaining about
this (otherwise correct) code.
Fixes 437e00fea0 "tools/kdd: mute spurious
gcc warning"
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
This commit is contained in:
1 parent
09afb9e78e
commit
2de2b10b22
1 file changed
+1
-4
@@ -687,7 +687,7 @@ static void kdd_handle_read_ctrl(kdd_state *s)
|
||||
}
|
||||
} else {
|
||||
/* 32-bit control-register space starts at 0x[2]cc, for 84 bytes */
|
||||
uint64_t offset = addr;
|
||||
uint32_t offset = addr;
|
||||
if (offset > 0x200)
|
||||
offset -= 0x200;
|
||||
offset -= 0xcc;
|
||||
@@ -695,10 +695,7 @@ static void kdd_handle_read_ctrl(kdd_state *s)
|
||||
KDD_LOG(s, "Request outside of known control space\n");
|
||||
len = 0;
|
||||
} else {
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Warray-bounds"
|
||||
memcpy(buf, ((uint8_t *)&ctrl.c32) + offset, len);
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
}
|
||||
|
||||
|
||||