Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp6277638pxb; Thu, 27 Jan 2022 10:07:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJziRW+NCRYmUP/h6JaTsqoYSo50dHgU6glhYIBV95mtv17UcgdrysX/q8wGdAZyQHZUwsbD X-Received: by 2002:a17:907:6da6:: with SMTP id sb38mr4025616ejc.58.1643306846534; Thu, 27 Jan 2022 10:07:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643306846; cv=none; d=google.com; s=arc-20160816; b=EeAg+Yc4EYTGifLCx9AGmgE+VOI1wr7jUv3Vy2TX3uKAPB5y++HBWcm+HEIOlWulof NWN/xo27n2+XBIn403JQR4LO69FGeOOZIALilmn4ulh7isyrxcG6F8uYMX/HDB32VsiQ zEAQoS1M/ywFA+up+eTfjESSVXUPVWDcxaHJBpDySjbGh+1+IcpzcUmLBVzoMJHC2Pr7 dFNw3NMtj1vbsDXvGT4lRAd1ldITH1ZYz01xngmxxCJnITjafZaeznV87ssh/9s/6oGR YzBBK/v3rfzVp/d+fykP4LsY+y/R7LxLzYbcM2JlrUQ33T8GYKtBUrlkscighORTEj2F sQgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=j+efZ1LOWrqQqG1v3+Ec6Eko6MNpHd/g0Z2h0gehH2o=; b=a03RWnjKeSPdC93EdHq0buEvswYJxBzhWQBswgSFBIYnRadA9UmzYGosyvsE8Ger82 wvuVhvQEJxWs7TlzimZ+jqR7opQO2tdMycKWGGIVxSE91npqYiZJjuj3m6jOG6zwwS3B 0QJc5QY1gks3eKm102m4pvKVvYmU+GK6cByhJZcKigyX3ku9+qd59Xml/cmO8PCWDj5A gMt9iaFgF45cdD6tj/sJU/f6MPV1xspBvLXhhn+MBu46ZIRyWJsBDeN8Q91JoU4pNnlm uzIX//6aoizo6vJp3mHZdPu/4l0770bSVXPe5FSMlzyVDTHxBRZFwW7hKAXHWHOcPFJN uyMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o8si1737437ejy.773.2022.01.27.10.07.01; Thu, 27 Jan 2022 10:07:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239627AbiA0KrI (ORCPT + 99 others); Thu, 27 Jan 2022 05:47:08 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4523 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239595AbiA0Kq7 (ORCPT ); Thu, 27 Jan 2022 05:46:59 -0500 Received: from fraeml737-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Jky2023Tvz6H8Vl; Thu, 27 Jan 2022 18:46:32 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml737-chm.china.huawei.com (10.206.15.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 27 Jan 2022 11:46:56 +0100 Received: from [10.47.26.192] (10.47.26.192) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 27 Jan 2022 10:46:55 +0000 Subject: Re: [PATCH 08/16] scsi: libsas: Add sas_execute_ssp_tmf() To: Christoph Hellwig CC: , , , , , , , , , , , , , References: <1643110372-85470-1-git-send-email-john.garry@huawei.com> <1643110372-85470-9-git-send-email-john.garry@huawei.com> From: John Garry Message-ID: <442fa3a6-3e6b-0a5e-47a4-87fcfc696f8b@huawei.com> Date: Thu, 27 Jan 2022 10:46:22 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.47.26.192] X-ClientProxiedBy: lhreml713-chm.china.huawei.com (10.201.108.64) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> --- >> 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