diff mbox series

platform/chrome: cros_ec: fix compilation warning

Message ID 20231003080453.4011301-1-tzungbi@kernel.org (mailing list archive)
State Accepted
Commit a7bad167bdc3cf4c47c6a9ec4fc9b4ae18b4614d
Headers show
Series platform/chrome: cros_ec: fix compilation warning | expand

Commit Message

Tzung-Bi Shih Oct. 3, 2023, 8:04 a.m. UTC
When including cros_ec.h solely, the compiler emits the following
warning:
> 'struct cros_ec_device' declared inside parameter list
  will not be visible outside of this definition or declaration

Fix it by forward declaration.

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
 drivers/platform/chrome/cros_ec.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Guenter Roeck Oct. 5, 2023, 2:13 a.m. UTC | #1
On Tue, Oct 3, 2023 at 1:05 AM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
>
> When including cros_ec.h solely, the compiler emits the following
> warning:
> > 'struct cros_ec_device' declared inside parameter list
>   will not be visible outside of this definition or declaration
>
> Fix it by forward declaration.
>
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> ---
>  drivers/platform/chrome/cros_ec.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/platform/chrome/cros_ec.h b/drivers/platform/chrome/cros_ec.h
> index bbca0096868a..2b2574236030 100644
> --- a/drivers/platform/chrome/cros_ec.h
> +++ b/drivers/platform/chrome/cros_ec.h
> @@ -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
>
patchwork-bot+chrome-platform@kernel.org Oct. 5, 2023, 10:20 a.m. UTC | #2
Hello:

This patch was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Tue,  3 Oct 2023 08:04:53 +0000 you wrote:
> When including cros_ec.h solely, the compiler emits the following
> warning:
> > '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!
patchwork-bot+chrome-platform@kernel.org Oct. 11, 2023, 2:20 a.m. UTC | #3
Hello:

This patch was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:

On Tue,  3 Oct 2023 08:04:53 +0000 you wrote:
> When including cros_ec.h solely, the compiler emits the following
> warning:
> > '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!
diff mbox series

Patch

diff --git a/drivers/platform/chrome/cros_ec.h b/drivers/platform/chrome/cros_ec.h
index bbca0096868a..2b2574236030 100644
--- a/drivers/platform/chrome/cros_ec.h
+++ b/drivers/platform/chrome/cros_ec.h
@@ -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);