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:   Sat, 8 Aug 2020 17:29:26 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     daejun7.park@...sung.com,
        "avri.altman@....com" <avri.altman@....com>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        "beanhuo@...ron.com" <beanhuo@...ron.com>,
        "stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
        "cang@...eaurora.org" <cang@...eaurora.org>,
        "tomas.winkler@...el.com" <tomas.winkler@...el.com>,
        ALIM AKHTAR <alim.akhtar@...sung.com>
Cc:     "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Sang-yoon Oh <sangyoon.oh@...sung.com>,
        Sung-Jun Park <sungjun07.park@...sung.com>,
        yongmyung lee <ymhungry.lee@...sung.com>,
        Jinyoung CHOI <j-young.choi@...sung.com>,
        Adel Choi <adel.choi@...sung.com>,
        BoRam Shin <boram.shin@...sung.com>
Subject: Re: [PATCH v8 3/4] scsi: ufs: L2P map management for HPB read

On 2020-08-06 02:15, Daejun Park wrote:
> +	req->end_io_data = (void *)map_req;

Please leave the (void *) cast out since explicit casts from a non-void
to a void pointer are not necessary in C.

> +static inline struct
> +ufshpb_rsp_field *ufshpb_get_hpb_rsp(struct ufshcd_lrb *lrbp)
> +{
> +	return (struct ufshpb_rsp_field *)&lrbp->ucd_rsp_ptr->sr.sense_data_len;
> +}

Please introduce a union in struct utp_cmd_rsp instead of using casts
to reinterpret a part of a data structure.

> +/* routine : isr (ufs) */

The above comment looks very cryptic. Should it perhaps be expanded?

> +struct ufshpb_active_field {
> +	__be16 active_rgn;
> +	__be16 active_srgn;
> +} __packed;

Since "__packed" is not necessary for the above data structure, please
remove it. Note: a typical approach in the Linux kernel to verify that
the compiler has not inserted any padding bytes is to add a BUILD_BUG_ON()
statement in an initialization function that verifies the size of ABI data
structures. See also the output of the following command:

git grep -nH 'BUILD_BUG_ON.sizeof.*!='

> +struct ufshpb_rsp_field {
> +	__be16 sense_data_len;
> +	u8 desc_type;
> +	u8 additional_len;
> +	u8 hpb_type;
> +	u8 reserved;
> +	u8 active_rgn_cnt;
> +	u8 inactive_rgn_cnt;
> +	struct ufshpb_active_field hpb_active_field[2];
> +	__be16 hpb_inactive_field[2];
> +} __packed;

I think the above __packed statement should also be left out.

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ