All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: kbuild test robot <fengguang.wu@intel.com>
Cc: kbuild-all@01.org, "Ahmed S. Darwish" <ahmed.darwish@valeo.com>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [jtkirshe-net-next:core-queue 1002/1025] drivers/net/can/usb/kvaser_usb.c:639: warning: comparison is always false due to limited range of data type
Date: Fri, 30 Jan 2015 09:04:47 +0100	[thread overview]
Message-ID: <54CB3B1F.6010406@pengutronix.de> (raw)
In-Reply-To: <201501301018.HN7rQ3rB%fengguang.wu@intel.com>

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

Ahmed S. Darwish Cc'ed

On 01/30/2015 03:53 AM, kbuild test robot wrote:
> tree:   jtkirshe-net-next/core-queue
> head:   c265eda3429432b5e9e53c8082861ffbd2ffd2c2
> commit: 96d7f10634e66b27e23854c774fbcc0a2a654e82 [1002/1025] can: kvaser_usb: Consolidate and unify state change handling
> config: avr32-allyesconfig (attached as .config)
> reproduce:
>   wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>   chmod +x ~/bin/make.cross
>   git checkout 96d7f10634e66b27e23854c774fbcc0a2a654e82
>   # save the attached .config to linux build tree
>   make.cross ARCH=avr32 
> 
> All warnings:
> 
>    drivers/net/can/usb/kvaser_usb.c: In function 'kvaser_usb_rx_error_update_can_state':
>>> drivers/net/can/usb/kvaser_usb.c:639: warning: comparison is always false due to limited range of data type
>>> drivers/net/can/usb/kvaser_usb.c:639: warning: comparison is always false due to limited range of data type
> 
> vim +639 drivers/net/can/usb/kvaser_usb.c
> 
>    623							 const struct kvaser_usb_error_summary *es,
>    624							 struct can_frame *cf)
>    625	{
>    626		struct net_device_stats *stats;
>    627		enum can_state cur_state, new_state, tx_state, rx_state;
>    628	
>    629		netdev_dbg(priv->netdev, "Error status: 0x%02x\n", es->status);
>    630	
>    631		stats = &priv->netdev->stats;
>    632		new_state = cur_state = priv->can.state;
>    633	
>    634		if (es->status & (M16C_STATE_BUS_OFF | M16C_STATE_BUS_RESET))
>    635			new_state = CAN_STATE_BUS_OFF;
>    636		else if (es->status & M16C_STATE_BUS_PASSIVE)
>    637			new_state = CAN_STATE_ERROR_PASSIVE;
>    638		else if (es->status & M16C_STATE_BUS_ERROR) {
>  > 639			if ((es->txerr >= 256) || (es->rxerr >= 256))
>    640				new_state = CAN_STATE_BUS_OFF;
>    641			else if ((es->txerr >= 128) || (es->rxerr >= 128))
>    642				new_state = CAN_STATE_ERROR_PASSIVE;
>    643			else if ((es->txerr >= 96) || (es->rxerr >= 96))
>    644				new_state = CAN_STATE_ERROR_WARNING;
>    645			else if (cur_state > CAN_STATE_ERROR_ACTIVE)
>    646				new_state = CAN_STATE_ERROR_ACTIVE;
>    647		}
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation
> 


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

       reply	other threads:[~2015-01-30  8:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201501301018.HN7rQ3rB%fengguang.wu@intel.com>
2015-01-30  8:04 ` Marc Kleine-Budde [this message]
2015-01-30 11:26   ` [jtkirshe-net-next:core-queue 1002/1025] drivers/net/can/usb/kvaser_usb.c:639: warning: comparison is always false due to limited range of data type Andri Yngvason
2015-02-01 13:00     ` Ahmed S. Darwish
2015-02-01 12:04   ` Ahmed S. Darwish
2015-02-04 12:48     ` Ahmed S. Darwish

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=54CB3B1F.6010406@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=ahmed.darwish@valeo.com \
    --cc=fengguang.wu@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-can@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.