From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: Tom Rix <trix@redhat.com>
Cc: ogabbay@kernel.org, nathan@kernel.org, ndesaulniers@google.com,
kelbaz@habana.ai, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] habanalabs: change unused extern decl of hdev to forward decl of hl_device
Date: Mon, 13 Feb 2023 08:12:41 +0100 [thread overview]
Message-ID: <20230213071241.GA2799422@linux.intel.com> (raw)
In-Reply-To: <20230208155450.1941608-1-trix@redhat.com>
On Wed, Feb 08, 2023 at 07:54:50AM -0800, Tom Rix wrote:
> Building with clang W=2 has several similar warnings
> drivers/accel/habanalabs/common/decoder.c:46:51: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
> static void dec_error_intr_work(struct hl_device *hdev, u32 base_addr, u32 core_id)
> ^
> drivers/accel/habanalabs/common/security.h:13:26: note: previous declaration is here
> extern struct hl_device *hdev;
> ^
>
> There is no global definition of hdev, so the extern is not needed.
> Searched with
> grep -r '^struct' . | grep hl_dev
>
> Change to an forward decl to resolve these issues
> drivers/accel/habanalabs/common/mmu/../security.h:133:40: error: ‘struct hl_device’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
> 133 | bool (*skip_block_hook)(struct hl_device *hdev,
> | ^~~~~~~~~
>
> Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
> ---
> drivers/accel/habanalabs/common/security.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/accel/habanalabs/common/security.h b/drivers/accel/habanalabs/common/security.h
> index 234b4a6ed8bc..d7a3b3e82ea4 100644
> --- a/drivers/accel/habanalabs/common/security.h
> +++ b/drivers/accel/habanalabs/common/security.h
> @@ -10,7 +10,7 @@
>
> #include <linux/io-64-nonatomic-lo-hi.h>
>
> -extern struct hl_device *hdev;
> +struct hl_device;
>
> /* special blocks */
> #define HL_MAX_NUM_OF_GLBL_ERR_CAUSE 10
> --
> 2.26.3
>
WARNING: multiple messages have this Message-ID (diff)
From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: Tom Rix <trix@redhat.com>
Cc: ndesaulniers@google.com, ogabbay@kernel.org,
llvm@lists.linux.dev, kelbaz@habana.ai,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
nathan@kernel.org
Subject: Re: [PATCH] habanalabs: change unused extern decl of hdev to forward decl of hl_device
Date: Mon, 13 Feb 2023 08:12:41 +0100 [thread overview]
Message-ID: <20230213071241.GA2799422@linux.intel.com> (raw)
In-Reply-To: <20230208155450.1941608-1-trix@redhat.com>
On Wed, Feb 08, 2023 at 07:54:50AM -0800, Tom Rix wrote:
> Building with clang W=2 has several similar warnings
> drivers/accel/habanalabs/common/decoder.c:46:51: error: declaration shadows a variable in the global scope [-Werror,-Wshadow]
> static void dec_error_intr_work(struct hl_device *hdev, u32 base_addr, u32 core_id)
> ^
> drivers/accel/habanalabs/common/security.h:13:26: note: previous declaration is here
> extern struct hl_device *hdev;
> ^
>
> There is no global definition of hdev, so the extern is not needed.
> Searched with
> grep -r '^struct' . | grep hl_dev
>
> Change to an forward decl to resolve these issues
> drivers/accel/habanalabs/common/mmu/../security.h:133:40: error: ‘struct hl_device’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
> 133 | bool (*skip_block_hook)(struct hl_device *hdev,
> | ^~~~~~~~~
>
> Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
> ---
> drivers/accel/habanalabs/common/security.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/accel/habanalabs/common/security.h b/drivers/accel/habanalabs/common/security.h
> index 234b4a6ed8bc..d7a3b3e82ea4 100644
> --- a/drivers/accel/habanalabs/common/security.h
> +++ b/drivers/accel/habanalabs/common/security.h
> @@ -10,7 +10,7 @@
>
> #include <linux/io-64-nonatomic-lo-hi.h>
>
> -extern struct hl_device *hdev;
> +struct hl_device;
>
> /* special blocks */
> #define HL_MAX_NUM_OF_GLBL_ERR_CAUSE 10
> --
> 2.26.3
>
next prev parent reply other threads:[~2023-02-13 7:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-08 15:54 [PATCH] habanalabs: change unused extern decl of hdev to forward decl of hl_device Tom Rix
2023-02-08 15:54 ` Tom Rix
2023-02-13 7:12 ` Stanislaw Gruszka [this message]
2023-02-13 7:12 ` Stanislaw Gruszka
2023-02-16 14:40 ` Oded Gabbay
2023-02-16 14:40 ` Oded Gabbay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230213071241.GA2799422@linux.intel.com \
--to=stanislaw.gruszka@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kelbaz@habana.ai \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ogabbay@kernel.org \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.