Re: Minimal configuration for e2fsprogs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2012-06-19, at 11:26 PM, Tony Breeds wrote:
> From 5f6a6528c93ad9b3eb878afbeab10c01802647b0 Mon Sep 17 00:00:00 2001
> From: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
> Date: Wed, 20 Jun 2012 15:04:43 +1000
> Subject: [PATCH] WiP: Add --disable-mmp
> 
> Signed-off-by: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
> ---
> 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





Attachment: PGP.sig
Description: This is a digitally signed message part


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux