lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 25 May 2021 21:28:36 +0200
From:   Bean Huo <huobean@...il.com>
To:     Bart Van Assche <bvanassche@....org>, alim.akhtar@...sung.com,
        avri.altman@....com, asutoshd@...eaurora.org, jejb@...ux.ibm.com,
        martin.petersen@...cle.com, stanley.chu@...iatek.com,
        beanhuo@...ron.com, tomas.winkler@...el.com, cang@...eaurora.org
Cc:     linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 1/3] scsi: ufs: Let UPIU completion trace print RSP
 UPIU

On Sun, 2021-05-23 at 18:24 -0700, Bart Van Assche wrote:
> On 5/23/21 2:14 PM, Bean Huo wrote:
> 
> > +             rq_rsp = (struct utp_upiu_req *)hba-
> > >lrb[tag].ucd_rsp_ptr;
> 
> 
> So a pointer to a response (hba->lrb[tag].ucd_rsp_ptr) is cast to a
> 
> pointer to a request (struct utp_upiu_req *)? That seems really odd
> to
> 
> me. Please explain.

Bart,

these two structures have the same size, and inside the structures,
the both unions have the same members(not exactly 100% identical). 

struct utp_upiu_rsp {
        struct utp_upiu_header header;
        union {
                struct utp_cmd_rsp sr;
                struct utp_upiu_query qr;
        };
};


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;
        };
};

Use one point for response and request both, no problem here. It is
true that looks very ood, and very difficult to read them.

If this is problem, I can change the code, let them more readable.

how do you think?

Bean



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ