gpu: host1x: fix missing 'host1x_context_device_bus_type'
PATCH v2 1/1 gpu: host1x: fix missing 'host1x_context_device_bus_type'
The drivers/gpu/host1x/context_bus.c does not include any declaration of host1x_context_device_bus_type, and after including "context.h" it also showed that there are two definitons in the kernel, so fix those two
Fix by removing the definition in context.h and include <linux/host1x_context_bus.h> in context_bus.c
Fixes the following sparse warning:drivers/gpu/host1x/context_bus.c:9:23: warning: symbol 'host1x_context_device_bus_type' was not declared. Should it be static?
--
v2:
- removed fixes line
- changed to include into the c files directly
--- drivers/gpu/host1x/context.c | 1 + drivers/gpu/host1x/context.h | 2 -- drivers/gpu/host1x/context_bus.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/host1x/context.c +1 -0
@@ -12,6 +12,7 @@#include "context.h" #include "dev.h" +#include <linux/host1x_context_bus.h> static void host1x_memory_context_release (struct device *dev) {
drivers/gpu/host1x/context.h +0 -2
@@ -13,8 +13,6 @@struct host1x ; -extern struct bus_type host1x_context_device_bus_type; -struct host1x_memory_context_list {struct mutex lock;struct host1x_memory_context *devs;
drivers/gpu/host1x/context_bus.c +1 -0
@@ -5,6 +5,7 @@#include <linux/device.h> #include <linux/of.h> +#include <linux/host1x_context_bus.h> const struct bus_type host1x_context_device_bus_type = { .name ="host1x-context" ,
Signature · 1 line
2.37.2.352.g3c44437643
Mikko Perttunen
maintainerQuoted 27 lines · Ben Dooks
The
drivers/gpu/host1x/context_bus.cdoes not include any declaration ofhost1x_context_device_bus_type, and after including "context.h" it also showed that there are two definitons in the kernel, so fix those twoFix by removing the definition in
context.hand include <linux/host1x_context_bus.h> incontext_bus.cFixes the following sparse warning:
drivers/gpu/host1x/context_bus.c:9:23: warning: symbol 'host1x_context_device_bus_type' was not declared. Should it be static?Signed-off-by Ben Dooks <[email protected]>--
v2:
- removed fixes line
- changed to include into the c files directly--- drivers/gpu/host1x/context.c | 1 + drivers/gpu/host1x/context.h | 2 -- drivers/gpu/host1x/context_bus.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)drivers/gpu/host1x/context.c +0
-0
drivers/gpu/host1x/context.c line 15
Quoted 4 lines
drivers/gpu/host1x/context.c +1
-0@@ -12,6 +12,7 @@#include "context.h" #include "dev.h" +#include <linux/host1x_context_bus.h>
Both this and the #include below are sorted incorrectly (should be within the linux/ block of includes and alphabetically sorted). Otherwise looks good.
Mikko
Quoted 29 lines
drivers/gpu/host1x/context.c +0
-0static void host1x_memory_context_release (struct device *dev) {drivers/gpu/host1x/context.h +0
-2@@ -13,8 +13,6 @@struct host1x ; -extern struct bus_type host1x_context_device_bus_type; -struct host1x_memory_context_list {struct mutex lock;struct host1x_memory_context *devs;drivers/gpu/host1x/context_bus.c +1
-0@@ -5,6 +5,7 @@#include <linux/device.h> #include <linux/of.h> +#include <linux/host1x_context_bus.h> const struct bus_type host1x_context_device_bus_type = { .name ="host1x-context" ,
Thierry Reding
maintainerQuoted 16 lines · Ben Dooks
The
drivers/gpu/host1x/context_bus.cdoes not include any declaration ofhost1x_context_device_bus_type, and after including "context.h" it also showed that there are two definitons in the kernel, so fix those twoFix by removing the definition in
context.hand include <linux/host1x_context_bus.h> incontext_bus.cFixes the following sparse warning:
drivers/gpu/host1x/context_bus.c:9:23: warning: symbol 'host1x_context_device_bus_type' was not declared. Should it be static?Signed-off-by Ben Dooks <[email protected]>--
v2:
- removed fixes line
- changed to include into the c files directly
Quoted 5 lines
--- drivers/gpu/host1x/context.c | 1 + drivers/gpu/host1x/context.h | 2 -- drivers/gpu/host1x/context_bus.c | 1 + 3 files changed, 2 insertions(+), 2 deletions(-)
Applied this with Mikko's comments worked in. I also updated the commit message a tiny bit and added a predeclaration of struct host1x_memory_context in context.h out of an extra abundance of caution.
Thierry