hw/ufs: fix compilation warnings
cover hw/ufs: fix compilation warnings
This patchset contains a trivial compilation fixes for UFS support applied to block-next tree.
PATCH 1/3 hw/ufs: fix compilation warning
This patch fixes a compilation warning: implicit conversion from enumeration type 'enum UfsRequestState' to different enumeration type 'UfsReqResult' (aka 'enum UfsReqResult') [-Wenum-conversion]
ufs_exec_scsi_cmd() returns a value from UfsReqResult enum.
--- hw/ufs/ufs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/ufs/ufs.c +2 -2
@@ -514,10 +514,10 @@ static UfsReqResult ufs_exec_scsi_cmd(UfsRequest *req)if (!is_wlun (lun)) {if (lun >= u->device_desc.number_lu) {trace_ufs_err_scsi_cmd_invalid_lun (lun); -return UFS_REQUEST_ERROR ; +return UFS_REQUEST_FAIL ; }else if (u->lus[lun] ==NULL ) {trace_ufs_err_scsi_cmd_invalid_lun (lun); -return UFS_REQUEST_ERROR ; +return UFS_REQUEST_FAIL ; } }
Signature · 1 line
2.32.0 (Apple Git-132)
PATCH 2/3 hw/ufs: fix compilation warning
In reply to Mike MaslenkinThis patch fixes compilation warning, since argument to ufs_process_db() passed to find_first_bit() that expects unsigned long value.
The exact warnings are:
warning: incompatible pointer types passing 'uint64_t *' (aka 'unsigned long long *') to parameter of type 'const unsigned long *' [-Wincompatible-pointer-types]
slot = find_first_bit(&val, nutrs);
^~~~
warning: incompatible pointer types passing 'uint64_t *' (aka 'unsigned
long long *') to parameter of type 'const unsigned long *'
[-Wincompatible-pointer-types]
slot = find_next_bit(&val, nutrs, slot + 1);
^~~~--- hw/ufs/ufs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/ufs/ufs.c +2 -2
@@ -267,7 +267,7 @@ static void ufs_process_db(UfsHc *u, uint64_t val)return ; } - slot =find_first_bit (&val, nutrs); + slot =find_first_bit ((unsigned long *) &val, nutrs);while (slot < nutrs) { req = &u->req_list[slot];
@@ -283,7 +283,7 @@ static void ufs_process_db(UfsHc *u, uint64_t val)trace_ufs_process_db (slot); req->state =UFS_REQUEST_READY ; - slot =find_next_bit (&val, nutrs, slot +1 ); + slot =find_next_bit ((unsigned long *) &val, nutrs, slot +1 ); }qemu_bh_schedule (u->doorbell_bh);
Signature · 1 line
2.32.0 (Apple Git-132)
PATCH 3/3 hw/ufs: change ufs_process_db signature
In reply to Mike MaslenkinActually UTRLDBR is 32bit register. There is no need to pass 64bit value to ufs_process_db() function.
--- hw/ufs/ufs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ufs/ufs.c +1 -1
@@ -256,7 +256,7 @@ static void ufs_irq_check(UfsHc *u) } } -static void ufs_process_db (UfsHc *u,uint64_t val) +static void ufs_process_db (UfsHc *u,uint32_t val) {uint32_t slot;uint32_t nutrs = u->params.nutrs;
Signature · 1 line
2.32.0 (Apple Git-132)
Quoted 6 lines · Mike Maslenkin
This patchset contains a trivial compilation fixes for UFS support applied to block-next tree.
Cc Jeuk Kim <[email protected]>Cc Stefan Hajnoczi <[email protected]>Signed-off-by Mike Maslenkin <[email protected]>
Thanks for letting me know.
To Stefan,
Could you please add this patchset to the block-next tree? I haven't prepared a repo for QEMU UFS yet :'( Thank you very much.
Hi Mike,
Quoted 2 lines · Mike Maslenkin
This patchset contains a trivial compilation fixes for UFS support applied to block-next tree.
Since the series isn't merged, it would be clearer to send a v9 of "hw/ufs: Add Universal Flash Storage (UFS) support" with the fixes squashed in (there is still time).
Regards,
Phil.
Quoted 6 lines · Philippe Mathieu-Daudé
Hi Mike,
Quoted 2 lines · Mike Maslenkin
This patchset contains a trivial compilation fixes for UFS support applied to block-next tree.
Quoted 8 lines
Since the series isn't merged, it would be clearer to send a v9 of "hw/ufs: Add Universal Flash Storage (UFS) support" with the fixes squashed in (there is still time).
Regards,
Phil.
Hi Phil,
Thanks for your comment.
If Mike is okay, I'll send v9 of "hw/ufs: Add Universal Flash Storage UFS) support" with the fixes.
To Mike,
Is it okay with you if I make a patch v9, incorporating your fixes?
Hello All,
I'm ok with that.
Regards,
Mike.
Quoted 24 lines · Jeuk Kim
Quoted 6 lines · Philippe Mathieu-Daudé
Hi Mike,
Quoted 2 lines · Mike Maslenkin
This patchset contains a trivial compilation fixes for UFS support applied to block-next tree.
Quoted 8 lines
Since the series isn't merged, it would be clearer to send a v9 of "hw/ufs: Add Universal Flash Storage (UFS) support" with the fixes squashed in (there is still time).
Regards,
Phil.
Hi Phil,
Thanks for your comment.
If Mike is okay, I'll send v9 of "hw/ufs: Add Universal Flash Storage UFS) support" with the fixes.To Mike,
Is it okay with you if I make a patch v9, incorporating your fixes?