Skip to content

Commit d427625

Browse files
Pei XiaoSuzuki K Poulose
authored andcommitted
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 <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 018e43a ("coresight-tpdm: Add node to set dsb programming mode") Signed-off-by: Pei Xiao <[email protected]> Reviewed-by: James Clark <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/122503017ada249fbf12be3fa4ee6ccb8f8c78cc.1732156624.git.xiaopei01@kylinos.cn
1 parent f7d7454 commit d427625

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/hwtracing/coresight/coresight-tpdm.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,7 @@ static ssize_t dsb_mode_store(struct device *dev,
640640
struct tpdm_drvdata *drvdata = dev_get_drvdata(dev->parent);
641641
unsigned long val;
642642

643-
if ((kstrtoul(buf, 0, &val)) || (val < 0) ||
644-
(val & ~TPDM_DSB_MODE_MASK))
643+
if ((kstrtoul(buf, 0, &val)) || (val & ~TPDM_DSB_MODE_MASK))
645644
return -EINVAL;
646645

647646
spin_lock(&drvdata->spinlock);

0 commit comments

Comments
 (0)