[Intel-gfx] [PATCH 08/10] drm/i915/dmc: remove redundant return in parse_csr_fw()
Lucas De Marchi
lucas.demarchi at intel.com
Thu May 23 08:24:18 UTC 2019
parse_csr_fw() is responsible to set up several fields in struct intel_csr,
including the payload. We don't need to assign it again.
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
drivers/gpu/drm/i915/intel_csr.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index ad4ee55a8c5e..7ff08de83cc6 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -520,7 +520,7 @@ static u32 parse_csr_fw_css(struct intel_csr *csr,
return sizeof(struct intel_css_header);
}
-static u32 *parse_csr_fw(struct drm_i915_private *dev_priv,
+static void parse_csr_fw(struct drm_i915_private *dev_priv,
const struct firmware *fw)
{
struct intel_css_header *css_header;
@@ -532,13 +532,13 @@ static u32 *parse_csr_fw(struct drm_i915_private *dev_priv,
u32 r;
if (!fw)
- return NULL;
+ return;
/* Extract CSS Header information*/
css_header = (struct intel_css_header *)fw->data;
r = parse_csr_fw_css(csr, css_header);
if (!r)
- return NULL;
+ return;
readcount += r;
@@ -546,17 +546,13 @@ static u32 *parse_csr_fw(struct drm_i915_private *dev_priv,
package_header = (struct intel_package_header *)&fw->data[readcount];
r = parse_csr_fw_package(csr, package_header, si);
if (!r)
- return NULL;
+ return;
readcount += r;
/* Extract dmc_header information. */
dmc_header = (struct intel_dmc_header_base *)&fw->data[readcount];
- r = parse_csr_fw_dmc(csr, dmc_header);
- if (!r)
- return NULL;
-
- return csr->dmc_payload;
+ parse_csr_fw_dmc(csr, dmc_header);
}
static void intel_csr_runtime_pm_get(struct drm_i915_private *dev_priv)
@@ -584,8 +580,7 @@ static void csr_load_work_fn(struct work_struct *work)
csr = &dev_priv->csr;
request_firmware(&fw, dev_priv->csr.fw_path, &dev_priv->drm.pdev->dev);
- if (fw)
- dev_priv->csr.dmc_payload = parse_csr_fw(dev_priv, fw);
+ parse_csr_fw(dev_priv, fw);
if (dev_priv->csr.dmc_payload) {
intel_csr_load_program(dev_priv);
--
2.21.0
More information about the Intel-gfx
mailing list