From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A903AC2D0B1 for ; Tue, 4 Feb 2020 11:28:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88A36217BA for ; Tue, 4 Feb 2020 11:28:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727072AbgBDL2P (ORCPT ); Tue, 4 Feb 2020 06:28:15 -0500 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:34965 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726983AbgBDL2P (ORCPT ); Tue, 4 Feb 2020 06:28:15 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R461e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04428;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Tp7pt7A_1580815687; Received: from IT-FVFX43SYHV2H.local(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0Tp7pt7A_1580815687) by smtp.aliyun-inc.com(127.0.0.1); Tue, 04 Feb 2020 19:28:08 +0800 Subject: Re: [PATCH] net/bluetooth: remove __get_channel/dir To: Marcel Holtmann Cc: Johan Hedberg , "David S. Miller" , "Gustavo A. R. Silva" , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1579596583-258090-1-git-send-email-alex.shi@linux.alibaba.com> <8CA3EF63-F688-48B2-A21D-16FDBC809EDE@holtmann.org> From: Alex Shi Message-ID: <09359312-a1c8-c560-85ba-0f94be521b26@linux.alibaba.com> Date: Tue, 4 Feb 2020 19:28:07 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <8CA3EF63-F688-48B2-A21D-16FDBC809EDE@holtmann.org> Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org ÔÚ 2020/1/22 ÉÏÎç12:19, Marcel Holtmann дµÀ: > Hi Alex, > >> These 2 macros are never used from first git commit Linux-2.6.12-rc2. So >> better to remove them. >> >> Signed-off-by: Alex Shi >> Cc: Marcel Holtmann >> Cc: Johan Hedberg >> Cc: "David S. Miller" >> Cc: "Gustavo A. R. Silva" >> Cc: linux-bluetooth@vger.kernel.org >> Cc: netdev@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org >> --- >> net/bluetooth/rfcomm/core.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c >> index 3a9e9d9670be..825adff79f13 100644 >> --- a/net/bluetooth/rfcomm/core.c >> +++ b/net/bluetooth/rfcomm/core.c >> @@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, >> >> /* ---- RFCOMM frame parsing macros ---- */ >> #define __get_dlci(b) ((b & 0xfc) >> 2) >> -#define __get_channel(b) ((b & 0xf8) >> 3) >> -#define __get_dir(b) ((b & 0x04) >> 2) >> #define __get_type(b) ((b & 0xef)) >> >> #define __test_ea(b) ((b & 0x01)) > > it seems we are also not using __dir macro either. > Hi Marcel, Thanks a lot for reminder. How about the following patch? Thanks Alex >From 41ef02c2f52cee1d69bb0ba0fbd90247d61dc155 Mon Sep 17 00:00:00 2001 From: Alex Shi Date: Wed, 15 Jan 2020 17:11:01 +0800 Subject: [PATCH v2] net/bluetooth: remove __get_channel/dir and __dir These 3 macros are never used from first git commit Linux-2.6.12-rc2. let's remove them. Suggested-by: Marcel Holtmann Signed-off-by: Alex Shi Cc: Marcel Holtmann Cc: Johan Hedberg Cc: "David S. Miller" Cc: "Gustavo A. R. Silva" Cc: linux-bluetooth@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- net/bluetooth/rfcomm/core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index 3a9e9d9670be..dcecce087b24 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c @@ -73,8 +73,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, /* ---- RFCOMM frame parsing macros ---- */ #define __get_dlci(b) ((b & 0xfc) >> 2) -#define __get_channel(b) ((b & 0xf8) >> 3) -#define __get_dir(b) ((b & 0x04) >> 2) #define __get_type(b) ((b & 0xef)) #define __test_ea(b) ((b & 0x01)) @@ -87,7 +85,6 @@ static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src, #define __ctrl(type, pf) (((type & 0xef) | (pf << 4))) #define __dlci(dir, chn) (((chn & 0x1f) << 1) | dir) #define __srv_channel(dlci) (dlci >> 1) -#define __dir(dlci) (dlci & 0x01) #define __len8(len) (((len) << 1) | 1) #define __len16(len) ((len) << 1) -- 1.8.3.1