Skip to contentSkip to conversation

hw/ufs: fix compilation warnings

PATCH In review Mike Maslenkin 4 participants 8 messages Jul 27, 2023 – Aug 2, 2023

lore
Share & tools
lore
#1 lore raw

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.

Cc Jeuk Kim <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 hw/ufs/ufs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/ufs/ufs.c +2 -2
index 1760e0f88d70..af32366c8504 100644
@@ -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)
#2 lore raw

PATCH 2/3 hw/ufs: fix compilation warning

In reply to Mike Maslenkin

This 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);
                             ^~~~
Cc Jeuk Kim <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 hw/ufs/ufs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/ufs/ufs.c +2 -2
index af32366c8504..b0656e47598e 100644
@@ -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)
#3 lore raw

PATCH 3/3 hw/ufs: change ufs_process_db signature

In reply to Mike Maslenkin

Actually UTRLDBR is 32bit register. There is no need to pass 64bit value to ufs_process_db() function.

Cc Jeuk Kim <[email protected]>
Cc Stefan Hajnoczi <[email protected]>
---
 hw/ufs/ufs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ufs/ufs.c +1 -1
index b0656e47598e..af57ba6df02c 100644
@@ -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)
Reviewed-by on the v1 series
#4 lore raw
In reply to Mike Maslenkin
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]>

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.

#5 lore raw
In reply to Mike Maslenkin

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.

#6 lore raw
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?

#7 lore raw

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?