From: Lucas De Marchi <lucas.demarchi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Subject: [PATCH 8/9] drm/i915/dmc: remove redundant return in parse_csr_fw()
Date: Fri, 7 Jun 2019 02:12:29 -0700 [thread overview]
Message-ID: <20190607091230.1489-9-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20190607091230.1489-1-lucas.demarchi@intel.com>
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@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 0b1978a2f87d..7608e4e2950d 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -557,7 +557,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;
@@ -569,13 +569,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, fw->size);
if (!r)
- return NULL;
+ return;
readcount += r;
@@ -583,17 +583,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, fw->size - readcount);
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, fw->size - readcount);
- if (!r)
- return NULL;
-
- return csr->dmc_payload;
+ parse_csr_fw_dmc(csr, dmc_header, fw->size - readcount);
}
static void intel_csr_runtime_pm_get(struct drm_i915_private *dev_priv)
@@ -621,8 +617,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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-06-07 9:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-07 9:12 [PATCH 0/9] Add support for new DMC headers Lucas De Marchi
2019-06-07 9:12 ` [PATCH 1/9] drm/i915/dmc: use kernel types Lucas De Marchi
2019-06-07 9:12 ` [PATCH 2/9] drm/i915/dmc: extract fw_info and table walk from intel_package_header Lucas De Marchi
2019-06-10 18:16 ` Srivatsa, Anusha
2019-06-07 9:12 ` [PATCH 3/9] drm/i915/dmc: add support for package_header with version 2 Lucas De Marchi
2019-06-10 18:22 ` Srivatsa, Anusha
2019-06-07 9:12 ` [PATCH 4/9] drm/i915/dmc: extract function to parse css header Lucas De Marchi
2019-06-14 19:30 ` Srivatsa, Anusha
2019-06-07 9:12 ` [PATCH 5/9] drm/i915/dmc: extract function to parse package_header Lucas De Marchi
2019-06-14 20:09 ` Srivatsa, Anusha
2019-06-07 9:12 ` [PATCH 6/9] drm/i915/dmc: extract function to parse dmc_header Lucas De Marchi
2019-06-14 20:24 ` Srivatsa, Anusha
2019-06-07 9:12 ` [PATCH 7/9] drm/i915/dmc: add support to load dmc_header version 3 Lucas De Marchi
2019-06-14 20:03 ` Srivatsa, Anusha
2019-06-07 9:12 ` Lucas De Marchi [this message]
2019-06-14 19:51 ` [PATCH 8/9] drm/i915/dmc: remove redundant return in parse_csr_fw() Srivatsa, Anusha
2019-06-07 9:12 ` [PATCH 9/9] drm/i915/dmc: protect against loading wrong firmware Lucas De Marchi
2019-06-14 19:44 ` Srivatsa, Anusha
2019-06-14 21:37 ` Lucas De Marchi
2019-06-17 17:46 ` Srivatsa, Anusha
2019-06-07 10:40 ` ✓ Fi.CI.BAT: success for Add support for new DMC headers Patchwork
2019-06-09 17:17 ` ✓ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190607091230.1489-9-lucas.demarchi@intel.com \
--to=lucas.demarchi@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox