From: Alex Elder Date: Tue, 23 Sep 2014 17:46:33 +0000 (-0500) Subject: greybus: get rid of a weird idiom X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=217b870e99ce68b868db08f4257c6f463abddd0c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 296ff61aaefb..33d7a334c9b1 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -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; }