Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp6361830pxb; Thu, 27 Jan 2022 12:07:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8Ds/ei2xf0Mg0zUFePP5fsj2JYysxGWA49Tw9bCARYJtKHJkY9FEmBntIuI74oOsRukL0 X-Received: by 2002:a63:4:: with SMTP id 4mr3945872pga.445.1643314042840; Thu, 27 Jan 2022 12:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643314042; cv=none; d=google.com; s=arc-20160816; b=nIjz0ci3pu1+60PSuM9KB2PcCS4H0iLzmNeAHIMbZXC3GT96Vru7poOpWY5bcb71ND X0/FhnqZlK+zUjA0UkwMF30GULky8GBMeMbiT3qLDKzvMqvI1QOHfZMOcS0o54ysEe0U 7FdzQV48hjbFK8JDbEn8cMU9WCGP1czyOYwzYAa4nYiQGX36UMv3EgTvfUveLgOtcDyO PH2l0dmIiPlWiVOckbrvP7fw3YleWFjePOFZeZiL3ogmM02Jibykdom22svpjQFpJH07 HeswgW1IsSs1LKC4QSxrPifklWMNbcXg0a3IhW/610DHfQdQfi4lzRDQDSm+lrO89/Bh ynng== 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=vki0xS4btt71lLA919PFlSfiUMDWzR0rVwmLVZtIZDc=; b=dhFVOt9FzqMEiigdPyWqgckGHScTOOEA9dA1rc9cCLXpv5beofGX4/6zgtFaA7+7ET 1+e76CTKTlXQyAgz3i68p+bm7e3XVu0xoPgy/72aMa9yvdmau/wOy5brRVkh48oMq4d/ /dnPLCj+/pNQHDpAAuDRXVpC2cFnOrQjCIIx88phRHwsy/RFmv0kUO7YMbnYzE7807+M HE3xtGX0J5ius1gSmb404dDdMXYMNIDe7swSj4LZCRL8hCQizGwD7aso4HIx2jsuDC4+ p7btYMpXUoZ0GWckyANQlV+5RZ16Gz1EDsh2nPpIzbjwe2FOuC2OkTGe3/uNxJUydjfG 4PQA== 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 h3si2662797pls.380.2022.01.27.12.06.59; Thu, 27 Jan 2022 12:07:22 -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 S240870AbiA0L4C (ORCPT + 99 others); Thu, 27 Jan 2022 06:56:02 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4524 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbiA0L4B (ORCPT ); Thu, 27 Jan 2022 06:56:01 -0500 Received: from fraeml714-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JkzYf13V1z6H8Ws; Thu, 27 Jan 2022 19:55:34 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml714-chm.china.huawei.com (10.206.15.33) 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 12:55:58 +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 11:55:57 +0000 Subject: Re: [PATCH 01/16] scsi: libsas: Use enum for response frame DATAPRES field To: "chenxiang (M)" , , , , , CC: , , , , , , , References: <1643110372-85470-1-git-send-email-john.garry@huawei.com> <1643110372-85470-2-git-send-email-john.garry@huawei.com> <4a2986a4-8293-2a25-8ee1-109ff8aa0bc3@hisilicon.com> From: John Garry Message-ID: <63938cd5-a739-9ebb-cd3c-1b7f8ff81af3@huawei.com> Date: Thu, 27 Jan 2022 11:55:23 +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: <4a2986a4-8293-2a25-8ee1-109ff8aa0bc3@hisilicon.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 11:31, chenxiang (M) wrote: >> + > > I find that iu->datapres is also used in other drivers with 0/1/2, and > maybe it is worth to replace all of them with those enum. > >   2    290 > /home/chenxiang/kernel_next/kernel-dev/drivers/scsi/aic94xx/aic94xx_tmf.c <<>> > >              if (ru->datapres == 1) > 5   1055 > /home/chenxiang/kernel_next/kernel-dev/drivers/scsi/isci/request.c > <<>> >              if (datapres == 1 || datapres == 2) { >    6   1740 > /home/chenxiang/kernel_next/kernel-dev/drivers/scsi/isci/request.c > <<>> >              if (resp_iu->datapres == 0x01 || >    7   1741 > /home/chenxiang/kernel_next/kernel-dev/drivers/scsi/isci/request.c > <<>> >                  resp_iu->datapres == 0x02) { >  17   1641 > /home/chenxiang/kernel_next/kernel-dev/drivers/scsi/mvsas/mv_sas.c > <<>> >              iu->datapres = 2; > >>   /* fill task_status_struct based o OK, I can move that enum to libsas.h and use in those drivers. But I will also check that they are not duplicating code already in libsas.h Thanks, John