提交 66fa6100 编写于 作者: Y Yannis Damigos 提交者: Greg Kroah-Hartman

staging:android:ion: Fix comparison with NULL

This patch fixes the following comparison with NULL issues:

CHECK: Comparison to NULL could be written "compatible[i].name"
+	for (i = 0; compatible[i].name != NULL; i++) {

CHECK: Comparison to NULL could be written "!compatible[i].name"
+	if (compatible[i].name == NULL)
Signed-off-by: NYannis Damigos <giannis.damigos@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9f7a104c
...@@ -31,12 +31,12 @@ static int ion_parse_dt_heap_common(struct device_node *heap_node, ...@@ -31,12 +31,12 @@ static int ion_parse_dt_heap_common(struct device_node *heap_node,
{ {
int i; int i;
for (i = 0; compatible[i].name != NULL; i++) { for (i = 0; compatible[i].name; i++) {
if (of_device_is_compatible(heap_node, compatible[i].compat)) if (of_device_is_compatible(heap_node, compatible[i].compat))
break; break;
} }
if (compatible[i].name == NULL) if (!compatible[i].name)
return -ENODEV; return -ENODEV;
heap->id = compatible[i].heap_id; heap->id = compatible[i].heap_id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册