Skip to contentSkip to conversation

habanalabs: fix up absolute include instructions

PATCH In review Greg Kroah-Hartman 3 participants 6 messages Jul 28, 2020 – Jul 29, 2020 Char and misc drivers

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 habanalabs: fix up absolute include instructions

There's no need to try to be cute with the include file locations in the Makefile, so just specify exactly where the files are.

Bonus is this fixes the problem of building with O= as well as trying to just build the subdirectory alone.

Cc Oded Gabbay <[email protected]>
Cc Omer Shpigelman <[email protected]>
Cc Tomer Tayar <[email protected]>
Cc Moti Haimovski <[email protected]>
Cc Ofir Bitton <[email protected]>
Cc Ben Segal <[email protected]>
Cc Christine Gharzuzi <[email protected]>
Cc Pawel Piskorski <[email protected]>
---
 drivers/misc/habanalabs/common/Makefile         |  2 --
 drivers/misc/habanalabs/common/debugfs.c        |  2 +-
 drivers/misc/habanalabs/common/firmware_if.c    |  2 +-
 drivers/misc/habanalabs/common/habanalabs.h     |  4 ++--
 drivers/misc/habanalabs/common/memory.c         |  2 +-
 drivers/misc/habanalabs/common/mmu.c            |  2 +-
 drivers/misc/habanalabs/common/pci.c            |  2 +-
 drivers/misc/habanalabs/gaudi/Makefile          |  2 --
 drivers/misc/habanalabs/gaudi/gaudi.c           | 12 ++++++------
 drivers/misc/habanalabs/gaudi/gaudiP.h          | 10 +++++-----
 drivers/misc/habanalabs/gaudi/gaudi_coresight.c |  6 +++---
 drivers/misc/habanalabs/gaudi/gaudi_hwmgr.c     |  2 +-
 drivers/misc/habanalabs/gaudi/gaudi_security.c  |  2 +-
 drivers/misc/habanalabs/goya/Makefile           |  2 --
 drivers/misc/habanalabs/goya/goya.c             |  8 ++++----
 drivers/misc/habanalabs/goya/goyaP.h            | 12 ++++++------
 drivers/misc/habanalabs/goya/goya_coresight.c   |  6 +++---
 drivers/misc/habanalabs/goya/goya_security.c    |  2 +-
 18 files changed, 37 insertions(+), 43 deletions(-)
drivers/misc/habanalabs/common/Makefile +0 -2
index 97d03b5c8683..b984bfa4face 100644
@@ -1,6 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-subdir-ccflags-y += -I$(src)/common
-
 HL_COMMON_FILES := common/habanalabs_drv.o common/device.o common/context.o \
 		common/asid.o common/habanalabs_ioctl.o \
 		common/command_buffer.o common/hw_queue.o common/irq.o \
drivers/misc/habanalabs/common/debugfs.c +1 -1
index 0bc036e01ee8..c50c6fc9e905 100644
@@ -6,7 +6,7 @@
  */
 
 #include "habanalabs.h"
-#include "include/hw_ip/mmu/mmu_general.h"
+#include "../include/hw_ip/mmu/mmu_general.h"
 
 #include <linux/pci.h>
 #include <linux/debugfs.h>
drivers/misc/habanalabs/common/firmware_if.c +1 -1
index 5981dbd8c6df..f70302cdab1b 100644
@@ -6,7 +6,7 @@
  */
 
 #include "habanalabs.h"
-#include "include/common/hl_boot_if.h"
+#include "../include/common/hl_boot_if.h"
 
 #include <linux/firmware.h>
 #include <linux/genalloc.h>
drivers/misc/habanalabs/common/habanalabs.h +2 -2
index eb42aa5476a9..018d9d67e8e6 100644
@@ -8,8 +8,8 @@
 #ifndef HABANALABSP_H_
 #define HABANALABSP_H_
 
-#include "include/common/armcp_if.h"
-#include "include/common/qman_if.h"
+#include "../include/common/armcp_if.h"
+#include "../include/common/qman_if.h"
 #include <uapi/misc/habanalabs.h>
 
 #include <linux/cdev.h>
drivers/misc/habanalabs/common/memory.c +1 -1
index e4e1693e5c6c..dce9273e557a 100644
@@ -7,7 +7,7 @@
 
 #include <uapi/misc/habanalabs.h>
 #include "habanalabs.h"
-#include "include/hw_ip/mmu/mmu_general.h"
+#include "../include/hw_ip/mmu/mmu_general.h"
 
 #include <linux/uaccess.h>
 #include <linux/slab.h>
drivers/misc/habanalabs/common/mmu.c +1 -1
index 04303950e630..edcc11d5eaf1 100644
@@ -6,7 +6,7 @@
  */
 
 #include "habanalabs.h"
-#include "include/hw_ip/mmu/mmu_general.h"
+#include "../include/hw_ip/mmu/mmu_general.h"
 
 #include <linux/genalloc.h>
 #include <linux/slab.h>
drivers/misc/habanalabs/common/pci.c +1 -1
index 1791f6623c69..7bd3737571f3 100644
@@ -6,7 +6,7 @@
  */
 
 #include "habanalabs.h"
-#include "include/hw_ip/pci/pci_general.h"
+#include "../include/hw_ip/pci/pci_general.h"
 
 #include <linux/pci.h>
 #include <linux/bitfield.h>
drivers/misc/habanalabs/gaudi/Makefile +0 -2
index 75104ae74e2b..c9f4703cff24 100644
@@ -1,5 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
-subdir-ccflags-y += -I$(src)/common
-
 HL_GAUDI_FILES := gaudi/gaudi.o gaudi/gaudi_hwmgr.o gaudi/gaudi_security.o \
 	gaudi/gaudi_coresight.o
drivers/misc/habanalabs/gaudi/gaudi.c +6 -6
index 78fbff646f99..d4b3b995f69d 100644
@@ -6,12 +6,12 @@
  */
 
 #include "gaudiP.h"
-#include "include/hw_ip/mmu/mmu_general.h"
-#include "include/hw_ip/mmu/mmu_v1_1.h"
-#include "include/gaudi/gaudi_masks.h"
-#include "include/gaudi/gaudi_fw_if.h"
-#include "include/gaudi/gaudi_reg_map.h"
-#include "include/gaudi/gaudi_async_ids_map_extended.h"
+#include "../include/hw_ip/mmu/mmu_general.h"
+#include "../include/hw_ip/mmu/mmu_v1_1.h"
+#include "../include/gaudi/gaudi_masks.h"
+#include "../include/gaudi/gaudi_fw_if.h"
+#include "../include/gaudi/gaudi_reg_map.h"
+#include "../include/gaudi/gaudi_async_ids_map_extended.h"
 
 #include <linux/module.h>
 #include <linux/pci.h>
drivers/misc/habanalabs/gaudi/gaudiP.h +5 -5
index a94ab6a180f0..5dc99f6f0296 100644
@@ -9,11 +9,11 @@
 #define GAUDIP_H_
 
 #include <uapi/misc/habanalabs.h>
-#include "habanalabs.h"
-#include "include/common/hl_boot_if.h"
-#include "include/gaudi/gaudi_packets.h"
-#include "include/gaudi/gaudi.h"
-#include "include/gaudi/gaudi_async_events.h"
+#include "../common/habanalabs.h"
+#include "../include/common/hl_boot_if.h"
+#include "../include/gaudi/gaudi_packets.h"
+#include "../include/gaudi/gaudi.h"
+#include "../include/gaudi/gaudi_async_events.h"
 
 #define NUMBER_OF_EXT_HW_QUEUES		12
 #define NUMBER_OF_CMPLT_QUEUES		NUMBER_OF_EXT_HW_QUEUES
drivers/misc/habanalabs/gaudi/gaudi_coresight.c +3 -3
index c32322cb1728..5673ee49819e 100644
@@ -6,9 +6,9 @@
  */
 
 #include "gaudiP.h"
-#include "include/gaudi/gaudi_coresight.h"
-#include "include/gaudi/asic_reg/gaudi_regs.h"
-#include "include/gaudi/gaudi_masks.h"
+#include "../include/gaudi/gaudi_coresight.h"
+#include "../include/gaudi/asic_reg/gaudi_regs.h"
+#include "../include/gaudi/gaudi_masks.h"
 
 #include <uapi/misc/habanalabs.h>
 #include <linux/coresight.h>
drivers/misc/habanalabs/gaudi/gaudi_hwmgr.c +1 -1
index 6dd2c2a1cd70..1076b4932ce2 100644
@@ -6,7 +6,7 @@
  */
 
 #include "gaudiP.h"
-#include "include/gaudi/gaudi_fw_if.h"
+#include "../include/gaudi/gaudi_fw_if.h"
 
 void gaudi_set_pll_profile(struct hl_device *hdev, enum hl_pll_frequency freq)
 {
drivers/misc/habanalabs/gaudi/gaudi_security.c +1 -1
index abdd5ed8f2cf..8d5d6ddee6ed 100644
@@ -6,7 +6,7 @@
  */
 
 #include "gaudiP.h"
-#include "include/gaudi/asic_reg/gaudi_regs.h"
+#include "../include/gaudi/asic_reg/gaudi_regs.h"
 
 #define GAUDI_NUMBER_OF_RR_REGS		24
 #define GAUDI_NUMBER_OF_LBW_RANGES	12
drivers/misc/habanalabs/goya/Makefile +0 -2
index bd769083628e..b3f3b7b96683 100644
@@ -1,5 +1,3 @@
 # SPDX-License-Identifier: GPL-2.0-only
-subdir-ccflags-y += -I$(src)
-
 HL_GOYA_FILES :=  goya/goya.o goya/goya_security.o goya/goya_hwmgr.o \
 	goya/goya_coresight.o
drivers/misc/habanalabs/goya/goya.c +4 -4
index a4dfea7556da..dedcd2211fb7 100644
@@ -6,10 +6,10 @@
  */
 
 #include "goyaP.h"
-#include "include/hw_ip/mmu/mmu_general.h"
-#include "include/hw_ip/mmu/mmu_v1_0.h"
-#include "include/goya/asic_reg/goya_masks.h"
-#include "include/goya/goya_reg_map.h"
+#include "../include/hw_ip/mmu/mmu_general.h"
+#include "../include/hw_ip/mmu/mmu_v1_0.h"
+#include "../include/goya/asic_reg/goya_masks.h"
+#include "../include/goya/goya_reg_map.h"
 
 #include <linux/pci.h>
 #include <linux/genalloc.h>
drivers/misc/habanalabs/goya/goyaP.h +6 -6
index 9e674cf39fd9..bb7474ee9784 100644
@@ -9,12 +9,12 @@
 #define GOYAP_H_
 
 #include <uapi/misc/habanalabs.h>
-#include "habanalabs.h"
-#include "include/common/hl_boot_if.h"
-#include "include/goya/goya_packets.h"
-#include "include/goya/goya.h"
-#include "include/goya/goya_async_events.h"
-#include "include/goya/goya_fw_if.h"
+#include "../common/habanalabs.h"
+#include "../include/common/hl_boot_if.h"
+#include "../include/goya/goya_packets.h"
+#include "../include/goya/goya.h"
+#include "../include/goya/goya_async_events.h"
+#include "../include/goya/goya_fw_if.h"
 
 #define NUMBER_OF_CMPLT_QUEUES		5
 #define NUMBER_OF_EXT_HW_QUEUES		5
drivers/misc/habanalabs/goya/goya_coresight.c +3 -3
index 18e12e9d284b..b03912483de0 100644
@@ -6,9 +6,9 @@
  */
 
 #include "goyaP.h"
-#include "include/goya/goya_coresight.h"
-#include "include/goya/asic_reg/goya_regs.h"
-#include "include/goya/asic_reg/goya_masks.h"
+#include "../include/goya/goya_coresight.h"
+#include "../include/goya/asic_reg/goya_regs.h"
+#include "../include/goya/asic_reg/goya_masks.h"
 
 #include <uapi/misc/habanalabs.h>
 
drivers/misc/habanalabs/goya/goya_security.c +1 -1
index de8297001fea..14701836f92b 100644
@@ -6,7 +6,7 @@
  */
 
 #include "goyaP.h"
-#include "include/goya/asic_reg/goya_regs.h"
+#include "../include/goya/asic_reg/goya_regs.h"
 
 /*
  * goya_set_block_as_protected - set the given block as protected
Signature · 1 line
2.27.0
#1 lore raw

Hi Greg,

drivers/misc/habanalabs/common/Makefile line 2

Quoted 8 lines · On Tue, 28 Jul 2020 19:18:51 +0200 Greg Kroah-Hartman…
drivers/misc/habanalabs/common/Makefile +0 -1
index 97d03b5c8683..b984bfa4face 100644
@@ -1,6 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-subdir-ccflags-y += -I$(src)/common

I've seen oter places use

subdir-ccflags-y += -I$(srcdir)/$(src)/common

which would probably work as well. i.e. just change this in the Makefiles rather than every source file.

Signature · 2 lines
Cheers,
Stephen Rothwell
author maintainer
#2 lore raw
Quoted 14 lines · Stephen Rothwell

Hi Greg,

drivers/misc/habanalabs/common/Makefile line 2

Quoted 8 lines · On Tue, 28 Jul 2020 19:18:51 +0200 Greg Kroah-Hartman…
drivers/misc/habanalabs/common/Makefile +0 -1
index 97d03b5c8683..b984bfa4face 100644
@@ -1,6 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-subdir-ccflags-y += -I$(src)/common

I've seen oter places use

Quoted 4 lines

subdir-ccflags-y += -I$(srcdir)/$(src)/common

which would probably work as well. i.e. just change this in the Makefiles rather than every source file.

I hate seeing odd ccflags stuff in Makefiles as it can catch you "by surprise" as to what exactly is happening when looking at .c code.

But yes, your change would also work.

thanks,

greg k-h

#3 lore raw
In reply to Greg Kroah-Hartman
I love your patch! Perhaps something to improve:

Hi Greg,

I love your patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing] [cannot apply to linux/master linus/master v5.8-rc7 next-20200728] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Greg-Kroah-Hartman/habanalabs-fix-up-absolute-include-instructions/20200729-012043
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 65a9bde6ed484880987a6d88de6e372eca52059f
config: x86_64-randconfig-m001-20200728 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate

All warnings (new ones prefixed by >>):

>> drivers/misc/habanalabs/goya/goya.c:5228:5: warning: no previous prototype for 'goya_ctx_init' [-Wmissing-prototypes]
    5228 | int goya_ctx_init(struct hl_ctx *ctx)
         |     ^~~~~~~~~~~~~
--
>> drivers/misc/habanalabs/gaudi/gaudi.c:6275:5: warning: no previous prototype for 'gaudi_ctx_init' [-Wmissing-prototypes]

6275 | int gaudi_ctx_init(struct hl_ctx *ctx)
| ^~~~~~~~~~~~~~

vim +/goya_ctx_init +5228 drivers/misc/habanalabs/goya/goya.c

f8c8c7d5f1b0ea Oded Gabbay 2019-02-16 5227

a04b7cd97eef13 Ofir Bitton 2020-07-13 @5228  int goya_ctx_init(struct hl_ctx *ctx)
a04b7cd97eef13 Ofir Bitton 2020-07-13  5229  {
a04b7cd97eef13 Ofir Bitton 2020-07-13  5230  	return 0;
a04b7cd97eef13 Ofir Bitton 2020-07-13  5231  }

a04b7cd97eef13 Ofir Bitton 2020-07-13 5232

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#4 lore raw
In reply to Greg Kroah-Hartman
I love your patch! Perhaps something to improve:

Hi Greg,

I love your patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing] [cannot apply to linux/master linus/master v5.8-rc7 next-20200728] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Greg-Kroah-Hartman/habanalabs-fix-up-absolute-include-instructions/20200729-012043
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git 65a9bde6ed484880987a6d88de6e372eca52059f
config: i386-randconfig-s001-20200728 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-94-geb6779f6-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

If you fix the issue, kindly add following tag as appropriate

sparse warnings: (new ones prefixed by >>)

drivers/misc/habanalabs/goya/goya.c:2778:17: sparse: sparse: cast removes address space '__iomem' of expression

>> drivers/misc/habanalabs/goya/goya.c:5228:5: sparse: sparse: symbol 'goya_ctx_init' was not declared. Should it be static?

drivers/misc/habanalabs/goya/goya.c:885:23: sparse: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000) drivers/misc/habanalabs/goya/goya.c:887:22: sparse: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000) drivers/misc/habanalabs/goya/goya.c:891:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/goya/goya.c:934:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/goya/goya.c:1143:9: sparse: sparse: cast truncates bits from constant value (8000000000 becomes 0) drivers/misc/habanalabs/goya/goya.c:1618:23: sparse: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000) drivers/misc/habanalabs/goya/goya.c:1620:22: sparse: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000) drivers/misc/habanalabs/goya/goya.c:1624:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/goya/goya.c:1667:23: sparse: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000) drivers/misc/habanalabs/goya/goya.c:1669:22: sparse: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000) drivers/misc/habanalabs/goya/goya.c:1673:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/goya/goya.c:1705:22: sparse: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000) drivers/misc/habanalabs/goya/goya.c:1725:23: sparse: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000) drivers/misc/habanalabs/goya/goya.c:1727:22: sparse: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000) drivers/misc/habanalabs/goya/goya.c:1731:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/goya/goya.c:1774:23: sparse: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000) drivers/misc/habanalabs/goya/goya.c:1776:22: sparse: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000) drivers/misc/habanalabs/goya/goya.c:1780:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/goya/goya.c:1815:22: sparse: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000) drivers/misc/habanalabs/goya/goya.c:2339:27: sparse: sparse: cast truncates bits from constant value (7ff0000000 becomes f0000000) drivers/misc/habanalabs/goya/goya.c:3422:26: sparse: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000) drivers/misc/habanalabs/goya/goya.c:3423:24: sparse: sparse: cast truncates bits from constant value (7ffc112ffc becomes fc112ffc)
--

>> drivers/misc/habanalabs/gaudi/gaudi.c:6275:5: sparse: sparse: symbol 'gaudi_ctx_init' was not declared. Should it be static?

drivers/misc/habanalabs/gaudi/gaudi.c:1807:26: sparse: sparse: cast truncates bits from constant value (7ffc4f4000 becomes fc4f4000) drivers/misc/habanalabs/gaudi/gaudi.c:1811:25: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000) drivers/misc/habanalabs/gaudi/gaudi.c:1815:26: sparse: sparse: cast truncates bits from constant value (7ffc494000 becomes fc494000) drivers/misc/habanalabs/gaudi/gaudi.c:1819:25: sparse: sparse: cast truncates bits from constant value (7ffc492000 becomes fc492000) drivers/misc/habanalabs/gaudi/gaudi.c:1858:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/gaudi/gaudi.c:1896:9: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/gaudi/gaudi.c:1969:23: sparse: sparse: cast truncates bits from constant value (7ffc4f4000 becomes fc4f4000) drivers/misc/habanalabs/gaudi/gaudi.c:1973:22: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000) drivers/misc/habanalabs/gaudi/gaudi.c:2006:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/gaudi/gaudi.c:2079:23: sparse: sparse: cast truncates bits from constant value (7ffc4f4000 becomes fc4f4000) drivers/misc/habanalabs/gaudi/gaudi.c:2083:22: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000) drivers/misc/habanalabs/gaudi/gaudi.c:2118:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/gaudi/gaudi.c:2193:23: sparse: sparse: cast truncates bits from constant value (7ffc4f4000 becomes fc4f4000) drivers/misc/habanalabs/gaudi/gaudi.c:2197:22: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000) drivers/misc/habanalabs/gaudi/gaudi.c:2233:17: sparse: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040) drivers/misc/habanalabs/gaudi/gaudi.c:2730:27: sparse: sparse: cast truncates bits from constant value (7ff0000000 becomes f0000000) drivers/misc/habanalabs/gaudi/gaudi.c:6204:9: sparse: sparse: cast truncates bits from constant value (7ffc4f2000 becomes fc4f2000)

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#5 lore raw

[RFC PATCH] habanalabs: goya_ctx_init() can be static

In reply to Greg Kroah-Hartman
Signed-off-by: kernel test robot <[email protected]>
---
 gaudi/gaudi.c |    2 +-
 goya/goya.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/misc/habanalabs/gaudi/gaudi.c +1 -1
index d4b3b995f69d8..00a0a7238d814 100644
@@ -6272,7 +6272,7 @@ static enum hl_device_hw_state gaudi_get_hw_state(struct hl_device *hdev)
 	return RREG32(mmHW_STATE);
 }
 
-int gaudi_ctx_init(struct hl_ctx *ctx)
+static int gaudi_ctx_init(struct hl_ctx *ctx)
 {
 	return 0;
 }
drivers/misc/habanalabs/goya/goya.c +1 -1
index dedcd2211fb73..85030759b2afe 100644
@@ -5225,7 +5225,7 @@ static enum hl_device_hw_state goya_get_hw_state(struct hl_device *hdev)
 	return RREG32(mmHW_STATE);
 }
 
-int goya_ctx_init(struct hl_ctx *ctx)
+static int goya_ctx_init(struct hl_ctx *ctx)
 {
 	return 0;
 }