Displaying 5 results from an estimated 5 matches for "virtio_cread_v".
Did you mean:
virtio_cread
2020 Aug 06
0
[vhost:vhost 32/65] drivers/virtio/virtio_input.c:247:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v)))
...ss ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>
All warnings (new ones prefixed by >>):
>> drivers/virtio/virtio_input.c:247:3: warning: comparison of distinct pointer types ('typeof (_Generic((virtio_cread_v), __u8: (virtio_cread_v), __le16: (__builtin_constant_p((__u16)((__u16)(__le16)(virtio_cread_v))) ? ((__u16)((((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)255U) << 8) | (((__u16)((__u16)(__le16)(virtio_cread_v)) & (__u16)65280U) >> 8))) : __fswab16((__u16)(__le16)(virtio_c...
2020 Aug 05
0
[PATCH v3 26/38] virtio_config: LE config space accessors
...m) \
+ _Generic((m), \
+ __u8: (x), \
+ __le16: cpu_to_le16(x), \
+ __le32: cpu_to_le32(x), \
+ __le64: cpu_to_le64(x) \
+ )
+
+/* LE (e.g. modern) Config space accessors. */
+#define virtio_cread_le(vdev, structname, member, ptr) \
+ do { \
+ typeof(((structname*)0)->member) virtio_cread_v; \
+ \
+ might_sleep(); \
+ /* Sanity check: must match the member's type */ \
+ typecheck(typeof(virtio_le_to_cpu(virtio_cread_v)), *(ptr)); \
+ \
+ switch (sizeof(virtio_cread_v)) { \
+ case 1: \
+ case 2: \
+ case 4: \
+ vdev->config->g...
2020 Aug 05
0
[PATCH v3 24/38] virtio_config: rewrite using _Generic
...ig space accessors. */
#define virtio_cread(vdev, structname, member, ptr) \
do { \
- might_sleep(); \
- /* Must match the member's type, and be integer */ \
- if (!__virtio_typecheck(structname, member, *(ptr))) \
- (*ptr) = 1; \
+ typeof(((structname*)0)->member) virtio_cread_v; \
\
- switch (sizeof(*ptr)) { \
+ might_sleep(); \
+ /* Sanity check: must match the member's type */ \
+ typecheck(typeof(virtio_to_cpu((vdev), virtio_cread_v)), *(ptr)); \
+ \
+ switch (sizeof(virtio_cread_v)) { \
case 1: \
- *(ptr) = virtio_cread...
2020 Aug 05
1
[vhost:vhost 32/52] include/linux/typecheck.h:12:18: warning: comparison of distinct pointer types lacks a cast
...ux/typecheck.h:12:18: warning: comparison of distinct pointer types lacks a cast
12 | (void)(&__dummy == &__dummy2); \
| ^~
include/linux/virtio_config.h:405:3: note: in expansion of macro 'typecheck'
405 | typecheck(typeof(virtio_le_to_cpu(virtio_cread_v)), *(ptr)); \
| ^~~~~~~~~
drivers/virtio/virtio_input.c:247:3: note: in expansion of macro 'virtio_cread_le'
247 | virtio_cread_le(vi->vdev, struct virtio_input_config,
| ^~~~~~~~~~~~~~~
>> include/linux/typecheck.h:12:18: warning: comparison of dist...
2020 Aug 03
51
[PATCH v2 00/24] virtio: config space endian-ness cleanup
Config space endian-ness is currently a mess: fields are
not tagged with the correct endian-ness so it's easy
to make mistakes like instanciating config space in
native endian-ness.
The following patches adding sparse tagging are currently in my tree.
Lightly tested.
As a follow-up, I plan to add new APIs that handle modern config space
in a more efficient way (bypassing the version check).