mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sanjeev Premi <premi@ti.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/1] net: Exclude code based on selected protocol
Date: Thu, 24 Dec 2009 19:25:37 +0530	[thread overview]
Message-ID: <1261662937-31474-2-git-send-email-premi@ti.com> (raw)
In-Reply-To: <1261662937-31474-1-git-send-email-premi@ti.com>

Exclude the code for TFTP/NFS if either of the
protocols is not selected.

Signed-off-by: Sanjeev Premi <premi@ti.com>
---
 commands/net.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/commands/net.c b/commands/net.c
index df06227..8071c9b 100644
--- a/commands/net.c
+++ b/commands/net.c
@@ -77,6 +77,7 @@ void netboot_update_env(void)
 		setenv ("domain", NetOurNISDomain);
 }
 
+#ifdef CONFIG_NET_TFTP
 static int do_tftpb (cmd_tbl_t *cmdtp, int argc, char *argv[])
 {
 	return netboot_common (TFTP, cmdtp, argc, argv);
@@ -92,6 +93,8 @@ BAREBOX_CMD_START(tftp)
 	BAREBOX_CMD_HELP(cmd_tftp_help)
 BAREBOX_CMD_END
 
+#endif
+
 /**
  * @page tftp_command tftp
  *
@@ -157,9 +160,14 @@ BAREBOX_CMD_END
 
 int net_store_fd;
 
+#ifdef CONFIG_NET_TFTP
 extern void TftpStart(char *);       /* Begin TFTP get */
+#endif
+#ifdef CONFIG_NET_NFS
 extern void NfsStart(char *);
+#endif
 
+#if defined(CONFIG_NET_NFS) || defined(CONFIG_NET_TFTP)
 static int
 netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
 {
@@ -188,11 +196,15 @@ netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char *argv[])
 		goto out;
 
 	switch (proto) {
+#ifdef CONFIG_NET_TFTP
 	case TFTP:
 		TftpStart(remotefile);
 		break;
+#endif
+#ifdef CONFIG_NET_NFS
 	case NFS:
 		NfsStart(remotefile);
+#endif
 	default:
 		break;
 	}
@@ -209,6 +221,7 @@ out:
 	close(net_store_fd);
 	return rcode;
 }
+#endif	/* defined(CONFIG_NET_NFS) || defined(CONFIG_NET_TFTP) */
 
 #ifdef CONFIG_NET_CDP
 
-- 
1.6.2.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2009-12-24 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-24 13:55 [PATCH 0/1] Exclude code based on config Sanjeev Premi
2009-12-24 13:55 ` Sanjeev Premi [this message]
2010-01-04 10:08   ` [PATCH 1/1] net: Exclude code based on selected protocol Sascha Hauer
2010-01-04 16:18     ` Premi, Sanjeev

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=1261662937-31474-2-git-send-email-premi@ti.com \
    --to=premi@ti.com \
    --cc=barebox@lists.infradead.org \
    /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