linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Cc: kbuild-all@01.org, Ohad Ben-Cohen <ohad@wizery.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	xiang xiao <xiaoxiang781216@gmail.com>,
	linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org,
	arnaud.pouliquen@st.com, Suman Anna <s-anna@ti.com>,
	Fabien DESSENNE <fabien.dessenne@st.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH v5 2/2] tty: add rpmsg driver
Date: Fri, 30 Aug 2019 03:39:27 +0800	[thread overview]
Message-ID: <201908300325.3qvhzvhO%lkp@intel.com> (raw)
In-Reply-To: <1567005566-10986-3-git-send-email-arnaud.pouliquen@st.com>

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

Hi Arnaud,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc6 next-20190829]
[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/Arnaud-Pouliquen/rpmsg-core-add-API-to-get-message-length/20190829-222443
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.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.4.0 make.cross ARCH=sparc64 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/list.h:9:0,
                    from include/linux/module.h:9,
                    from drivers/tty/rpmsg_tty.c:7:
   drivers/tty/rpmsg_tty.c: In function 'rpmsg_tty_write':
   include/linux/kernel.h:821:29: warning: comparison of distinct pointer types lacks a cast
      (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                                ^
   include/linux/kernel.h:835:4: note: in expansion of macro '__typecheck'
      (__typecheck(x, y) && __no_side_effects(x, y))
       ^~~~~~~~~~~
   include/linux/kernel.h:845:24: note: in expansion of macro '__safe_cmp'
     __builtin_choose_expr(__safe_cmp(x, y), \
                           ^~~~~~~~~~
   include/linux/kernel.h:854:19: note: in expansion of macro '__careful_cmp'
    #define min(x, y) __careful_cmp(x, y, <)
                      ^~~~~~~~~~~~~
>> drivers/tty/rpmsg_tty.c:152:13: note: in expansion of macro 'min'
     msg_size = min(len, msg_max_size);
                ^~~

vim +/min +152 drivers/tty/rpmsg_tty.c

   132	
   133	static int rpmsg_tty_write(struct tty_struct *tty, const u8 *buf, int len)
   134	{
   135		struct rpmsg_tty_port *cport = tty->driver_data;
   136		struct rpmsg_device *rpdev;
   137		ssize_t msg_max_size, msg_size;
   138		int ret;
   139		u8 *tmpbuf;
   140	
   141		/* If cts not set, the message is not sent*/
   142		if (!cport->cts)
   143			return 0;
   144	
   145		rpdev = cport->rpdev;
   146	
   147		dev_dbg(&rpdev->dev, "%s: send msg from tty->index = %d, len = %d\n",
   148			__func__, tty->index, len);
   149	
   150		msg_max_size = rpmsg_get_mtu(rpdev->ept);
   151	
 > 152		msg_size = min(len, msg_max_size);
   153		tmpbuf = kzalloc(msg_size, GFP_KERNEL);
   154		if (!tmpbuf)
   155			return -ENOMEM;
   156	
   157		memcpy(tmpbuf, buf, msg_size);
   158	
   159		/*
   160		 * Try to send the message to remote processor, if failed return 0 as
   161		 * no data sent
   162		 */
   163		ret = rpmsg_trysendto(cport->d_ept, tmpbuf, msg_size, cport->data_dst);
   164		kfree(tmpbuf);
   165		if (ret) {
   166			dev_dbg(&rpdev->dev, "rpmsg_send failed: %d\n", ret);
   167			return 0;
   168		}
   169	
   170		return msg_size;
   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: 58672 bytes --]

  reply	other threads:[~2019-08-29 19:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28 15:19 [PATCH v5 0/2] TTY: add rpmsg tty driver Arnaud Pouliquen
2019-08-28 15:19 ` [PATCH v5 1/2] rpmsg: core: add API to get message length Arnaud Pouliquen
2019-08-28 22:34   ` Suman Anna
2019-09-03  9:49     ` Arnaud Pouliquen
2019-09-03 16:06       ` Suman Anna
2019-09-04  8:14         ` Arnaud Pouliquen
2019-08-28 15:19 ` [PATCH v5 2/2] tty: add rpmsg driver Arnaud Pouliquen
2019-08-29 19:39   ` kbuild test robot [this message]
2019-08-29 21:21   ` kbuild test robot

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=201908300325.3qvhzvhO%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnaud.pouliquen@st.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=fabien.dessenne@st.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=ohad@wizery.com \
    --cc=s-anna@ti.com \
    --cc=xiaoxiang781216@gmail.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).