All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: tun: add VNET_LE flag
Date: Tue, 16 Dec 2014 09:34:28 +0000	[thread overview]
Message-ID: <20141216093428.GA14518@redhat.com> (raw)
In-Reply-To: <20141216092805.GA2937@mwanda>

On Tue, Dec 16, 2014 at 12:28:05PM +0300, Dan Carpenter wrote:
> Hello Michael S. Tsirkin,
> 
> The patch e999d6ea2a4f: "tun: add VNET_LE flag" from Nov 18, 2014,
> leads to the following static checker warning:
> 
> 	drivers/net/tun.c:1694 tun_set_iff()
> 	warn: 0x17100 is larger than 16 bits
> 
> drivers/net/tun.c
>   1692  
>   1693          tun->flags = (tun->flags & ~TUN_FEATURES) |
>   1694                  (ifr->ifr_flags & TUN_FEATURES);
>   1695  
> 
> It's complaining because the "ifr->ifr_flags" variable is a short
> (should it be unsigned?).  The new define:
> 
> #define IFF_VNET_LE    0x10000
> 
> doesn't fit in two bytes.  Other suspect looking code could be:
> 
> 	return __virtio16_to_cpu(q->flags & IFF_VNET_LE, val);
> 
> regards,
> dan carpenter


Thanks!
Of course most testing is on an LE host so it's hard to notice.
I'll fix it up.


-- 
MST

      reply	other threads:[~2014-12-16  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-16  9:28 tun: add VNET_LE flag Dan Carpenter
2014-12-16  9:34 ` Michael S. Tsirkin [this message]

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=20141216093428.GA14518@redhat.com \
    --to=mst@redhat.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.