kernel: resource: Remove unnecessary ‘0’ values from err
PATCH v2 1/1 kernel: resource: Remove unnecessary ‘0’ values from err
err is assigned first, so it does not need to initialize the assignment. Modify __find_resource execution syntax to make it more in line with commonly used styles.
Signed-off-by Li kunyu <[email protected]>
---
v2:
Modify __find_resource Execution Syntax.
kernel/resource.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/resource.c +3 -2
@@ -656,13 +656,14 @@ static int reallocate_resource(struct resource *root, struct resource *old,resource_size_t newsize, struct resource_constraint *constraint) { - int err=0; + int err;struct resource new = *old;struct resource *conflict;write_lock (&resource_lock); -if ((err =__find_resource (root, old, &new, newsize, constraint))) + err =__find_resource (root, old, &new, newsize, constraint); +if (err) goto out;if (resource_contains (&new, old)) {
Signature · 1 line
2.18.2
Quoted 5 lines · Li kunyu
err is assigned first, so it does not need to initialize the assignment. Modify
__find_resourceexecution syntax to make it more in line with commonly used styles.Signed-off-by Li kunyu <[email protected]>
Reviewed-by Randy Dunlap <[email protected]>
Thanks.
Quoted 28 lines
---
v2:
Modify__find_resourceExecution Syntax.kernel/resource.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/resource.c +3
-2@@ -656,13 +656,14 @@ static int reallocate_resource(struct resource *root, struct resource *old,resource_size_t newsize, struct resource_constraint *constraint) { - int err=0; + int err;struct resource new = *old;struct resource *conflict;write_lock (&resource_lock); -if ((err =__find_resource (root, old, &new, newsize, constraint))) + err =__find_resource (root, old, &new, newsize, constraint); +if (err) goto out;if (resource_contains (&new, old)) {
Signature · 1 line
~Randy
Quoted 3 lines · Li kunyu
err is assigned first, so it does not need to initialize the assignment. Modify
__find_resourceexecution syntax to make it more in line with commonly used styles.
FWIW,
Reviewed-by Andy Shevchenko <[email protected]>
Quoted 32 lines
Signed-off-by Li kunyu <[email protected]>---
v2:
Modify__find_resourceExecution Syntax.kernel/resource.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/resource.c +3
-2@@ -656,13 +656,14 @@ static int reallocate_resource(struct resource *root, struct resource *old,resource_size_t newsize, struct resource_constraint *constraint) { - int err=0; + int err;struct resource new = *old;struct resource *conflict;write_lock (&resource_lock); -if ((err =__find_resource (root, old, &new, newsize, constraint))) + err =__find_resource (root, old, &new, newsize, constraint); +if (err) goto out;if (resource_contains (&new, old)) {Signature · 1 line
2.18.2
Signature · 2 lines
With Best Regards, Andy Shevchenko