summaryrefslogtreecommitdiffstats
path: root/hw/nvme/nvme.h
diff options
context:
space:
mode:
authorDarren Kenny2022-07-07 15:36:21 +0200
committerKlaus Jensen2022-07-15 10:40:33 +0200
commit43f76aac49c439ea79c125d1befd9d5d7057dbb4 (patch)
tree3bf786d940b97c86a7c28880475bd3b625947f3b /hw/nvme/nvme.h
parenthw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node (diff)
downloadqemu-43f76aac49c439ea79c125d1befd9d5d7057dbb4.tar.gz
qemu-43f76aac49c439ea79c125d1befd9d5d7057dbb4.tar.xz
qemu-43f76aac49c439ea79c125d1befd9d5d7057dbb4.zip
nvme: Fix misleading macro when mixed with ternary operator
Using the Parfait source code analyser and issue was found in hw/nvme/ctrl.c where the macros NVME_CAP_SET_CMBS and NVME_CAP_SET_PMRS are called with a ternary operatore in the second parameter, resulting in a potentially unexpected expansion of the form: x ? a: b & FLAG_TEST which will result in a different result to: (x ? a: b) & FLAG_TEST. The macros should wrap each of the parameters in brackets to ensure the correct result on expansion. Signed-off-by: Darren Kenny <darren.kenny@oracle.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Klaus Jensen <k.jensen@samsung.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Diffstat (limited to 'hw/nvme/nvme.h')
0 files changed, 0 insertions, 0 deletions