From patchwork Thu Sep 1 10:57:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 75189 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp227573qga; Thu, 1 Sep 2016 03:59:38 -0700 (PDT) X-Received: by 10.98.1.137 with SMTP id 131mr25224938pfb.165.1472727578291; Thu, 01 Sep 2016 03:59:38 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i63si5228300pfe.3.2016.09.01.03.59.37; Thu, 01 Sep 2016 03:59:38 -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 S933112AbcIAK7a (ORCPT + 27 others); Thu, 1 Sep 2016 06:59:30 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35834 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754001AbcIAK7Z (ORCPT ); Thu, 1 Sep 2016 06:59:25 -0400 Received: by mail-pa0-f52.google.com with SMTP id hb8so28887409pac.2 for ; Thu, 01 Sep 2016 03:58:29 -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=KBWjMGHfK0NyM/ngZz84bThWy96xZh3qo19kmqgjPLE=; b=OJzx+tP2FpEjYuTy1rkqe6climKPgoyc3KEk9d5rmfRitXhaqzx/m5LiKPfBJdfT3r +Xlt66msRCKqhsa/o4/TfRvKw1YKQTNJa+1RedWohy8Hwp30GRdB1BBVIM2lwzJRv/SM MSnDE/DziaE1kWppDNKGDi6afL40u+UX/3CBQ= 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=KBWjMGHfK0NyM/ngZz84bThWy96xZh3qo19kmqgjPLE=; b=abcL0lDso9fam3feE3+ydJihowcEsf4GYCbyi+eleEcmv219CA3XmOZSXRsYi30yxN Qap7aptZohCT8ZKws3OYQCOImQryw2Kem9veRk51h5dcHY7nYVoj979CitfFEGw1fhUV u+itnGxCLw6XC8Wtcs2l9riQHdWVE+5ZzZCwWirceiLDP/NtP+UlmDh0jab8DkbhEcD0 F28BTMeHwNZbUIaaLgPBHYpvNuSMLSJV778Q9Dn1ikvHqkHOw2FiMvV3OSm/Ka5RRstl 3jIfcLL7P4MipwpmD0HY1k03SLZbgS3xgFPm49OjmlIe2f/YSUFZTIEHSlp4LUBMhkqO mfXw== X-Gm-Message-State: AE9vXwMBQfoTMQcK7pRJTQ1j3ZCFJONvkORr/Ie1ejK3RUqXMwZmbzRKocxydvirN9NP2t+p X-Received: by 10.66.251.33 with SMTP id zh1mr25212132pac.55.1472727508992; Thu, 01 Sep 2016 03:58:28 -0700 (PDT) Received: from localhost.localdomain ([104.237.91.82]) by smtp.gmail.com with ESMTPSA id d197sm1136066pfd.25.2016.09.01.03.58.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 03:58:28 -0700 (PDT) From: Baoyou Xie To: philipp.reisner@linbit.com, lars.ellenberg@linbit.com Cc: drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, arnd@arndb.de, baoyou.xie@linaro.org, xie.baoyou@zte.com.cn Subject: [PATCH] drbd: mark symbols static where possible Date: Thu, 1 Sep 2016 18:57:53 +0800 Message-Id: <1472727473-25593-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/block/drbd/drbd_receiver.c:1224:6: warning: no previous prototype for 'one_flush_endio' [-Wmissing-prototypes] drivers/block/drbd/drbd_req.c:1450:6: warning: no previous prototype for 'send_and_submit_pending' [-Wmissing-prototypes] drivers/block/drbd/drbd_main.c:924:6: warning: no previous prototype for 'assign_p_sizes_qlim' [-Wmissing-prototypes] .... 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/block/drbd/drbd_main.c | 4 +++- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/drbd/drbd_req.c | 3 ++- drivers/block/drbd/drbd_worker.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 100be55..f0aa746 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -921,7 +921,9 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device) } /* communicated if (agreed_features & DRBD_FF_WSAME) */ -void assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p, struct request_queue *q) +static void +assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p, + struct request_queue *q) { if (q) { p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q)); diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 942384f..432f39a 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1221,7 +1221,7 @@ struct one_flush_context { struct issue_flush_context *ctx; }; -void one_flush_endio(struct bio *bio) +static void one_flush_endio(struct bio *bio) { struct one_flush_context *octx = bio->bi_private; struct drbd_device *device = octx->device; diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index de279fe..c725bf5 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c @@ -1447,7 +1447,8 @@ static bool prepare_al_transaction_nonblock(struct drbd_device *device, return !list_empty(pending); } -void send_and_submit_pending(struct drbd_device *device, struct list_head *pending) +static void +send_and_submit_pending(struct drbd_device *device, struct list_head *pending) { struct drbd_request *req, *tmp; diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index c6755c9..70f2706 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c @@ -194,7 +194,8 @@ void drbd_peer_request_endio(struct bio *bio) } } -void drbd_panic_after_delayed_completion_of_aborted_request(struct drbd_device *device) +static void +drbd_panic_after_delayed_completion_of_aborted_request(struct drbd_device *device) { panic("drbd%u %s/%u potential random memory corruption caused by delayed completion of aborted local request\n", device->minor, device->resource->name, device->vnr);