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, 7 Apr 2020 17:02:13 +0100
From:   Alex Dewar <alex.dewar@....co.uk>
To:     Markus Elfring <Markus.Elfring@....de>
Cc:     Allison Randal <allison@...utok.net>,
        Arnd Bergmann <arnd@...db.de>,
        Chaitra Basappa <chaitra.basappa@...adcom.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Himanshu Madhani <hmadhani@...vell.com>,
        "James E. J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Richard Fontana <rfontana@...hat.com>,
        Sathya Prakash <sathya.prakash@...adcom.com>,
        Suganath Prabu Subramani 
        <suganath-prabu.subramani@...adcom.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        linux-scsi@...r.kernel.org, aacraid@...rosemi.com,
        MPT-FusionLinux.pdl@...adcom.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] scsi: Remove unnecessary calls to memset after
 dma_alloc_coherent

On Sat, Apr 04, 2020 at 01:14:52PM +0200, Markus Elfring wrote:
> > dma_alloc_coherent() now zeroes memory after allocation, so additional
> > calls to memset() afterwards are unnecessary. Remove them.
>
> I suggest to reconsider the distribution of recipients also for this patch
> according to the fields “Cc” and “To”.

Thanks. I'll do this in a v2/RESEND.
>
>
> …
> > +++ b/drivers/scsi/dpt_i2o.c
> …
> > @@ -3067,13 +3064,12 @@ static int adpt_i2o_build_sys_table(void)
> >  	sys_tbl_len = sizeof(struct i2o_sys_tbl) +	// Header + IOPs
> >  				(hba_count) * sizeof(struct i2o_sys_tbl_entry);
> >
> > -	sys_tbl = dma_alloc_coherent(&pHba->pDev->dev,
> > -				sys_tbl_len, &sys_tbl_pa, GFP_KERNEL);
> > +	sys_tbl = dma_alloc_coherent(&pHba->pDev->dev, sys_tbl_len,
> > +				     &sys_tbl_pa, GFP_KERNEL);
> >  	if (!sys_tbl) {
> …
> > +++ b/drivers/scsi/mvsas/mv_init.c
> > @@ -244,28 +244,22 @@ static int mvs_alloc(struct mvs_info *mvi, struct Scsi_Host *shost)
> …
> > -	mvi->slot = dma_alloc_coherent(mvi->dev,
> > -				       sizeof(*mvi->slot) * slot_nr,
> > +	mvi->slot = dma_alloc_coherent(mvi->dev, sizeof(*mvi->slot) * slot_nr,
> >  				       &mvi->slot_dma, GFP_KERNEL);
> >  	if (!mvi->slot)
> …
> > +++ b/drivers/scsi/qla2xxx/qla_isr.c
> > @@ -79,7 +79,7 @@ qla24xx_process_abts(struct scsi_qla_host *vha, void *pkt)
> >  	    (uint8_t *)abts, sizeof(*abts));
> >
> >  	rsp_els = dma_alloc_coherent(&ha->pdev->dev, sizeof(*rsp_els), &dma,
> > -	    GFP_KERNEL);
> > +				     GFP_KERNEL);
> >  	if (!rsp_els) {
> …
> > +++ b/drivers/scsi/qla2xxx/qla_mbx.c
> > @@ -4887,15 +4887,13 @@ qla25xx_set_els_cmds_supported(scsi_qla_host_t *vha)
> >  	    "Entered %s.\n", __func__);
> >
> >  	els_cmd_map = dma_alloc_coherent(&ha->pdev->dev, ELS_CMD_MAP_SIZE,
> > -	    &els_cmd_map_dma, GFP_KERNEL);
> > +					 &els_cmd_map_dma, GFP_KERNEL);
> >  	if (!els_cmd_map) {
> …
>
> I find it safer to integrate such source code reformattings by
> another update step which will be separated from the proposed deletion
> of unwanted function calls.

Good point. This whitespace was autoformatted by Coccinelle, probably
due to my bad SmPL skills.

Best,
Alex


>
> Regards,
> Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ