[linux-next:master 4567/4951] drivers/misc/xilinx_tmr_inject.c:69:43: error: expected ')' before '(' token

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   edd1ec2e3a9f5de7fb267a3af73e4f00e7e052b7
commit: 2771559a553119011ed3231ea68a2919565a1de7 [4567/4951] fault-inject: improve build for CONFIG_FAULT_INJECTION=n
config: microblaze-allmodconfig (https://download.01.org/0day-ci/archive/20240816/202408160254.7w492KEu-lkp@xxxxxxxxx/config)
compiler: microblaze-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240816/202408160254.7w492KEu-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408160254.7w492KEu-lkp@xxxxxxxxx/

All error/warnings (new ones prefixed by >>):

>> drivers/misc/xilinx_tmr_inject.c:69:43: error: expected ')' before '(' token
      69 | DEFINE_DEBUGFS_ATTRIBUTE(xtmr_inject_fops, NULL, xtmr_inject_set, "%llu\n");
         |                                           ^
         |                                           )
   drivers/misc/xilinx_tmr_inject.c: In function 'xtmr_init_debugfs':
>> drivers/misc/xilinx_tmr_inject.c:75:22: error: implicit declaration of function 'debugfs_create_dir'; did you mean 'kernfs_create_dir'? [-Wimplicit-function-declaration]
      75 |         dbgfs_root = debugfs_create_dir("xtmr_inject", NULL);
         |                      ^~~~~~~~~~~~~~~~~~
         |                      kernfs_create_dir
>> drivers/misc/xilinx_tmr_inject.c:75:20: error: assignment to 'struct dentry *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
      75 |         dbgfs_root = debugfs_create_dir("xtmr_inject", NULL);
         |                    ^
>> drivers/misc/xilinx_tmr_inject.c:78:9: error: implicit declaration of function 'debugfs_create_file'; did you mean 'bus_create_file'? [-Wimplicit-function-declaration]
      78 |         debugfs_create_file("inject_fault", 0200, dir, NULL,
         |         ^~~~~~~~~~~~~~~~~~~
         |         bus_create_file
>> drivers/misc/xilinx_tmr_inject.c:79:30: error: 'xtmr_inject_fops' undeclared (first use in this function); did you mean 'xtmr_inject_set'?
      79 |                             &xtmr_inject_fops);
         |                              ^~~~~~~~~~~~~~~~
         |                              xtmr_inject_set
   drivers/misc/xilinx_tmr_inject.c:79:30: note: each undeclared identifier is reported only once for each function it appears in
   drivers/misc/xilinx_tmr_inject.c: In function 'xtmr_inject_remove':
>> drivers/misc/xilinx_tmr_inject.c:148:9: error: implicit declaration of function 'debugfs_remove_recursive' [-Wimplicit-function-declaration]
     148 |         debugfs_remove_recursive(dbgfs_root);
         |         ^~~~~~~~~~~~~~~~~~~~~~~~
   drivers/misc/xilinx_tmr_inject.c: At top level:
>> drivers/misc/xilinx_tmr_inject.c:61:12: warning: 'xtmr_inject_set' defined but not used [-Wunused-function]
      61 | static int xtmr_inject_set(void *data, u64 val)
         |            ^~~~~~~~~~~~~~~


vim +69 drivers/misc/xilinx_tmr_inject.c

895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   60  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  @61  static int xtmr_inject_set(void *data, u64 val)
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   62  {
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   63  	if (val != 1)
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   64  		return -EINVAL;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   65  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   66  	xmb_inject_err();
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   67  	return 0;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   68  }
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  @69  DEFINE_DEBUGFS_ATTRIBUTE(xtmr_inject_fops, NULL, xtmr_inject_set, "%llu\n");
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   70  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   71  static void xtmr_init_debugfs(struct xtmr_inject_dev *xtmr_inject)
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   72  {
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   73  	struct dentry *dir;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   74  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  @75  	dbgfs_root = debugfs_create_dir("xtmr_inject", NULL);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   76  	dir = fault_create_debugfs_attr("inject_fault", dbgfs_root,
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   77  					&inject_fault);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  @78  	debugfs_create_file("inject_fault", 0200, dir, NULL,
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  @79  			    &xtmr_inject_fops);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   80  }
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   81  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   82  static void xtmr_inject_init(struct xtmr_inject_dev *xtmr_inject)
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   83  {
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   84  	u32 cr_val;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   85  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   86  	if (inject_request)
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   87  		setup_fault_attr(&inject_fault, inject_request);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   88  	/* Allow fault injection */
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   89  	cr_val = xtmr_inject->magic |
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   90  		 (1 << XTMR_INJECT_CR_IE_SHIFT) |
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   91  		 (1 << XTMR_INJECT_CR_CPUID_SHIFT);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   92  	xtmr_inject_write(xtmr_inject, XTMR_INJECT_CR_OFFSET,
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   93  			  cr_val);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   94  	/* Initialize the address inject and instruction inject registers */
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   95  	xtmr_inject_write(xtmr_inject, XTMR_INJECT_AIR_OFFSET,
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   96  			  XMB_INJECT_ERR_OFFSET);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   97  	xtmr_inject_write(xtmr_inject, XTMR_INJECT_IIR_OFFSET,
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   98  			  XMB_INJECT_ERR_OFFSET & XTMR_INJECT_IIR_ADDR_MASK);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25   99  }
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  100  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  101  /**
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  102   * xtmr_inject_probe - Driver probe function
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  103   * @pdev: Pointer to the platform_device structure
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  104   *
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  105   * This is the driver probe routine. It does all the memory
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  106   * allocation for the device.
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  107   *
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  108   * Return: 0 on success and failure value on error
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  109   */
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  110  static int xtmr_inject_probe(struct platform_device *pdev)
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  111  {
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  112  	struct xtmr_inject_dev *xtmr_inject;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  113  	int err;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  114  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  115  	xtmr_inject = devm_kzalloc(&pdev->dev, sizeof(*xtmr_inject),
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  116  				   GFP_KERNEL);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  117  	if (!xtmr_inject)
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  118  		return -ENOMEM;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  119  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  120  	xtmr_inject->regs = devm_platform_ioremap_resource(pdev, 0);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  121  	if (IS_ERR(xtmr_inject->regs))
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  122  		return PTR_ERR(xtmr_inject->regs);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  123  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  124  	err = of_property_read_u32(pdev->dev.of_node, "xlnx,magic",
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  125  				   &xtmr_inject->magic);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  126  	if (err < 0) {
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  127  		dev_err(&pdev->dev, "unable to read xlnx,magic property");
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  128  		return err;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  129  	}
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  130  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  131  	if (xtmr_inject->magic > XTMR_INJECT_MAGIC_MAX_VAL) {
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  132  		dev_err(&pdev->dev, "invalid xlnx,magic property value");
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  133  		return -EINVAL;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  134  	}
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  135  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  136  	/* Initialize TMR Inject */
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  137  	xtmr_inject_init(xtmr_inject);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  138  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  139  	xtmr_init_debugfs(xtmr_inject);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  140  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  141  	platform_set_drvdata(pdev, xtmr_inject);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  142  
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  143  	return 0;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  144  }
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  145  
37efe116bea197 Uwe Kleine-König             2024-02-21  146  static void xtmr_inject_remove(struct platform_device *pdev)
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  147  {
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25 @148  	debugfs_remove_recursive(dbgfs_root);
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  149  	dbgfs_root = NULL;
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  150  }
895ae5bee159d1 Appana Durga Kedareswara rao 2022-11-25  151  

:::::: The code at line 69 was first introduced by commit
:::::: 895ae5bee159d148bac21a82899292c408c1aab1 drivers: misc: Add Support for TMR Inject IP

:::::: TO: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@xxxxxxx>
:::::: CC: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux