mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-27 14:14:24 +08:00
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: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Link: https://lore.kernel.org/r/20190829202842.580-2-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
526af04054
commit
3bf8c48ca7
@ -296,11 +296,8 @@ static ssize_t mode_store(struct device *dev,
|
||||
|
||||
spin_lock(&drvdata->spinlock);
|
||||
config->mode = val & ETMv4_MODE_ALL;
|
||||
|
||||
if (config->mode & ETM_MODE_EXCLUDE)
|
||||
etm4_set_mode_exclude(drvdata, true);
|
||||
else
|
||||
etm4_set_mode_exclude(drvdata, false);
|
||||
etm4_set_mode_exclude(drvdata,
|
||||
config->mode & ETM_MODE_EXCLUDE ? true : false);
|
||||
|
||||
if (drvdata->instrp0 == true) {
|
||||
/* start by clearing instruction P0 field */
|
||||
@ -999,10 +996,8 @@ static ssize_t addr_range_store(struct device *dev,
|
||||
* Program include or exclude control bits for vinst or vdata
|
||||
* whenever we change addr comparators to ETM_ADDR_TYPE_RANGE
|
||||
*/
|
||||
if (config->mode & ETM_MODE_EXCLUDE)
|
||||
etm4_set_mode_exclude(drvdata, true);
|
||||
else
|
||||
etm4_set_mode_exclude(drvdata, false);
|
||||
etm4_set_mode_exclude(drvdata,
|
||||
config->mode & ETM_MODE_EXCLUDE ? true : false);
|
||||
|
||||
spin_unlock(&drvdata->spinlock);
|
||||
return size;
|
||||
|
Loading…
Reference in New Issue
Block a user