mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
coresight: Fix dsb_mode_store() unsigned val is never less than zero
dsb_mode_store() warn: unsigned 'val' is never less than zero.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410150702.UaZ7kvet-lkp@intel.com/
Fixes: 018e43ad1e ("coresight-tpdm: Add node to set dsb programming mode")
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/122503017ada249fbf12be3fa4ee6ccb8f8c78cc.1732156624.git.xiaopei01@kylinos.cn
This commit is contained in:
parent
f7d7454607
commit
d4276259f3
|
|
@ -640,8 +640,7 @@ static ssize_t dsb_mode_store(struct device *dev,
|
|||
struct tpdm_drvdata *drvdata = dev_get_drvdata(dev->parent);
|
||||
unsigned long val;
|
||||
|
||||
if ((kstrtoul(buf, 0, &val)) || (val < 0) ||
|
||||
(val & ~TPDM_DSB_MODE_MASK))
|
||||
if ((kstrtoul(buf, 0, &val)) || (val & ~TPDM_DSB_MODE_MASK))
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock(&drvdata->spinlock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user