Powered by Linux
Re: FP with unreachable code check — Semantic Matching Tool

Re: FP with unreachable code check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 05, 2024 at 02:55:52PM +0530, Harshit Mogalapalli wrote:
> Hi Dan,
> 
> 
> I think iio_device_claim_direct_scoped() needs special handling, for some
> reason smatch thinks all these calls are not reachable.
> 
> drivers/iio/adc/ad7380.c:371 ad7380_debugfs_reg_access() warn: ignoring
> unreachable code.
> drivers/iio/adc/ad7380.c:500 ad7380_read_raw() warn: ignoring unreachable
> code.
> drivers/iio/adc/ad7380.c:589 ad7380_write_raw() warn: ignoring unreachable
> code.
> drivers/iio/adc/ad7606.c:153 ad7606_read_raw() warn: ignoring unreachable
> code.
> 

The simplest thing would be to add iio_device_claim_direct_scoped()
to smatch_data/kernel.unreachable.ignore.  Although probably the correct
thing is to check the next statement and silence the warning if it's
unreachable().

regards,
dan carpenter





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux