All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Schmidt <stefan@osg.samsung.com>
To: Alexander Aring <alex.aring@gmail.com>, linux-wpan@vger.kernel.org
Cc: linux-bluetooth@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH bluetooth-next 2/2] 6lowpan: iphc: remove handling when dam is zero
Date: Tue, 17 Nov 2015 22:04:42 +0100	[thread overview]
Message-ID: <564B966A.1070708@osg.samsung.com> (raw)
In-Reply-To: <1447786441-17845-3-git-send-email-alex.aring@gmail.com>

Hello.

On 17/11/15 19:54, Alexander Aring wrote:
> This patch removes handling of LOWPAN_IPHC_DAM_00 inside the
> lowpan_compress_addr_64 function. The case of LOWPAN_IPHC_DAM_00 can
> never occur. there exists a if branch which use LOWPAN_IPHC_DAM_11 and
> LOWPAN_IPHC_DAM_10 and inside the else branch LOWPAN_IPHC_DAM_01. So
> LOWPAN_IPHC_DAM_00 can never occur.

Agreed the DAM_00 case means no compressions and carry the 128 bit 
address in line. We never call lowpan_compress_addr_64() for this case 
so removing this case which is never used is fine.
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
>   net/6lowpan/iphc.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
> index 13f5424..f7f175c 100644
> --- a/net/6lowpan/iphc.c
> +++ b/net/6lowpan/iphc.c
> @@ -594,7 +594,6 @@ int lowpan_header_decompress(struct sk_buff *skb, const struct net_device *dev,
>   EXPORT_SYMBOL_GPL(lowpan_header_decompress);
>   
>   static const u8 lowpan_iphc_dam_to_sam_value[] = {
> -	[LOWPAN_IPHC_DAM_00] = LOWPAN_IPHC_SAM_00,
>   	[LOWPAN_IPHC_DAM_01] = LOWPAN_IPHC_SAM_01,
>   	[LOWPAN_IPHC_DAM_10] = LOWPAN_IPHC_SAM_10,
>   	[LOWPAN_IPHC_DAM_11] = LOWPAN_IPHC_SAM_11,
> @@ -603,7 +602,7 @@ static const u8 lowpan_iphc_dam_to_sam_value[] = {
>   static u8 lowpan_compress_addr_64(u8 **hc_ptr, const struct in6_addr *ipaddr,
>   				  const unsigned char *lladdr, bool sam)
>   {
> -	u8 dam = LOWPAN_IPHC_DAM_00;
> +	u8 dam;
>   
>   	if (is_addr_mac_addr_based(ipaddr, lladdr)) {
>   		dam = LOWPAN_IPHC_DAM_11; /* 0-bits */

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>

regards
Stefan Schmidt

  reply	other threads:[~2015-11-17 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-17 18:53 [PATCH bluetooth-next 0/2] 6lowpan: iphc: cleanups Alexander Aring
2015-11-17 18:54 ` [PATCH bluetooth-next 1/2] 6lowpan: iphc: add check for reserved values Alexander Aring
2015-11-17 21:04   ` Stefan Schmidt
2015-11-17 18:54 ` [PATCH bluetooth-next 2/2] 6lowpan: iphc: remove handling when dam is zero Alexander Aring
2015-11-17 21:04   ` Stefan Schmidt [this message]
2015-11-25 13:23 ` [PATCH bluetooth-next 0/2] 6lowpan: iphc: cleanups Alexander Aring

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=564B966A.1070708@osg.samsung.com \
    --to=stefan@osg.samsung.com \
    --cc=alex.aring@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-wpan@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.