On Fri, Mar 30, 2012 at 05:41:55PM +0900, Tomoya MORINAGA wrote:
> The test (((errc & PCH_REC) >> 8) > 127) would always be false because
> the receive error counter ((errc & PCH_REC) >> 8) is at most 127, where
> PCH_REC is defined as 0x7f00.  To test whether the receive error counter
> has reached the error passive level, the RP bit (15) should be used.
> 
> commit: 70f23fd66bc821a0e99647f70a809e277cc93c4c

No, that commit does not reference the patch below, where did you get
that from?

Ick.

greg k-h

> 
> kernel version: 3.0, 3.2
> 
> Cc: [email protected]
> Signed-off-by: Xi Wang <[email protected]>
> Acked-by: Wolfgang Grandegger <[email protected]>
> Signed-off-by: Marc Kleine-Budde <[email protected]>
> Signed-off-by: Tomoya MORINAGA <[email protected]>
> ---
>  drivers/net/can/pch_can.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
> index d11fbb2..6edc25e 100644
> --- a/drivers/net/can/pch_can.c
> +++ b/drivers/net/can/pch_can.c
> @@ -66,6 +66,7 @@
>  #define PCH_IF_CREQ_BUSY     BIT(15)
>  
>  #define PCH_STATUS_INT               0x8000
> +#define PCH_RP                       0x00008000
>  #define PCH_REC                      0x00007f00
>  #define PCH_TEC                      0x000000ff
>  
> @@ -527,7 +528,7 @@ static void pch_can_error(struct net_device *ndev, u32 
> status)
>               priv->can.can_stats.error_passive++;
>               state = CAN_STATE_ERROR_PASSIVE;
>               cf->can_id |= CAN_ERR_CRTL;
> -             if (((errc & PCH_REC) >> 8) > 127)
> +             if (errc & PCH_RP)
>                       cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
>               if ((errc & PCH_TEC) > 127)
>                       cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE;
> -- 
> 1.7.7.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to