cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init()
authorYanfei Xu <yanfei.xu@intel.com>
Wed, 28 Aug 2024 08:42:31 +0000 (16:42 +0800)
committerDave Jiang <dave.jiang@intel.com>
Mon, 9 Sep 2024 18:33:44 +0000 (11:33 -0700)
commit3f9e07531778ce66e0100d93f482e9a299d10d8d
tree5161bf1ba3eb14cb8b209197441ff8c94b4c2768
parent99bf0eebc75c9085440d6dca014724e7e49b5116
cxl/pci: simplify the check of mem_enabled in cxl_hdm_decode_init()

Cases can be divided into two categories which are DVSEC range enabled and
not enabled when HDM decoders exist but is not enabled. To avoid checking
info->mem_enabled, which indicates the enablement of DVSEC range, every
time, we can check !info->mem_enabled once in advance. This simplification
can make the code clearer.

No functional change intended.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Yanfei Xu <yanfei.xu@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Link: https://patch.msgid.link/20240828084231.1378789-5-yanfei.xu@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/pci.c