mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 15:47:36 +00:00
greybus: get rid of a weird idiom
It strikes me as strange to add one to a value while checking to see if it exceeds a maximum. Signed-off-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
380f6bddc9
commit
217b870e99
1 changed files with 2 additions and 2 deletions
|
@ -282,7 +282,7 @@ static int create_string(struct greybus_module *gmod,
|
|||
int string_size;
|
||||
struct gmod_string *gmod_string;
|
||||
|
||||
if ((gmod->num_strings + 1) >= MAX_STRINGS_PER_MODULE) {
|
||||
if (gmod->num_strings == MAX_STRINGS_PER_MODULE) {
|
||||
dev_err(gmod->dev.parent,
|
||||
"too many strings for this module!\n");
|
||||
return -EINVAL;
|
||||
|
@ -315,7 +315,7 @@ static int create_cport(struct greybus_module *gmod,
|
|||
{
|
||||
struct gmod_cport *gmod_cport;
|
||||
|
||||
if ((gmod->num_cports + 1) >= MAX_CPORTS_PER_MODULE) {
|
||||
if (gmod->num_cports == MAX_CPORTS_PER_MODULE) {
|
||||
dev_err(gmod->dev.parent, "too many cports for this module!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue