提交 3bf8c48c 编写于 作者: M Markus Elfring 提交者: Greg Kroah-Hartman

coresight: etm4x: Two function calls less

Avoid an extra function call in two function implementations
by using a ternary operator instead of a conditional statement.

This issue was detected by using the Coccinelle software.
Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20190829202842.580-2-mathieu.poirier@linaro.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 526af040
...@@ -296,11 +296,8 @@ static ssize_t mode_store(struct device *dev, ...@@ -296,11 +296,8 @@ static ssize_t mode_store(struct device *dev,
spin_lock(&drvdata->spinlock); spin_lock(&drvdata->spinlock);
config->mode = val & ETMv4_MODE_ALL; config->mode = val & ETMv4_MODE_ALL;
etm4_set_mode_exclude(drvdata,
if (config->mode & ETM_MODE_EXCLUDE) config->mode & ETM_MODE_EXCLUDE ? true : false);
etm4_set_mode_exclude(drvdata, true);
else
etm4_set_mode_exclude(drvdata, false);
if (drvdata->instrp0 == true) { if (drvdata->instrp0 == true) {
/* start by clearing instruction P0 field */ /* start by clearing instruction P0 field */
...@@ -999,10 +996,8 @@ static ssize_t addr_range_store(struct device *dev, ...@@ -999,10 +996,8 @@ static ssize_t addr_range_store(struct device *dev,
* Program include or exclude control bits for vinst or vdata * Program include or exclude control bits for vinst or vdata
* whenever we change addr comparators to ETM_ADDR_TYPE_RANGE * whenever we change addr comparators to ETM_ADDR_TYPE_RANGE
*/ */
if (config->mode & ETM_MODE_EXCLUDE) etm4_set_mode_exclude(drvdata,
etm4_set_mode_exclude(drvdata, true); config->mode & ETM_MODE_EXCLUDE ? true : false);
else
etm4_set_mode_exclude(drvdata, false);
spin_unlock(&drvdata->spinlock); spin_unlock(&drvdata->spinlock);
return size; return size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册