Powered by Linux
Re: [PATCH 2/2] Fix handle_bit_test so that null set condition is taken care of — Semantic Matching Tool

Re: [PATCH 2/2] Fix handle_bit_test so that null set condition is taken care of

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

 



On Mon, Jul 12, 2021 at 06:09:47PM +0530, Harshvardhan Jha wrote:
> The handle_bit_test condition wasn't setting a false range_list for the
> false state and hence the implied rl was coming out to be false. The
> false and true rls have been calculating using rl_intersection and
> rl_filter commands.
> 

Can you fix the commit message a bit.  Assume that the person reading
your patch understands Smatch basically but doesn't remember all the
details.  I like to give a little background.  Here is my proposed
commit message:

  Imagine we have code like:

  	if ((1 << foo) & valid_bits) {

  The handle_bit_test() function is supposed to answer the question,
  "what does that mean about 'foo'"?

  This patch fixes several bugs:
  1)  The range is off by one.  ffsll() returns 1 for BIT(0) so we need
      to subtract 1 from what ffsll() returns.
  2)  This code returns early for impossible conditions but it is better
      to set "foo" to the empty state.
  3)  The false state was not set.  We can use rl_filter() for that.

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