[PATCH] ASoC: qcom: q6dsp: Fix an off-by-one in q6adm_alloc_copp()

Dan Carpenter dan.carpenter at oracle.com
Thu Jul 21 12:47:31 CEST 2022


On Thu, Jul 21, 2022 at 12:30:32PM +0200, Christophe JAILLET wrote:
> You could add find_last_bit(), find_next_zero_bit_le() and
> find_next_bit_le().
> 

Thanks!

> > 
> > regards,
> > dan carpenter
> > 
> > 
> 
> A reduced version of mine was:
> 
> @@
> expression e1, e2;
> statement S;
> @@
> (
> *   e1 = find_first_bit(...);
> |
> *   e1 = find_last_bit(...);
> |
> 	[... snip ...]
> )
>     ...
>     if (e1 > e2)
>         S
> 
> 
> (and it takes only a few seconds to scan the whole kernel :) )

Nice!

I wasn't going to be before but now I have to re-write my generic
check to be even more *powerful* than before!  The new check doesn't
rely on known values for the limit, but uses comparison data instead.

(Still takes overnight to run so I might end up sorely dissappointed
and defeated tomorrow morning)

regards,
dan carpenter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_off_by_one_capped_return.c
Type: text/x-csrc
Size: 1528 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20220721/4c0445ee/attachment-0001.bin>


More information about the Alsa-devel mailing list