[PATCH 03/10] staging: kpc2000: remove fileops.c file.

kbuild test robot lkp at intel.com
Fri May 17 18:17:45 UTC 2019


Hi Greg,

I love your patch! Perhaps something to improve:

[auto build test WARNING on staging/staging-testing]
[cannot apply to v5.1 next-20190517]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Greg-Kroah-Hartman/staging-kpc2000-fix-a-bunch-of-orginization-and-header-file-issues/20190517-213909
config: mips-allmodconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/pci.h:31:0,
                    from drivers/staging/kpc2000/kpc2000/core.c:4:
   drivers/staging/kpc2000/kpc2000/core.c: In function 'read_system_regs':
   drivers/staging/kpc2000/kpc2000/core.c:149:36: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'long long int' [-Wformat=]
            dev_err(&pcard->pdev->dev, "Invalid magic!  Got: 0x%016llx  Want: 0x%016lx\n", read_val, KP2000_MAGIC_VALUE);
                                       ^
   include/linux/device.h:1400:22: note: in definition of macro 'dev_fmt'
    #define dev_fmt(fmt) fmt
                         ^~~
   drivers/staging/kpc2000/kpc2000/core.c:149:9: note: in expansion of macro 'dev_err'
            dev_err(&pcard->pdev->dev, "Invalid magic!  Got: 0x%016llx  Want: 0x%016lx\n", read_val, KP2000_MAGIC_VALUE);
            ^~~~~~~
   drivers/staging/kpc2000/kpc2000/core.c: In function 'kp2000_cdev_read':
>> drivers/staging/kpc2000/kpc2000/core.c:258:1: warning: the frame size of 1064 bytes is larger than 1024 bytes [-Wframe-larger-than=]
    }
    ^

vim +258 drivers/staging/kpc2000/kpc2000/core.c

   142	
   143	static int  read_system_regs(struct kp2000_device *pcard)
   144	{
   145	    u64 read_val;
   146	
   147	    read_val = readq(pcard->sysinfo_regs_base + REG_MAGIC_NUMBER);
   148	    if (read_val != KP2000_MAGIC_VALUE){
 > 149	        dev_err(&pcard->pdev->dev, "Invalid magic!  Got: 0x%016llx  Want: 0x%016lx\n", read_val, KP2000_MAGIC_VALUE);
   150	        return -EILSEQ;
   151	    }
   152	
   153	    read_val = readq(pcard->sysinfo_regs_base + REG_CARD_ID_AND_BUILD);
   154	    pcard->card_id = (read_val & 0xFFFFFFFF00000000) >> 32;
   155	    pcard->build_version = (read_val & 0x00000000FFFFFFFF) >> 0;
   156	
   157	    read_val = readq(pcard->sysinfo_regs_base + REG_DATE_AND_TIME_STAMPS);
   158	    pcard->build_datestamp = (read_val & 0xFFFFFFFF00000000) >> 32;
   159	    pcard->build_timestamp = (read_val & 0x00000000FFFFFFFF) >> 0;
   160	
   161	    read_val = readq(pcard->sysinfo_regs_base + REG_CORE_TABLE_OFFSET);
   162	    pcard->core_table_length = (read_val & 0xFFFFFFFF00000000) >> 32;
   163	    pcard->core_table_offset = (read_val & 0x00000000FFFFFFFF) >> 0;
   164	
   165	    wait_and_read_ssid(pcard);
   166	
   167	    read_val = readq(pcard->sysinfo_regs_base + REG_FPGA_HW_ID);
   168	    pcard->core_table_rev    = (read_val & 0x0000000000000F00) >> 8;
   169	    pcard->hardware_revision = (read_val & 0x000000000000001F);
   170	
   171	    read_val = readq(pcard->sysinfo_regs_base + REG_FPGA_DDNA);
   172	    pcard->ddna = read_val;
   173	
   174	    dev_info(&pcard->pdev->dev, "system_regs: %08x %08x %08x %08x  %02x  %d %d  %016llx  %016llx\n",
   175	        pcard->card_id,
   176	        pcard->build_version,
   177	        pcard->build_datestamp,
   178	        pcard->build_timestamp,
   179	        pcard->hardware_revision,
   180	        pcard->core_table_rev,
   181	        pcard->core_table_length,
   182	        pcard->ssid,
   183	        pcard->ddna
   184	    );
   185	
   186	    if (pcard->core_table_rev > 1){
   187	        dev_err(&pcard->pdev->dev, "core table entry revision is higher than we can deal with, cannot continue with this card!\n");
   188	        return 1;
   189	    }
   190	
   191	    return 0;
   192	}
   193	
   194	irqreturn_t  kp2000_irq_handler(int irq, void *dev_id)
   195	{
   196	    struct kp2000_device  *pcard = (struct kp2000_device*)dev_id;
   197	    SetBackEndControl(pcard->dma_common_regs, KPC_DMA_CARD_IRQ_ENABLE | KPC_DMA_CARD_USER_INTERRUPT_MODE | KPC_DMA_CARD_USER_INTERRUPT_ACTIVE);
   198	    return IRQ_HANDLED;
   199	}
   200	
   201	static int kp2000_cdev_open(struct inode *inode, struct file *filp)
   202	{
   203		struct kp2000_device *pcard = container_of(filp->private_data, struct kp2000_device, miscdev);
   204	
   205		dev_dbg(&pcard->pdev->dev, "kp2000_cdev_open(filp = [%p], pcard = [%p])\n", filp, pcard);
   206	
   207		filp->private_data = pcard; /* so other methods can access it */
   208	
   209		return 0;
   210	}
   211	
   212	static int kp2000_cdev_close(struct inode *inode, struct file *filp)
   213	{
   214		struct kp2000_device *pcard = filp->private_data;
   215	
   216		dev_dbg(&pcard->pdev->dev, "kp2000_cdev_close(filp = [%p], pcard = [%p])\n", filp, pcard);
   217		return 0;
   218	}
   219	
   220	
   221	static ssize_t kp2000_cdev_read(struct file *filp, char __user *buf,
   222					size_t count, loff_t *f_pos)
   223	{
   224		struct kp2000_device *pcard = filp->private_data;
   225		int cnt = 0;
   226		int ret;
   227	#define BUFF_CNT  1024
   228		char buff[BUFF_CNT] = {0}; //NOTE: Increase this so it is at least as large as all the scnprintfs.  And don't use unbounded strings. "%s"
   229		//NOTE: also, this is a really shitty way to implement the read() call, but it will work for any size 'count'.
   230	
   231		if (WARN(NULL == buf, "kp2000_cdev_read: buf is a NULL pointer!\n"))
   232			return -EINVAL;
   233	
   234		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Card ID                 : 0x%08x\n", pcard->card_id);
   235		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Build Version           : 0x%08x\n", pcard->build_version);
   236		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Build Date              : 0x%08x\n", pcard->build_datestamp);
   237		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Build Time              : 0x%08x\n", pcard->build_timestamp);
   238		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Core Table Offset       : 0x%08x\n", pcard->core_table_offset);
   239		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Core Table Length       : 0x%08x\n", pcard->core_table_length);
   240		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "Hardware Revision       : 0x%08x\n", pcard->hardware_revision);
   241		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "SSID                    : 0x%016llx\n", pcard->ssid);
   242		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "DDNA                    : 0x%016llx\n", pcard->ddna);
   243		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "IRQ Mask                : 0x%016llx\n", readq(pcard->sysinfo_regs_base + REG_INTERRUPT_MASK));
   244		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "IRQ Active              : 0x%016llx\n", readq(pcard->sysinfo_regs_base + REG_INTERRUPT_ACTIVE));
   245		cnt += scnprintf(buff+cnt, BUFF_CNT-cnt, "CPLD                    : 0x%016llx\n", readq(pcard->sysinfo_regs_base + REG_CPLD_CONFIG));
   246	
   247		if (*f_pos >= cnt)
   248			return 0;
   249	
   250		if (count > cnt)
   251			count = cnt;
   252	
   253		ret = copy_to_user(buf, buff + *f_pos, count);
   254		if (ret)
   255			return -EFAULT;
   256		*f_pos += count;
   257		return count;
 > 258	}
   259	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 59800 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20190518/849e4207/attachment-0001.bin>


More information about the devel mailing list