[PATCH 22/39] net: Drop #ifdef in parse_args()

Simon Glass sjg at chromium.org
Tue Nov 19 14:18:27 CET 2024


Use IS_ENABLED() to avoid an extra build path.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 cmd/net.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/cmd/net.c b/cmd/net.c
index f1b520143df..03b33aa1f20 100644
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -366,13 +366,13 @@ static int parse_args(enum proto_t proto, int argc, char *const argv[],
 		}
 		break;
 
-#ifdef CONFIG_CMD_TFTPPUT
 	case 4:
-		if (parse_addr_size(argv, addrp, sizep))
-			return 1;
-		*fnamep = argv[3];
-		break;
-#endif
+		if (IS_ENABLED(CONFIG_CMD_TFTPPUT)) {
+			if (parse_addr_size(argv, addrp, sizep))
+				return 1;
+			*fnamep = argv[3];
+			break;
+		}
 	default:
 		return 1;
 	}
-- 
2.34.1



More information about the U-Boot mailing list