Commit e5caf693 authored by Claudiu Manoil's avatar Claudiu Manoil Committed by Scott Wood

soc/qman: Remove redundant checks from qman_create_cgr()

opts is checked redundantly.
Move local_opts declaration inside its usage scope.
Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: default avatarScott Wood <oss@buserror.net>
parent 021ba010
...@@ -2294,7 +2294,6 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, ...@@ -2294,7 +2294,6 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags,
struct qm_mcc_initcgr *opts) struct qm_mcc_initcgr *opts)
{ {
struct qm_mcr_querycgr cgr_state; struct qm_mcr_querycgr cgr_state;
struct qm_mcc_initcgr local_opts = {};
int ret; int ret;
struct qman_portal *p; struct qman_portal *p;
...@@ -2316,11 +2315,12 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, ...@@ -2316,11 +2315,12 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags,
spin_lock(&p->cgr_lock); spin_lock(&p->cgr_lock);
if (opts) { if (opts) {
struct qm_mcc_initcgr local_opts = *opts;
ret = qman_query_cgr(cgr, &cgr_state); ret = qman_query_cgr(cgr, &cgr_state);
if (ret) if (ret)
goto out; goto out;
if (opts)
local_opts = *opts;
if ((qman_ip_rev & 0xFF00) >= QMAN_REV30) if ((qman_ip_rev & 0xFF00) >= QMAN_REV30)
local_opts.cgr.cscn_targ_upd_ctrl = local_opts.cgr.cscn_targ_upd_ctrl =
QM_CGR_TARG_UDP_CTRL_WRITE_BIT | PORTAL_IDX(p); QM_CGR_TARG_UDP_CTRL_WRITE_BIT | PORTAL_IDX(p);
...@@ -2331,7 +2331,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags, ...@@ -2331,7 +2331,7 @@ int qman_create_cgr(struct qman_cgr *cgr, u32 flags,
local_opts.we_mask |= QM_CGR_WE_CSCN_TARG; local_opts.we_mask |= QM_CGR_WE_CSCN_TARG;
/* send init if flags indicate so */ /* send init if flags indicate so */
if (opts && (flags & QMAN_CGR_FLAG_USE_INIT)) if (flags & QMAN_CGR_FLAG_USE_INIT)
ret = qm_modify_cgr(cgr, QMAN_CGR_FLAG_USE_INIT, ret = qm_modify_cgr(cgr, QMAN_CGR_FLAG_USE_INIT,
&local_opts); &local_opts);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment