mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: SeongJae Park <sj38.park@gmail.com>
To: gregkh@linuxfoundation.org, chad@dahc.us, viro@zeniv.linux.org.uk
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
	SeongJae Park <sj38.park@gmail.com>
Subject: [PATCH] staging: silicom: hide conditionally used function in condition
Date: Wed, 26 Mar 2014 14:58:50 +0900	[thread overview]
Message-ID: <1395813530-2684-1-git-send-email-sj38.park@gmail.com> (raw)

bp_proc_create() be called only when BP_PROC_SUPPORT defined but its
definition live outside of #ifdef BP_PROC_SUPPORT and cause following
trivial build warning:
drivers/staging/silicom/bpctl_mod.c:6786:12: warning:
‘bp_proc_create’ defined but not used [-Wunused-function]
 static int bp_proc_create(void)
            ^

Fix the warning by hide the definition inside #ifdef BP_PROC_SUPPORT.

Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
 drivers/staging/silicom/bpctl_mod.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c
index 6b9365b..beff280 100644
--- a/drivers/staging/silicom/bpctl_mod.c
+++ b/drivers/staging/silicom/bpctl_mod.c
@@ -119,7 +119,9 @@ static void if_scan_init(void);
 
 static int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block);
 static int bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block);
+#ifdef BP_PROC_SUPPORT
 static int bp_proc_create(void);
+#endif
 
 static int is_bypass_fn(struct bpctl_dev *pbpctl_dev);
 static int get_dev_idx_bsf(int bus, int slot, int func);
@@ -6783,6 +6785,7 @@ EXPORT_SYMBOL(bp_if_scan_sd);
 
 static struct proc_dir_entry *bp_procfs_dir;
 
+#ifdef BP_PROC_SUPPORT
 static int bp_proc_create(void)
 {
 	bp_procfs_dir = proc_mkdir(BP_PROC_DIR, init_net.proc_net);
@@ -6794,6 +6797,7 @@ static int bp_proc_create(void)
 	}
 	return 0;
 }
+#endif
 
 static int procfs_add(char *proc_name, const struct file_operations *fops,
 		      struct bpctl_dev *dev)
-- 
1.8.3.2


             reply	other threads:[~2014-03-26  5:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26  5:58 SeongJae Park [this message]
2014-03-26 12:27 ` Greg KH
2014-03-26 12:34   ` SeongJae Park
2014-03-26 14:24 ` [PATCH v2] staging: silicom: remove BP_PROC_SUPPORT dependant code SeongJae Park

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=1395813530-2684-1-git-send-email-sj38.park@gmail.com \
    --to=sj38.park@gmail.com \
    --cc=chad@dahc.us \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®