Thread (34 messages) 34 messages, 4 authors, 2012-08-03

Re: Minimal configuration for e2fsprogs

From: Andreas Dilger <hidden>
Date: 2012-06-20 14:14:23

On 2012-06-19, at 11:26 PM, Tony Breeds wrote:
quoted hunk ↗ jump to hunk
From 5f6a6528c93ad9b3eb878afbeab10c01802647b0 Mon Sep 17 00:00:00 2001
From: Tony Breeds <redacted>
Date: Wed, 20 Jun 2012 15:04:43 +1000
Subject: [PATCH] WiP: Add --disable-mmp

Signed-off-by: Tony Breeds <redacted>
---
configure.in         |   17 +++++++++++++++++
debugfs/debugfs.c    |    5 +++++
debugfs/set_fields.c |    5 +++++
lib/config.h.in      |    3 +++
lib/ext2fs/ext2fs.h  |   23 ++++++++++++-----------
lib/ext2fs/mmp.c     |   24 ++++++++++++++++++++++++
6 files changed, 66 insertions(+), 11 deletions(-)
diff --git a/lib/ext2fs/mmp.c b/lib/ext2fs/mmp.c
index bb3772d..a783698 100644
--- a/lib/ext2fs/mmp.c
+++ b/lib/ext2fs/mmp.c
@@ -33,6 +33,9 @@
errcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf)
{
+#ifndef CONFIG_MMP
+	return EXT2_ET_OP_NOT_SUPPORTED;
+#endif
	struct mmp_struct *mmp_cmp;
	errcode_t retval = 0;
I suspect that this will cause warnings from code analysis tools about
dead code, and bloat the code if the compiler isn't optimizing heavily.
Better to put the whole function body inside "#ifdef CONFIG_MMP" and
the "return EXT2_ET_OP_NOT_SUPPORTED" in the #else clause.

Cheers, Andreas




Attachments

  • PGP.sig [application/pgp-signature] 235 bytes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help