[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240430152931.1137975-3-max.kellermann@ionos.com>
Date: Tue, 30 Apr 2024 17:29:18 +0200
From: Max Kellermann <max.kellermann@...os.com>
To: akpm@...ux-foundation.org,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: willy@...radead.org,
sfr@...b.auug.org,
david@...hat.com.au,
Max Kellermann <max.kellermann@...os.com>
Subject: [PATCH v5 02/15] include/drm/drm_gem.h: add poll_table_struct forward declaration
After eliminating includes of linux/mm.h, the following build failure
occurred:
./include/drm/drm_file.h:443:45: warning: ‘struct poll_table_struct’ declared inside parameter list will not be visible outside of this definition or declaration
443 | __poll_t drm_poll(struct file *filp, struct poll_table_struct *wait);
| ^~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/imagination/pvr_gem.h:12,
from drivers/gpu/drm/imagination/pvr_fw.h:9:
./include/drm/drm_gem.h:447:27: error: initialization of ‘__poll_t (*)(struct file *, struct poll_table_struct *)’ {aka ‘unsigned int (*)(struct file *, struct poll_table_struct *)’} from incompatible pointer type ‘__poll_t (*)(struct file *, struct poll_table_struct *)’ {aka ‘unsigned int (*)(struct file *, struct poll_table_struct *)’} [-Werror=incompatible-pointer-types]
447 | .poll = drm_poll,\
| ^~~~~~~~
The compiler is confused, and that can be fixed easily by
forward-declaring the struct expicitly.
Signed-off-by: Max Kellermann <max.kellermann@...os.com>
---
include/drm/drm_file.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index ab230d3af138..f24ade9f766f 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -44,6 +44,7 @@ struct drm_device;
struct drm_printer;
struct device;
struct file;
+struct poll_table_struct;
/*
* FIXME: Not sure we want to have drm_minor here in the end, but to avoid
--
2.39.2
Powered by blists - more mailing lists