[mkl-can-next:j1939-individual 536/543] net/can/j1939/socket.c:793:73: warning: format '%i' expects argument of type 'int', but argument 3 has type 'size_t {aka long unsigned int}'

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git j1939-individual
head:   e376317fe76da7c479d2d212717d3bd1fd3435e1
commit: bdc19f3b25de4b5b922ceb3e7b61e8371bd7b86d [536/543] j1939: socket: add non blocking ETP send support
config: sparc64-allyesconfig (attached as .config)
compiler: sparc64-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
        git checkout bdc19f3b25de4b5b922ceb3e7b61e8371bd7b86d
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sparc64 

All warnings (new ones prefixed by >>):

   net/can/j1939/socket.c: In function 'j1939_sk_send_multi':
>> net/can/j1939/socket.c:793:73: warning: format '%i' expects argument of type 'int', but argument 3 has type 'size_t {aka long unsigned int}' [-Wformat=]
       netdev_warn(priv->ndev, "no error found and not completely queued?! %i\n", todo_size);
                                                                           ~^
                                                                           %li

vim +793 net/can/j1939/socket.c

   716	
   717	static int j1939_sk_send_multi(struct j1939_priv *priv,  struct sock *sk,
   718				       struct msghdr *msg, size_t size)
   719	
   720	{
   721		struct j1939_sock *jsk = j1939_sk(sk);
   722		struct j1939_session *session = NULL;
   723		struct sk_buff *skb;
   724		size_t segment_size, todo_size;
   725		int ret = 0;
   726	
   727		if (!jsk->etp_tx_done_size) {
   728			j1939_sock_pending_add(&jsk->sk);
   729			jsk->etp_tx_complete_size = size;
   730		} else if (jsk->etp_tx_complete_size != jsk->etp_tx_done_size + size)
   731			return -EIO;
   732	
   733		todo_size = size;
   734	
   735		while (todo_size) {
   736			struct j1939_sk_buff_cb *skcb;
   737	
   738			if (todo_size > J1939_MAX_TP_PACKET_SIZE)
   739				segment_size = J1939_MAX_TP_PACKET_SIZE;
   740			else
   741				segment_size = todo_size;
   742	
   743			/* Allocate skb for one segment */
   744			skb = j1939_sk_alloc_skb(priv->ndev, sk, msg, segment_size,
   745						 &ret);
   746			if (ret)
   747				break;
   748	
   749			skcb = j1939_skb_to_cb(skb);
   750			skcb->offset = jsk->etp_tx_done_size;
   751	
   752			if (!session) {
   753				if (jsk->etp_tx_done_size) {
   754					bool extd = J1939_REGULAR;
   755	
   756					if (jsk->etp_tx_complete_size > J1939_MAX_TP_PACKET_SIZE)
   757						extd = J1939_EXTENDED;
   758	
   759					session = j1939_session_get_by_skcb(priv, skcb,
   760									    extd, false);
   761					if (IS_ERR_OR_NULL(session)) {
   762						/* FIXME: free skb? Who discards the skb in error case?
   763						 */
   764						jsk->etp_tx_done_size = 0;
   765						return PTR_ERR(session);
   766					}
   767	
   768					j1939_session_skb_queue(session, skb);
   769				} else {
   770					/* create new session with etp_tx_complete_size and attach
   771					 * skb segment
   772					 */
   773					session = j1939_tp_send(priv, skb,
   774								jsk->etp_tx_complete_size);
   775					if (IS_ERR(session)) {
   776						/* FIXME: free skb? Who discards the skb in error case?
   777						 */
   778						jsk->etp_tx_done_size = 0;
   779						return PTR_ERR(session);
   780					}
   781				}
   782			} else {
   783				j1939_session_skb_queue(session, skb);
   784			}
   785	
   786			todo_size -= segment_size;
   787			jsk->etp_tx_done_size += segment_size;
   788		}
   789	
   790		switch (ret) {
   791		case 0: /* OK */
   792			if (todo_size)
 > 793				netdev_warn(priv->ndev, "no error found and not completely queued?! %i\n", todo_size);
   794			ret = size;
   795			jsk->etp_tx_done_size = 0;
   796			break;
   797		case -ERESTARTSYS:
   798			ret = -EINTR;
   799			/* fall trough */
   800		case -EAGAIN: /* OK */
   801			if (todo_size != size)
   802				ret = size - todo_size;
   803			break;
   804		default: /* ERROR */
   805			/* skb session queue will be purged if we are the last user */
   806			jsk->etp_tx_done_size = 0;
   807		}
   808	
   809		if (session)
   810			j1939_session_put(session);
   811	
   812		return ret;
   813	}
   814	

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

Attachment: .config.gz
Description: application/gzip


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

  Powered by Linux