From patchwork Sat Sep 24 05:26:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 76919 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp198736qgf; Fri, 23 Sep 2016 22:26:26 -0700 (PDT) X-Received: by 10.98.141.146 with SMTP id p18mr18480941pfk.17.1474694786481; Fri, 23 Sep 2016 22:26:26 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a86si11617145pfl.236.2016.09.23.22.26.26; Fri, 23 Sep 2016 22:26:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936286AbcIXF0Y (ORCPT + 27 others); Sat, 24 Sep 2016 01:26:24 -0400 Received: from mail-pf0-f177.google.com ([209.85.192.177]:34325 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932400AbcIXF0W (ORCPT ); Sat, 24 Sep 2016 01:26:22 -0400 Received: by mail-pf0-f177.google.com with SMTP id l25so202549pfb.1 for ; Fri, 23 Sep 2016 22:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=10ivbfEzeNf6zpGuCLxNNtRQ7eRy6Qj6LzaQ0wHHytY=; b=Guqw4bWviFIYeJLQwpNMCOZBBZHD0E+Gxp+B7yzwYgs5oovQkKyHVbWndQ4nIY7sP+ d6tCJxSsCyydI2+qF9hxAlfMicFYh6SBZEYeYV6bx5X+65BDBC78itS7XLKHZxdhbyUM czvZtflnwm1d9B8xXyCTu47GTP4u2qxJdNosk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=10ivbfEzeNf6zpGuCLxNNtRQ7eRy6Qj6LzaQ0wHHytY=; b=Lt5qVCu7Axw8NnoHBAv0AT+/eADVIW3BuAfLQbr3DEFULiAz+VSpmPoO5hunPbyR0/ Cz4YfqXA4Yhgh3/V2G+NH87eELlyLSoD54R1GIydrCzFsqfzD4py4ogLY3F4hHPLL2+r jQbMBEdrRba54z79mFAVAJsHajB8wxx4sVmjy5PpWxvS2b6LFpkLrgczatahyWi8Nsv8 HvIwxstsEfXg4kd6kMOSMfZGzTGGP+u96ikxghFtYlh17Y98J0gmIIaiJZ67Qt1n8JaA mcOkDHxOFtaWDTlRP0iHxDLCBm2OC3bAM3IhrvSd03TM0YiyzSjQLz6wzo5rBGoqsKm5 2d7w== X-Gm-Message-State: AE9vXwMa2pKBc1h/bPjlbP0Z8NjTKNr1EKL5x5lvmNfcM1OB/IwoHJZwEDguWPEL61u+kgPS X-Received: by 10.98.70.132 with SMTP id o4mr19130798pfi.132.1474694781214; Fri, 23 Sep 2016 22:26:21 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.27]) by smtp.gmail.com with ESMTPSA id x9sm15147621pff.19.2016.09.23.22.26.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Sep 2016 22:26:20 -0700 (PDT) From: Baoyou Xie To: isdn@linux-pingi.de, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, arnd@arndb.de, baoyou.xie@linaro.org, xie.baoyou@zte.com.cn Subject: [PATCH 5/6] mISDN: mark symbols static where possible Date: Sat, 24 Sep 2016 13:26:08 +0800 Message-Id: <1474694768-7673-1-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We get a few warnings when building kernel with W=1: drivers/isdn/mISDN/layer2.c:120:1: warning: no previous declaration for 'l2headersize' [-Wmissing-declarations] drivers/isdn/mISDN/layer2.c:127:1: warning: no previous declaration for 'l2addrsize' [-Wmissing-declarations] drivers/isdn/mISDN/layer2.c:379:1: warning: no previous declaration for 'cansend' [-Wmissing-declarations] drivers/isdn/mISDN/layer2.c:679:1: warning: no previous declaration for 'stop_t200' [-Wmissing-declarations] .... In fact, these functions are only used in the file in which they are declared and don't need a declaration, but can be made static. So this patch marks these functions with 'static'. Signed-off-by: Baoyou Xie --- drivers/isdn/mISDN/layer2.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) -- 2.7.4 diff --git a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c index 5eb380a..f6ab6027 100644 --- a/drivers/isdn/mISDN/layer2.c +++ b/drivers/isdn/mISDN/layer2.c @@ -116,14 +116,14 @@ l2m_debug(struct FsmInst *fi, char *fmt, ...) va_end(va); } -inline u_int +static inline u_int l2headersize(struct layer2 *l2, int ui) { return ((test_bit(FLG_MOD128, &l2->flag) && (!ui)) ? 2 : 1) + (test_bit(FLG_LAPD, &l2->flag) ? 2 : 1); } -inline u_int +static inline u_int l2addrsize(struct layer2 *l2) { return test_bit(FLG_LAPD, &l2->flag) ? 2 : 1; @@ -375,7 +375,7 @@ ReleaseWin(struct layer2 *l2) "isdnl2 freed %d skbuffs in release\n", cnt); } -inline unsigned int +static inline unsigned int cansend(struct layer2 *l2) { unsigned int p1; @@ -387,7 +387,7 @@ cansend(struct layer2 *l2) return (p1 < l2->window) && !test_bit(FLG_PEER_BUSY, &l2->flag); } -inline void +static inline void clear_exception(struct layer2 *l2) { test_and_clear_bit(FLG_ACK_PEND, &l2->flag); @@ -435,25 +435,25 @@ enqueue_ui(struct layer2 *l2, struct sk_buff *skb) dev_kfree_skb(skb); } -inline int +static inline int IsUI(u_char *data) { return (data[0] & 0xef) == UI; } -inline int +static inline int IsUA(u_char *data) { return (data[0] & 0xef) == UA; } -inline int +static inline int IsDM(u_char *data) { return (data[0] & 0xef) == DM; } -inline int +static inline int IsDISC(u_char *data) { return (data[0] & 0xef) == DISC; @@ -468,7 +468,7 @@ IsRR(u_char *data, struct layer2 *l2) return (data[0] & 0xf) == 1; } -inline int +static inline int IsSFrame(u_char *data, struct layer2 *l2) { register u_char d = *data; @@ -478,7 +478,7 @@ IsSFrame(u_char *data, struct layer2 *l2) return ((d & 0xf3) == 1) && ((d & 0x0c) != 0x0c); } -inline int +static inline int IsSABME(u_char *data, struct layer2 *l2) { u_char d = data[0] & ~0x10; @@ -486,20 +486,20 @@ IsSABME(u_char *data, struct layer2 *l2) return test_bit(FLG_MOD128, &l2->flag) ? d == SABME : d == SABM; } -inline int +static inline int IsREJ(u_char *data, struct layer2 *l2) { return test_bit(FLG_MOD128, &l2->flag) ? data[0] == REJ : (data[0] & 0xf) == REJ; } -inline int +static inline int IsFRMR(u_char *data) { return (data[0] & 0xef) == FRMR; } -inline int +static inline int IsRNR(u_char *data, struct layer2 *l2) { return test_bit(FLG_MOD128, &l2->flag) ? @@ -645,13 +645,13 @@ send_uframe(struct layer2 *l2, struct sk_buff *skb, u_char cmd, u_char cr) } -inline u_char +static inline u_char get_PollFlag(struct layer2 *l2, struct sk_buff *skb) { return skb->data[l2addrsize(l2)] & 0x10; } -inline u_char +static inline u_char get_PollFlagFree(struct layer2 *l2, struct sk_buff *skb) { u_char PF; @@ -661,28 +661,28 @@ get_PollFlagFree(struct layer2 *l2, struct sk_buff *skb) return PF; } -inline void +static inline void start_t200(struct layer2 *l2, int i) { mISDN_FsmAddTimer(&l2->t200, l2->T200, EV_L2_T200, NULL, i); test_and_set_bit(FLG_T200_RUN, &l2->flag); } -inline void +static inline void restart_t200(struct layer2 *l2, int i) { mISDN_FsmRestartTimer(&l2->t200, l2->T200, EV_L2_T200, NULL, i); test_and_set_bit(FLG_T200_RUN, &l2->flag); } -inline void +static inline void stop_t200(struct layer2 *l2, int i) { if (test_and_clear_bit(FLG_T200_RUN, &l2->flag)) mISDN_FsmDelTimer(&l2->t200, i); } -inline void +static inline void st5_dl_release_l2l3(struct layer2 *l2) { int pr; @@ -694,7 +694,7 @@ st5_dl_release_l2l3(struct layer2 *l2) l2up_create(l2, pr, 0, NULL); } -inline void +static inline void lapb_dl_release_l2l3(struct layer2 *l2, int f) { if (test_bit(FLG_LAPB, &l2->flag)) @@ -1129,7 +1129,7 @@ enquiry_cr(struct layer2 *l2, u_char typ, u_char cr, u_char pf) enqueue_super(l2, skb); } -inline void +static inline void enquiry_response(struct layer2 *l2) { if (test_bit(FLG_OWN_BUSY, &l2->flag)) @@ -1139,7 +1139,7 @@ enquiry_response(struct layer2 *l2) test_and_clear_bit(FLG_ACK_PEND, &l2->flag); } -inline void +static inline void transmit_enquiry(struct layer2 *l2) { if (test_bit(FLG_OWN_BUSY, &l2->flag))