* [PATCH 1/1] lpfc: Fix incorrect big endian type assignment in bsg loopback path
@ 2023-06-14 17:59 Justin Tee
2023-06-15 2:15 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Justin Tee @ 2023-06-14 17:59 UTC (permalink / raw)
To: linux-scsi; +Cc: jsmart2021, justin.tee, Justin Tee, kernel test robot
The kernel test robot reported sparse warnings regarding incorrect type
assignment for __be16 variables in bsg loopback path.
Change the flagged lines to use the be16_to_cpu and cpu_to_be16 macros
appropriately.
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202306110819.sDIKiGgg-lkp@intel.com/
---
drivers/scsi/lpfc/lpfc_bsg.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index 9a322a3a2150..595dca92e8db 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -889,7 +889,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
struct lpfc_iocbq *piocbq)
{
uint32_t evt_req_id = 0;
- uint32_t cmd;
+ u16 cmd;
struct lpfc_dmabuf *dmabuf = NULL;
struct lpfc_bsg_event *evt;
struct event_data *evt_dat = NULL;
@@ -915,7 +915,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
ct_req = (struct lpfc_sli_ct_request *)bdeBuf1->virt;
evt_req_id = ct_req->FsType;
- cmd = ct_req->CommandResponse.bits.CmdRsp;
+ cmd = be16_to_cpu(ct_req->CommandResponse.bits.CmdRsp);
spin_lock_irqsave(&phba->ct_ev_lock, flags);
list_for_each_entry(evt, &phba->ct_ev_waiters, node) {
@@ -3186,8 +3186,8 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job)
ctreq->RevisionId.bits.InId = 0;
ctreq->FsType = SLI_CT_ELX_LOOPBACK;
ctreq->FsSubType = 0;
- ctreq->CommandResponse.bits.CmdRsp = ELX_LOOPBACK_DATA;
- ctreq->CommandResponse.bits.Size = size;
+ ctreq->CommandResponse.bits.CmdRsp = cpu_to_be16(ELX_LOOPBACK_DATA);
+ ctreq->CommandResponse.bits.Size = cpu_to_be16(size);
segment_offset = ELX_LOOPBACK_HEADER_SZ;
} else
segment_offset = 0;
--
2.38.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] lpfc: Fix incorrect big endian type assignment in bsg loopback path
2023-06-14 17:59 [PATCH 1/1] lpfc: Fix incorrect big endian type assignment in bsg loopback path Justin Tee
@ 2023-06-15 2:15 ` Martin K. Petersen
0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2023-06-15 2:15 UTC (permalink / raw)
To: linux-scsi, Justin Tee
Cc: Martin K . Petersen, jsmart2021, justin.tee, kernel test robot
On Wed, 14 Jun 2023 10:59:44 -0700, Justin Tee wrote:
> The kernel test robot reported sparse warnings regarding incorrect type
> assignment for __be16 variables in bsg loopback path.
>
> Change the flagged lines to use the be16_to_cpu and cpu_to_be16 macros
> appropriately.
>
>
> [...]
Applied to 6.4/scsi-fixes, thanks!
[1/1] lpfc: Fix incorrect big endian type assignment in bsg loopback path
https://git.kernel.org/mkp/scsi/c/9cefd6e7e0a7
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-15 2:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14 17:59 [PATCH 1/1] lpfc: Fix incorrect big endian type assignment in bsg loopback path Justin Tee
2023-06-15 2:15 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox