Commit d597f71b authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix some compile warnings

From: "Martin J. Bligh" <mbligh@aracnet.com>

Fix a couple of instances of "warning: suggest parentheses around assignment
used as truth value".
parent 92525be5
...@@ -49,8 +49,12 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root) ...@@ -49,8 +49,12 @@ int __init register_cpu(struct cpu *cpu, int num, struct node *root)
int __init cpu_dev_init(void) int __init cpu_dev_init(void)
{ {
int error; int error;
if (!(error = devclass_register(&cpu_devclass)))
if ((error = driver_register(&cpu_driver))) error = devclass_register(&cpu_devclass);
if (!error) {
error = driver_register(&cpu_driver);
if (error)
devclass_unregister(&cpu_devclass); devclass_unregister(&cpu_devclass);
}
return error; return error;
} }
...@@ -50,9 +50,13 @@ int __init register_memblk(struct memblk *memblk, int num, struct node *root) ...@@ -50,9 +50,13 @@ int __init register_memblk(struct memblk *memblk, int num, struct node *root)
int __init register_memblk_type(void) int __init register_memblk_type(void)
{ {
int error; int error;
if (!(error = devclass_register(&memblk_devclass)))
if (error = driver_register(&memblk_driver)) error = devclass_register(&memblk_devclass);
if (!error) {
error = driver_register(&memblk_driver);
if (error)
devclass_unregister(&memblk_devclass); devclass_unregister(&memblk_devclass);
}
return error; return error;
} }
postcore_initcall(register_memblk_type); postcore_initcall(register_memblk_type);
...@@ -92,9 +92,13 @@ int __init register_node(struct node *node, int num, struct node *parent) ...@@ -92,9 +92,13 @@ int __init register_node(struct node *node, int num, struct node *parent)
int __init register_node_type(void) int __init register_node_type(void)
{ {
int error; int error;
if (!(error = devclass_register(&node_devclass)))
if (error = driver_register(&node_driver)) error = devclass_register(&node_devclass);
if (!error) {
error = driver_register(&node_driver);
if (error)
devclass_unregister(&node_devclass); devclass_unregister(&node_devclass);
}
return error; return error;
} }
postcore_initcall(register_node_type); postcore_initcall(register_node_type);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment