All of lore.kernel.org
 help / color / mirror / Atom feed
* [litex-hub:litex-rebase 7/15] drivers/i2c/busses/i2c-litex.c:119:9: error: implicit declaration of function 'strncpy'
@ 2026-06-23 10:25 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-06-23 10:25 UTC (permalink / raw)
  To: Robert Winkler; +Cc: oe-kbuild-all, Gabriel Somlo, Geert Uytterhoeven

tree:   https://github.com/litex-hub/linux litex-rebase
head:   c13bee0670f8bcfe9e289c42a42a551462e8c5df
commit: 0feffc97be8ca96055d732a53f8946c9eccb3527 [7/15] LiteX: driver for I2CMaster
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20260623/202606231855.ipMEmMUU-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 16.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260623/202606231855.ipMEmMUU-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606231855.ipMEmMUU-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/i2c/busses/i2c-litex.c: In function 'litex_i2c_probe':
>> drivers/i2c/busses/i2c-litex.c:119:9: error: implicit declaration of function 'strncpy' [-Wimplicit-function-declaration]
     119 |         strncpy(i2c_s->adapter.name, "litex_i2c_adapter",
         |         ^~~~~~~
   drivers/i2c/busses/i2c-litex.c:26:1: note: 'strncpy' is defined in header '<string.h>'; this is probably fixable by adding '#include <string.h>'
      25 | #include <linux/litex.h>
     +++ |+#include <string.h>
      26 | 


vim +/strncpy +119 drivers/i2c/busses/i2c-litex.c

    93	
    94	static int litex_i2c_probe(struct platform_device *pdev)
    95	{
    96		struct device_node *node = pdev->dev.of_node;
    97		void __iomem *membase;
    98		struct litex_i2c *i2c_s;
    99		struct resource *res;
   100	
   101		if (!node)
   102			return -ENODEV;
   103	
   104		i2c_s = devm_kzalloc(&pdev->dev, sizeof(*i2c_s), GFP_KERNEL);
   105		if (!i2c_s)
   106			return -ENOMEM;
   107	
   108		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   109		if (!res)
   110			return -EBUSY;
   111	
   112		membase = devm_of_iomap(&pdev->dev, node, 0, &res->end);
   113		if (IS_ERR_OR_NULL(membase))
   114			return -EIO;
   115	
   116		i2c_s->reg_w = membase + OFFSET_REG_W;
   117		i2c_s->reg_r = membase + OFFSET_REG_R;
   118	
 > 119		strncpy(i2c_s->adapter.name, "litex_i2c_adapter",
   120			sizeof(i2c_s->adapter.name));
   121		i2c_s->adapter.owner        = THIS_MODULE;
   122		i2c_s->adapter.algo_data    = &i2c_s->algo_data;
   123		i2c_s->adapter.dev.parent   = &pdev->dev;
   124		i2c_s->adapter.dev.of_node  = node;
   125		i2c_s->algo_data.data       = i2c_s;
   126	
   127		i2c_s->algo_data.setsda  = litex_i2c_setsda;
   128		i2c_s->algo_data.setscl  = litex_i2c_setscl;
   129		i2c_s->algo_data.getsda  = litex_i2c_getsda;
   130		i2c_s->algo_data.getscl  = NULL;
   131		i2c_s->algo_data.udelay  = DRIVER_ALGO_BIT_UDELAY;
   132		i2c_s->algo_data.timeout = HZ;
   133	
   134		platform_set_drvdata(pdev, i2c_s);
   135		return i2c_bit_add_bus(&i2c_s->adapter);
   136	}
   137	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-23 10:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-23 10:25 [litex-hub:litex-rebase 7/15] drivers/i2c/busses/i2c-litex.c:119:9: error: implicit declaration of function 'strncpy' kernel test robot

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.