linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, gregkh@linuxfoundation.org, arnd@arndb.de,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	openbmc@lists.ozlabs.org, joel@jms.id.au, jiri@resnulli.us,
	tklauser@distanz.ch, linux-serial@vger.kernel.org, mec@shout.net,
	vadimp@mellanox.com, system-sw-low-level@mellanox.com,
	robh+dt@kernel.org, openocd-devel-owner@lists.sourceforge.net,
	linux-api@vger.kernel.org, davem@davemloft.net,
	mchehab@kernel.org, Oleksandr Shamray <oleksandrs@mellanox.com>,
	Jiri Pirko <jiri@mellanox.com>
Subject: Re: [patch v10 1/4] drivers: jtag: Add JTAG core driver
Date: Thu, 2 Nov 2017 05:43:43 +0800	[thread overview]
Message-ID: <201711020505.KCJRigIt%fengguang.wu@intel.com> (raw)
In-Reply-To: <1509365528-28803-2-git-send-email-oleksandrs@mellanox.com>

[-- Attachment #1: Type: text/plain, Size: 4588 bytes --]

Hi Oleksandr,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.14-rc7]
[cannot apply to next-20171018]
[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/Oleksandr-Shamray/JTAG-driver-introduction/20171102-045624
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 6.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
        make.cross ARCH=blackfin 

All errors (new ones prefixed by >>):

   drivers/jtag/jtag.c: In function 'jtag_ioctl':
>> drivers/jtag/jtag.c:130:10: error: too many arguments to function 'jtag->ops->xfer'
       err = jtag->ops->xfer(jtag, &xfer, xfer_data);
             ^~~~
   At top level:
   drivers/jtag/jtag.c:42:21: warning: 'jtag_class' defined but not used [-Wunused-variable]
    static struct class jtag_class = {
                        ^~~~~~~~~~

vim +130 drivers/jtag/jtag.c

    46	
    47	static long jtag_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
    48	{
    49		struct jtag *jtag = file->private_data;
    50		struct jtag_run_test_idle idle;
    51		struct jtag_xfer xfer;
    52		u8 *xfer_data;
    53		u32 data_size;
    54		u32 value;
    55		int err;
    56	
    57		if (!arg)
    58			return -EINVAL;
    59	
    60		switch (cmd) {
    61		case JTAG_GIOCFREQ:
    62	
    63			if (jtag->ops->freq_get)
    64				err = jtag->ops->freq_get(jtag, &value);
    65			else
    66				err = -EOPNOTSUPP;
    67			if (err)
    68				break;
    69	
    70			if (put_user(value, (__u32 *)arg))
    71				err = -EFAULT;
    72			break;
    73	
    74		case JTAG_SIOCFREQ:
    75			if (get_user(value, (__u32 *)arg))
    76				return -EFAULT;
    77			if (value == 0)
    78				return -EINVAL;
    79	
    80			if (jtag->ops->freq_set)
    81				err = jtag->ops->freq_set(jtag, value);
    82			else
    83				err = -EOPNOTSUPP;
    84			break;
    85	
    86		case JTAG_IOCRUNTEST:
    87			if (copy_from_user(&idle, (void *)arg,
    88					   sizeof(struct jtag_run_test_idle)))
    89				return -EFAULT;
    90	
    91			if (idle.mode > JTAG_XFER_SW_MODE)
    92				return -EINVAL;
    93	
    94			if (idle.endstate > JTAG_STATE_PAUSEDR)
    95				return -EINVAL;
    96	
    97			if (jtag->ops->idle)
    98				err = jtag->ops->idle(jtag, &idle);
    99			else
   100				err = -EOPNOTSUPP;
   101			break;
   102	
   103		case JTAG_IOCXFER:
   104			if (copy_from_user(&xfer, (void *)arg,
   105					   sizeof(struct jtag_xfer)))
   106				return -EFAULT;
   107	
   108			if (xfer.length >= JTAG_MAX_XFER_DATA_LEN)
   109				return -EINVAL;
   110	
   111			if (xfer.mode > JTAG_XFER_SW_MODE)
   112				return -EINVAL;
   113	
   114			if (xfer.type > JTAG_SDR_XFER)
   115				return -EINVAL;
   116	
   117			if (xfer.direction > JTAG_WRITE_XFER)
   118				return -EINVAL;
   119	
   120			if (xfer.endstate > JTAG_STATE_PAUSEDR)
   121				return -EINVAL;
   122	
   123			data_size = DIV_ROUND_UP(xfer.length, BITS_PER_BYTE);
   124			xfer_data = memdup_user(u64_to_user_ptr(xfer.tdio), data_size);
   125	
   126			if (!xfer_data)
   127				return -EFAULT;
   128	
   129			if (jtag->ops->xfer) {
 > 130				err = jtag->ops->xfer(jtag, &xfer, xfer_data);
   131			} else {
   132				kfree(xfer_data);
   133				return -EOPNOTSUPP;
   134			}
   135	
   136			if (err) {
   137				return -EFAULT;
   138				kfree(xfer_data);
   139			}
   140	
   141			err = copy_to_user(u64_to_user_ptr(xfer.tdio),
   142					   (void *)(xfer_data), data_size);
   143	
   144			if (err) {
   145				kfree(xfer_data);
   146				return -EFAULT;
   147			}
   148	
   149			kfree(xfer_data);
   150			if (copy_to_user((void *)arg, &xfer, sizeof(struct jtag_xfer)))
   151				return -EFAULT;
   152			break;
   153	
   154		case JTAG_GIOCSTATUS:
   155			if (jtag->ops->status_get)
   156				err = jtag->ops->status_get(jtag, &value);
   157			else
   158				err = -EOPNOTSUPP;
   159			if (err)
   160				break;
   161	
   162			err = put_user(value, (__u32 *)arg);
   163			if (err)
   164				err = -EFAULT;
   165			break;
   166	
   167		default:
   168			return -EINVAL;
   169		}
   170		return err;
   171	}
   172	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46042 bytes --]

  parent reply	other threads:[~2017-11-01 21:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 12:12 [patch v10 0/4] JTAG driver introduction Oleksandr Shamray
2017-10-30 12:12 ` [patch v10 1/4] drivers: jtag: Add JTAG core driver Oleksandr Shamray
2017-11-01 21:34   ` kbuild test robot
2017-11-01 21:43   ` kbuild test robot [this message]
2017-10-30 12:12 ` [patch v10 2/4] drivers: jtag: Add Aspeed SoC 24xx and 25xx families JTAG master driver Oleksandr Shamray
     [not found]   ` <1509365528-28803-3-git-send-email-oleksandrs-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-01 22:14     ` kbuild test robot
2017-11-02  0:58   ` kbuild test robot
2017-10-30 12:12 ` [patch v10 3/4] Documentation: jtag: Add bindings for " Oleksandr Shamray
     [not found] ` <1509365528-28803-1-git-send-email-oleksandrs-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-10-30 12:12   ` [patch v10 4/4] Documentation: jtag: Add ABI documentation Oleksandr Shamray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201711020505.KCJRigIt%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiri@mellanox.com \
    --cc=jiri@resnulli.us \
    --cc=joel@jms.id.au \
    --cc=kbuild-all@01.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mec@shout.net \
    --cc=oleksandrs@mellanox.com \
    --cc=openbmc@lists.ozlabs.org \
    --cc=openocd-devel-owner@lists.sourceforge.net \
    --cc=robh+dt@kernel.org \
    --cc=system-sw-low-level@mellanox.com \
    --cc=tklauser@distanz.ch \
    --cc=vadimp@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).