Re: Checkpatch.pl false positive? "ERROR: return is not a function, parentheses are not required"

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joe Perches
Date: Sunday, March 28, 2010 - 12:59 pm

On Sun, 2010-03-28 at 23:09 +0300, Alexey Dobriyan wrote:

And as currently implemented, can not.

I think this passes checkpatch without warning:

	return (dt3155_fbuffer[m]->ready_head -
		dt3155_fbuffer[m]->ready_len +
		dt3155_fbuffer[m]->nbuffers) %
	       dt3155_fbuffer[m]->nbuffers;

It might be better to use a temporary for dt3155_fbuffer[m]
so the code could look more like:
	return (p->ready_head - p->ready_len + p->nbuffers) % p->nbuffers;
	

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: Checkpatch.pl false positive? "ERROR: return is not a ..., Joe Perches, (Sun Mar 28, 12:59 pm)