Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3605718pxj; Mon, 21 Jun 2021 02:31:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX45YApOj4M2y6Sxjs0c4rJjooqJjrAo55Zm5CUFOWC8R1FFzkZiwZ0zQ0LEm5D1j4hswN X-Received: by 2002:aa7:db95:: with SMTP id u21mr20095732edt.152.1624267864739; Mon, 21 Jun 2021 02:31:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624267864; cv=none; d=google.com; s=arc-20160816; b=TcgDJFUZMAorjtxYjg9ULJ2q3Vl/9dv8hyOjPdbgtDiDCLIOvTeR7UqFI3/u2YdaHd zzBXl/VNvalBI3JigZ6thKbRcrH/pelTSNbtlrNO061xdUW5HAt0XPk6QsUOb51JuFWN OkvWCYrEuuxI5UPkh8uWkgLlDTH5oCZ1qAMBRijMlndCGerjRB9SRob2vT5N+CcFP4wH omlnaWuP4xJo2ZMTDyx6zhTg4mUkh5eJgQPDRRwV4dfPzb/mAg/abqW/FZcPvI8fb+v6 YiEyoVxL8Pk7w/N28aWLv4SB+9Tdz2N2oOWL/JKMMK77tlQ6ZYMzgih+xsj11KGQIzBj nSTQ== 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:organization :from:references:to:subject:ironport-sdr:ironport-sdr; bh=mmtTIuPMgO1VG5ioQ7bXgiLYboIdV98IOMF+zmP92M0=; b=dbwDM2ifBNj6NX5tBgIEdIGYR0BqrgndVALBF/9YuJmx0o71zO5h3DWs5EDQuN3GH/ NzCVwPItzv3cj1DmycL4bgkEq/+cc7jTSZaMScOXXKSX7+j2Ldx62eHnrKNvUKmCGujt ByQIrYvlfkVEH/onp/uB3YZ4vplMjd/NhWpBFot6EQhNjdAi+kET3ljhbBc1iXG2maJ6 bOvaQ8LkQNXpjFMacfxW91bj0FzmcGp7I4c3SH2DFLxqXffCaFmaJLYVO9O7ECYw2WGn HjeWUbyj/dsJQe6SihKUOO5Z/+UcGhnc8PXgqgEdHEq6sci0PjhFtsvzguQZl9HXwI2v HMfQ== 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=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bz8si10569313ejc.435.2021.06.21.02.30.43; Mon, 21 Jun 2021 02:31:04 -0700 (PDT) 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=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229888AbhFUJby (ORCPT + 99 others); Mon, 21 Jun 2021 05:31:54 -0400 Received: from mga03.intel.com ([134.134.136.65]:61365 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229641AbhFUJbx (ORCPT ); Mon, 21 Jun 2021 05:31:53 -0400 IronPort-SDR: LXQOWgJ/mlYlUEDVJwRL7C16qmAHJgiCdKZ23+/cqtGklLGjzmP5dicC8VPQqCiYWBRzNLcVzd hEvYi+9PVaGw== X-IronPort-AV: E=McAfee;i="6200,9189,10021"; a="206850143" X-IronPort-AV: E=Sophos;i="5.83,289,1616482800"; d="scan'208";a="206850143" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2021 02:29:38 -0700 IronPort-SDR: KC3R/4G2ArhR9KURjfmKrolji4DpjaOi0FVZinQwAdqqOeEH+z7NxaJIuYxHaQBqQqs4xzsVgB JYTIJAQla1zw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,289,1616482800"; d="scan'208";a="405565750" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.79]) ([10.237.72.79]) by orsmga006.jf.intel.com with ESMTP; 21 Jun 2021 02:29:34 -0700 Subject: Re: [PATCH] scsi: ufs: Refactor ufshcd_is_intr_aggr_allowed() To: keosung.park@samsung.com, "joe@perches.com" , ALIM AKHTAR , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "beanhuo@micron.com" , "asutoshd@codeaurora.org" , Kiwoong Kim , "satyat@google.com" , "bvanassche@acm.org" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <1891546521.01624267081897.JavaMail.epsvc@epcpadp4> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Mon, 21 Jun 2021 12:29:58 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1891546521.01624267081897.JavaMail.epsvc@epcpadp4> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/06/21 11:51 am, Keoseong Park wrote: > Change conditional compilation to IS_ENABLED macro, > and simplify if else statement to return statement. > No functional change. > > Signed-off-by: Keoseong Park > --- > drivers/scsi/ufs/ufshcd.h | 17 ++++++++--------- > 1 file changed, 8 insertions(+), 9 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > index c98d540ac044..6d239a855753 100644 > --- a/drivers/scsi/ufs/ufshcd.h > +++ b/drivers/scsi/ufs/ufshcd.h > @@ -893,16 +893,15 @@ static inline bool ufshcd_is_rpm_autosuspend_allowed(struct ufs_hba *hba) > > static inline bool ufshcd_is_intr_aggr_allowed(struct ufs_hba *hba) > { > -/* DWC UFS Core has the Interrupt aggregation feature but is not detectable*/ > -#ifndef CONFIG_SCSI_UFS_DWC > - if ((hba->caps & UFSHCD_CAP_INTR_AGGR) && > - !(hba->quirks & UFSHCD_QUIRK_BROKEN_INTR_AGGR)) > + /* > + * DWC UFS Core has the Interrupt aggregation feature > + * but is not detectable. > + */ > + if (IS_ENABLED(CONFIG_SCSI_UFS_DWC)) Why is this needed? It seems like you could just set UFSHCD_CAP_INTR_AGGR and clear UFSHCD_QUIRK_BROKEN_INTR_AGGR instead? > return true; > - else > - return false; > -#else > -return true; > -#endif > + > + return (hba->caps & UFSHCD_CAP_INTR_AGGR) && > + !(hba->quirks & UFSHCD_QUIRK_BROKEN_INTR_AGGR); > } > > static inline bool ufshcd_can_aggressive_pc(struct ufs_hba *hba) >