linux/include
Arnd Bergmann ba6e1d8422 platform/surface: aggregator: avoid clang -Wconstant-conversion warning
Clang complains about the assignment of SSAM_ANY_IID to
ssam_device_uid->instance:

drivers/platform/surface/surface_aggregator_registry.c:478:25: error: implicit conversion from 'int' to '__u8' (aka 'unsigned char') changes value from 65535 to 255 [-Werror,-Wconstant-conversion]
        { SSAM_VDEV(HUB, 0x02, SSAM_ANY_IID, 0x00) },
        ~                      ^~~~~~~~~~~~
include/linux/surface_aggregator/device.h:71:23: note: expanded from macro 'SSAM_ANY_IID'
 #define SSAM_ANY_IID            0xffff
                                ^~~~~~
include/linux/surface_aggregator/device.h:126:63: note: expanded from macro 'SSAM_VDEV'
        SSAM_DEVICE(SSAM_DOMAIN_VIRTUAL, SSAM_VIRTUAL_TC_##cat, tid, iid, fun)
                                                                     ^~~
include/linux/surface_aggregator/device.h:102:41: note: expanded from macro 'SSAM_DEVICE'
        .instance = ((iid) != SSAM_ANY_IID) ? (iid) : 0,                        \
                                               ^~~

The assignment doesn't actually happen, but clang checks the type limits
before checking whether this assignment is reached. Replace the ?:
operator with a __builtin_choose_expr() invocation that avoids the
warning for the untaken part.

Fixes: eb0e90a820 ("platform/surface: aggregator: Add dedicated bus and device type")
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20210514200453.1542978-1-arnd@kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2021-05-19 15:24:52 +02:00
..
acpi Merge branches 'acpi-cppc', 'acpi-video' and 'acpi-utils' 2021-04-26 17:04:27 +02:00
asm-generic mm: remove xlate_dev_kmem_ptr() 2021-05-07 00:26:34 -07:00
clocksource ARM: platform support for Apple M1 2021-04-26 12:30:36 -07:00
crypto
drm
dt-bindings Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2021-05-06 23:37:55 -07:00
keys integrity-v5.13 2021-05-01 15:32:18 -07:00
kunit
kvm Merge branch 'kvm-arm64/kill_oprofile_dependency' into kvmarm-master/next 2021-04-22 13:41:49 +01:00
linux platform/surface: aggregator: avoid clang -Wconstant-conversion warning 2021-05-19 15:24:52 +02:00
math-emu
media media updates for v5.13-rc1 2021-04-28 09:24:36 -07:00
memory
misc
net Networking fixes for 5.13-rc1, including fixes from bpf, can 2021-05-08 08:31:46 -07:00
pcmcia
ras
rdma RDMA/restrack: Add support to get resource tracking for SRQ 2021-04-22 10:30:27 -03:00
scsi SCSI misc on 20210428 2021-04-28 17:22:10 -07:00
soc Networking changes for 5.13. 2021-04-29 11:57:23 -07:00
sound ASoC: Updates for v5.13 2021-04-26 16:59:21 +02:00
target
trace NFS client updates for Linux 5.13 2021-05-07 11:23:41 -07:00
uapi Networking fixes for 5.13-rc1, including fixes from bpf, can 2021-05-08 08:31:46 -07:00
vdso
video
xen Merge branch 'akpm' (patches from Andrew) 2021-05-07 00:34:51 -07:00