diff mbox series

drivers: staging: media: atomisp: pci: css_2401_system: host: csi_rx.c: fixed a sparse warning by making undeclared symbols static

Message ID 20200714132350.naekk4zqivpuaedi@pesu-pes-edu (mailing list archive)
State New, archived
Headers show
Series drivers: staging: media: atomisp: pci: css_2401_system: host: csi_rx.c: fixed a sparse warning by making undeclared symbols static | expand

Commit Message

B K Karthik July 14, 2020, 1:23 p.m. UTC
changed symbols N_SHORT_PACKET_LUT_ENTRIES, N_LONG_PACKET_ENTRIES,
N_CSI_RX_FE_CTRL_DLANES, N_CSI_RX_BE_SID_WIDTH to static because they
were not declared earlier.

Signed-off-by: B K Karthik <karthik.bk2000@live.com>
---
 .../media/atomisp/pci/css_2401_system/host/csi_rx.c       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Greg KH July 14, 2020, 1:51 p.m. UTC | #1
On Tue, Jul 14, 2020 at 09:23:50AM -0400, B K Karthik wrote:
> changed symbols N_SHORT_PACKET_LUT_ENTRIES, N_LONG_PACKET_ENTRIES,
> N_CSI_RX_FE_CTRL_DLANES, N_CSI_RX_BE_SID_WIDTH to static because they
> were not declared earlier.

Your subject line is a little bit crazy long.  Perhaps just:
	staging: media: atomisp: mark some csi_rx.c symbols static
?

thanks,

greg k-h
kernel test robot July 14, 2020, 4:22 p.m. UTC | #2
Hi K,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]

url:    https://github.com/0day-ci/linux/commits/B-K-Karthik/drivers-staging-media-atomisp-pci-css_2401_system-host-csi_rx-c-fixed-a-sparse-warning-by-making-undeclared-symbols-static/20200714-212512
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git caaba08f8c0dbe5c8fcb497faa7e3b394c21ff39
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c:18:18: warning: unused variable 'N_SHORT_PACKET_LUT_ENTRIES' [-Wunused-const-variable]
   static const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
                    ^
>> drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c:24:18: warning: unused variable 'N_LONG_PACKET_LUT_ENTRIES' [-Wunused-const-variable]
   static const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
                    ^
>> drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c:30:18: warning: unused variable 'N_CSI_RX_FE_CTRL_DLANES' [-Wunused-const-variable]
   static const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = {
                    ^
>> drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c:37:18: warning: unused variable 'N_CSI_RX_BE_SID_WIDTH' [-Wunused-const-variable]
   static const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = {
                    ^
   4 warnings generated.

vim +/N_SHORT_PACKET_LUT_ENTRIES +18 drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c

    17	
  > 18	static const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
    19		4,	/* 4 entries at CSI_RX_BACKEND0_ID*/
    20		4,	/* 4 entries at CSI_RX_BACKEND1_ID*/
    21		4	/* 4 entries at CSI_RX_BACKEND2_ID*/
    22	};
    23	
  > 24	static const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
    25		8,	/* 8 entries at CSI_RX_BACKEND0_ID*/
    26		4,	/* 4 entries at CSI_RX_BACKEND1_ID*/
    27		4	/* 4 entries at CSI_RX_BACKEND2_ID*/
    28	};
    29	
  > 30	static const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = {
    31		N_CSI_RX_DLANE_ID,	/* 4 dlanes for CSI_RX_FR0NTEND0_ID */
    32		N_CSI_RX_DLANE_ID,	/* 4 dlanes for CSI_RX_FR0NTEND1_ID */
    33		N_CSI_RX_DLANE_ID	/* 4 dlanes for CSI_RX_FR0NTEND2_ID */
    34	};
    35	
    36	/* sid_width for CSI_RX_BACKEND<N>_ID */
  > 37	static const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = {

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Mauro Carvalho Chehab July 19, 2020, 6:10 a.m. UTC | #3
Em Tue, 14 Jul 2020 09:23:50 -0400
B K Karthik <bkkarthik@pesu.pes.edu> escreveu:

> changed symbols N_SHORT_PACKET_LUT_ENTRIES, N_LONG_PACKET_ENTRIES,
> N_CSI_RX_FE_CTRL_DLANES, N_CSI_RX_BE_SID_WIDTH to static because they
> were not declared earlier.

This patch is broken:

ERROR: modpost: "N_CSI_RX_FE_CTRL_DLANES" [drivers/staging/media/atomisp/atomisp.ko] undefined!
ERROR: modpost: "N_LONG_PACKET_LUT_ENTRIES" [drivers/staging/media/atomisp/atomisp.ko] undefined!
ERROR: modpost: "N_SHORT_PACKET_LUT_ENTRIES" [drivers/staging/media/atomisp/atomisp.ko] undefined!

Please test your patches before submitting them.

I suspect that the header declaring them weren't included at csi_rx.c.

Regards,
Mauro

> 
> Signed-off-by: B K Karthik <karthik.bk2000@live.com>
> ---
>  .../media/atomisp/pci/css_2401_system/host/csi_rx.c       | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c b/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c
> index 8e661091f7d9..4d2076db1240 100644
> --- a/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c
> +++ b/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c
> @@ -15,26 +15,26 @@
>  
>  #include "system_global.h"
>  
> -const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
> +static const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
>  	4,	/* 4 entries at CSI_RX_BACKEND0_ID*/
>  	4,	/* 4 entries at CSI_RX_BACKEND1_ID*/
>  	4	/* 4 entries at CSI_RX_BACKEND2_ID*/
>  };
>  
> -const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
> +static const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
>  	8,	/* 8 entries at CSI_RX_BACKEND0_ID*/
>  	4,	/* 4 entries at CSI_RX_BACKEND1_ID*/
>  	4	/* 4 entries at CSI_RX_BACKEND2_ID*/
>  };
>  
> -const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = {
> +static const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = {
>  	N_CSI_RX_DLANE_ID,	/* 4 dlanes for CSI_RX_FR0NTEND0_ID */
>  	N_CSI_RX_DLANE_ID,	/* 4 dlanes for CSI_RX_FR0NTEND1_ID */
>  	N_CSI_RX_DLANE_ID	/* 4 dlanes for CSI_RX_FR0NTEND2_ID */
>  };
>  
>  /* sid_width for CSI_RX_BACKEND<N>_ID */
> -const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = {
> +static const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = {
>  	3,
>  	2,
>  	2



Thanks,
Mauro
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c b/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c
index 8e661091f7d9..4d2076db1240 100644
--- a/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c
+++ b/drivers/staging/media/atomisp/pci/css_2401_system/host/csi_rx.c
@@ -15,26 +15,26 @@ 
 
 #include "system_global.h"
 
-const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
+static const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
 	4,	/* 4 entries at CSI_RX_BACKEND0_ID*/
 	4,	/* 4 entries at CSI_RX_BACKEND1_ID*/
 	4	/* 4 entries at CSI_RX_BACKEND2_ID*/
 };
 
-const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
+static const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID] = {
 	8,	/* 8 entries at CSI_RX_BACKEND0_ID*/
 	4,	/* 4 entries at CSI_RX_BACKEND1_ID*/
 	4	/* 4 entries at CSI_RX_BACKEND2_ID*/
 };
 
-const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = {
+static const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID] = {
 	N_CSI_RX_DLANE_ID,	/* 4 dlanes for CSI_RX_FR0NTEND0_ID */
 	N_CSI_RX_DLANE_ID,	/* 4 dlanes for CSI_RX_FR0NTEND1_ID */
 	N_CSI_RX_DLANE_ID	/* 4 dlanes for CSI_RX_FR0NTEND2_ID */
 };
 
 /* sid_width for CSI_RX_BACKEND<N>_ID */
-const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = {
+static const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID] = {
 	3,
 	2,
 	2