Re: [PATCH v2][next] scsi: lpfc: Use struct_size() helper

From: Justin Tee
Date: Fri May 26 2023 - 14:07:15 EST


> > We probably should have declared no_of_objects as __be32 to have
> > avoided this confusion.
>
> Perhaps this patch can add that too?

Yes, please. Something like this is fine:

diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 19b2d2754f32..e5a639d96122 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -1414,12 +1414,12 @@ struct app_id_object {
};

struct lpfc_vmid_rapp_ident_list {
- uint32_t no_of_objects;
+ __be32 no_of_objects;
struct entity_id_object obj[1];
};

struct lpfc_vmid_dapp_ident_list {
- uint32_t no_of_objects;
+ __be32 no_of_objects;
struct entity_id_object obj[1];
};

--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature