Hi Jonathan, Thanks for clarifying the intent of the series and for the hints on how to test the patches. I think we will need a v2. Didn't look through all drivers being updated but most of the ones I looked at had a bugy check of iio_device_claim_direct() return. Please see my comments to the cover letter. Thanks, Marcelo On 01/11, Jonathan Cameron wrote: > On Tue, 7 Jan 2025 14:28:54 +0000 > Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> wrote: > > > On Tue, 7 Jan 2025 08:29:36 -0300 > > Marcelo Schmitt <marcelo.schmitt1@xxxxxxxxx> wrote: > > > > > On 01/05, Jonathan Cameron wrote: > > > > From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > > > > > > > > This complex cleanup.h use case of conditional guards has proved > > > > to be more trouble that it is worth in terms of false positive compiler > > > > warnings and hard to read code. > > > > > > > > Move directly to the new claim/release_direct() that allow sparse > > > > to check for unbalanced context. > > > > > > > > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxxx> > > > > --- > > > > drivers/iio/adc/ad4000.c | 61 +++++++++++++++++++++++++--------------- > > > > 1 file changed, 38 insertions(+), 23 deletions(-) > > > > > > > Hi Jonathan, aside from the spurious blank line noted by David, the changes for > > > ad4000 look good to me. > > > > > > Acked-by: <marcelo.schmitt1@xxxxxxxxx> > > > > > > I also tried running Sparse on IIO subsystem but didn't see any warns for the > > > drivers being changed (nor prior nor after applying the patches). > > > > > > make CHECK="path_to_local_sparse_v0.6.4-66-g0196afe1" C=2 drivers/iio/ > > > > > > Did see warns after adding incorrect type in assignments in the driver. > > > > > > Mind sharing how you are running Sparse? > > > > I just used C=1 but that doesn't really matter for this. > > With this series there should be no false positive warnings (or before > > it where we didn't have any markings so sparse didn't know to do anything). > > > > Testing wise, I sprinkled in some early returns, breaks etc to add > > some broken paths and those triggered context imbalance warnings. > > > > This isn't fixing warnings, it is just about moving to code where we > > will get them if we do something silly in the future. > > Seems David is also not seeing warnings when he deliberately breaks > the code. See discussion on patch 1. Hopefully we'll soon get to the > bottom of why! > > Jonathan > > > > > Jonathan > > > > > > > > Thanks, > > > Marcelo > > >