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]
Message-ID: <442fa3a6-3e6b-0a5e-47a4-87fcfc696f8b@huawei.com>
Date:   Thu, 27 Jan 2022 10:46:22 +0000
From:   John Garry <john.garry@...wei.com>
To:     Christoph Hellwig <hch@...radead.org>
CC:     <jejb@...ux.ibm.com>, <martin.petersen@...cle.com>,
        <artur.paszkiewicz@...el.com>, <jinpu.wang@...ud.ionos.com>,
        <chenxiang66@...ilicon.com>, <Ajish.Koshy@...rochip.com>,
        <yanaijie@...wei.com>, <linux-doc@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linux-scsi@...r.kernel.org>,
        <linuxarm@...wei.com>, <liuqi115@...wei.com>,
        <Viswas.G@...rochip.com>, <damien.lemoal@...nsource.wdc.com>
Subject: Re: [PATCH 08/16] scsi: libsas: Add sas_execute_ssp_tmf()

On 27/01/2022 10:24, Christoph Hellwig wrote:
> On Tue, Jan 25, 2022 at 07:32:44PM +0800, John Garry wrote:
>> Add a function to issue an SSP TMF.
>>
>> Add a temp prototype to keep make W=1 happy.
>>
>> Signed-off-by: John Garry <john.garry@...wei.com>
>> ---
>>   drivers/scsi/libsas/sas_scsi_host.c | 20 ++++++++++++++++++++
>>   1 file changed, 20 insertions(+)
>>
>> diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
>> index 93ca6da63104..cfdf4a031be0 100644
>> --- a/drivers/scsi/libsas/sas_scsi_host.c
>> +++ b/drivers/scsi/libsas/sas_scsi_host.c
>> @@ -938,6 +938,11 @@ int sas_execute_tmf(struct domain_device *device, void *parameter,
>>   		task->dev = device;
>>   		task->task_proto = device->tproto;
>>   
>> +		if (dev_is_sata(device)) {
>> +		} else {
>> +			memcpy(&task->ssp_task, parameter, para_len);
>> +		}
> 
> This looks strange,
> 

I'm trying to be too cute. I did this as I add in the 'if' part in a 
later patch.

In hindsight, I don't think it's a good practice and I'll code as suggested.

 >  why not:
> 		if (!dev_is_sata(device))
> 			memcpy(&task->ssp_task, parameter, para_len);
> .
> 

Thanks,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ