From patchwork Sat Sep 24 04:19:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 76905 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp181174qgf; Fri, 23 Sep 2016 21:19:50 -0700 (PDT) X-Received: by 10.98.147.195 with SMTP id r64mr18307090pfk.32.1474690790032; Fri, 23 Sep 2016 21:19:50 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xq3si11285798pac.194.2016.09.23.21.19.49; Fri, 23 Sep 2016 21:19:50 -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 S1753788AbcIXETp (ORCPT + 27 others); Sat, 24 Sep 2016 00:19:45 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:34003 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838AbcIXETl (ORCPT ); Sat, 24 Sep 2016 00:19:41 -0400 Received: by mail-pf0-f169.google.com with SMTP id p64so48102406pfb.1 for ; Fri, 23 Sep 2016 21:19:40 -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=NLGp4xc3d/28RnwK856SRwR8/XrzXRTw1DbPMza1w8s=; b=BfCJpH9A16HNsndcb4RuPnoksqZAJU4knd9dvsTMEikiBNlv9rhZmvesqpPt9VVzmG sjB9kq3CTzBEx9Ew7ElGQPUQqvfvQB+RJZKekeahgrjGPu1GNTcXuXlIRQ8JICXuwEhH iYDHrk9KTVbm+xI8SatmyYYRAwmbxlCbHbKTI= 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=NLGp4xc3d/28RnwK856SRwR8/XrzXRTw1DbPMza1w8s=; b=IlssOyHKOz3qas2dJoE2wrgfAe3jj2EewHssR1B+/nLin6oK2f50iPsYaYZEElD73E 2KMECW0ovqWmOeSbB/XXaZVon37nyQYDOR5J8UcGd1/Ql+zOcR8RMvfBgnzJzKzmXlwC vofzNd81HCy3gDh2KWpMEUUYgDPzzPZKdpmGaL2nF8J+10h7bYTi+ztNp5IHMy+4rziQ zC2fXDPQngNE7IGjixKXfQXFKTHEGUL51UDd7Eq5UciCerwb/ihBK//AsQjm7p2XtN7n x6aV7vpeIEEQMZYXLek2awib5rP2hO/hjQXNnf026aFnsx+53MmYjbdmTrTwuxd+aj9h R9VQ== X-Gm-Message-State: AE9vXwPZbYPEA4sAsx/V6ynYJlqXH21UL1F5H/so2d2XcE7Upltl1IC72ONXs1+qMIMQd2ax X-Received: by 10.98.98.193 with SMTP id w184mr18188111pfb.120.1474690780444; Fri, 23 Sep 2016 21:19:40 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.27]) by smtp.gmail.com with ESMTPSA id m11sm2259340pfi.30.2016.09.23.21.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Sep 2016 21:19:39 -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: Sat, 24 Sep 2016 12:19:00 +0800 Message-Id: <1474690740-10419-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 4 warnings when building kernel with W=1: drivers/block/drbd/drbd_worker.c:197:6: warning: no previous prototype for 'drbd_panic_after_delayed_completion_of_aborted_request' [-Wmissing-prototypes] 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 | 3 ++- drivers/block/drbd/drbd_receiver.c | 2 +- drivers/block/drbd/drbd_req.c | 3 ++- drivers/block/drbd/drbd_worker.c | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 100be55..c3133c5 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -921,7 +921,8 @@ 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);