[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<DM6PR04MB657592C1289C605D13ECE214FC642@DM6PR04MB6575.namprd04.prod.outlook.com>
Date: Thu, 12 Sep 2024 06:51:34 +0000
From: Avri Altman <Avri.Altman@....com>
To: Bart Van Assche <bvanassche@....org>, "Martin K . Petersen"
<martin.petersen@...cle.com>
CC: "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] scsi: ufs: Zero utp_upiu_req at the beginning of each
command
>
> On 9/10/24 10:39 PM, Avri Altman wrote:
> > +static void zero_utp_upiu(struct utp_upiu_req *req) {
> > + memset(&req->utp_upiu, 0, sizeof(req->utp_upiu)); }
>
> Introducing a function that only calls memset() seems like overkill to me. Please
> call memset() directly.
Done.
>
> > diff --git a/include/uapi/scsi/scsi_bsg_ufs.h
> > b/include/uapi/scsi/scsi_bsg_ufs.h
> > index 8c29e498ef98..b0d60d54d6c9 100644
> > --- a/include/uapi/scsi/scsi_bsg_ufs.h
> > +++ b/include/uapi/scsi/scsi_bsg_ufs.h
> > @@ -162,11 +162,13 @@ struct utp_upiu_cmd {
> > */
> > struct utp_upiu_req {
> > struct utp_upiu_header header;
> > - union {
> > - struct utp_upiu_cmd sc;
> > - struct utp_upiu_query qr;
> > - struct utp_upiu_query uc;
> > - };
> > + struct_group(utp_upiu,
> > + union {
> > + struct utp_upiu_cmd sc;
> > + struct utp_upiu_query qr;
> > + struct utp_upiu_query uc;
> > + };
> > + );
> > };
>
> Is the above change perhaps independent of the rest of this patch? I think that
> this change can be left out.
Done.
P.S.
I wanted to make zero_utp_upiu() oblivious of its callers.
I guess I can just do that by just naming that union.
Thanks,
Avri
>
> Thanks,
>
> Bart.
Powered by blists - more mailing lists