Skip to contentSkip to conversation

platform/chrome: cros_ec: fix compilation warning

PATCH Applied Tzung-Bi Shih 3 participants 4 messages Oct 3, 2023 – Oct 11, 2023

Subsystems (2)
lore
Share & tools
lore

Tzung-Bi Shih

author maintainer
#0 lore raw

PATCH 1/1 platform/chrome: cros_ec: fix compilation warning

When including cros_ec.h solely, the compiler emits the following warning:

Quoted 1 line

'struct cros_ec_device' declared inside parameter list

will not be visible outside of this definition or declaration

Fix it by forward declaration.

---
 drivers/platform/chrome/cros_ec.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/chrome/cros_ec.h +2 -0
index bbca0096868a..2b2574236030 100644
@@ -10,6 +10,8 @@
 
 #include <linux/interrupt.h>
 
+struct cros_ec_device;
+
 int cros_ec_register(struct cros_ec_device *ec_dev);
 void cros_ec_unregister(struct cros_ec_device *ec_dev);
 
Signature · 1 line
2.42.0.582.g8ccd20d70d-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Tzung-Bi Shih

When including cros_ec.h solely, the compiler emits the following warning:

Quoted 1 line

'struct cros_ec_device' declared inside parameter list

will not be visible outside of this definition or declaration

Fix it by forward declaration.

Quoted 20 lines
---
 drivers/platform/chrome/cros_ec.h | 2 ++
 1 file changed, 2 insertions(+)
drivers/platform/chrome/cros_ec.h +2 -1
index bbca0096868a..2b2574236030 100644
@@ -10,6 +10,8 @@
 
 #include <linux/interrupt.h>
 
+struct cros_ec_device;
+
 int cros_ec_register(struct cros_ec_device *ec_dev);
 void cros_ec_unregister(struct cros_ec_device *ec_dev);
 
--

2.42.0.582.g8ccd20d70d-goog

#2 lore raw
In reply to Tzung-Bi Shih
This patch was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Quoted 8 lines · On Tue, 3 Oct 2023 08:04:53 +0000 you wrote:

When including cros_ec.h solely, the compiler emits the following warning:

Quoted 1 line

'struct cros_ec_device' declared inside parameter list

will not be visible outside of this definition or declaration

Fix it by forward declaration.

[...]

Here is the summary with links:
- platform/chrome: cros_ec: fix compilation warning

    https://git.kernel.org/chrome-platform/c/a7bad167bdc3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#3 lore raw
In reply to Tzung-Bi Shih
This patch was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Hello:

This patch was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Quoted 8 lines · On Tue, 3 Oct 2023 08:04:53 +0000 you wrote:

When including cros_ec.h solely, the compiler emits the following warning:

Quoted 1 line

'struct cros_ec_device' declared inside parameter list

will not be visible outside of this definition or declaration

Fix it by forward declaration.

[...]

Here is the summary with links:
- platform/chrome: cros_ec: fix compilation warning

    https://git.kernel.org/chrome-platform/c/a7bad167bdc3

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html