[PATCH v4 2/4] ubi-utils: ubidump: add libdump

Artem Bityutskiy dedekind1 at gmail.com
Fri Oct 3 07:53:45 PDT 2014


A small nit-pick.

On Tue, 2014-09-30 at 12:08 +0800, hujianyang wrote:
> +#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
> +#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
> +
> +#define min_t(t,x,y) ({ \
> +	typeof((x)) _x = (x); \
> +	typeof((y)) _y = (y); \
> +	(_x < _y) ? _x : _y; \
> +})

These ones do not look like they are in any way specific to the UBI
dumping library.

In fact, we already have these in mkfs.ubifs/defs.h, which is also not
very good.

Would you please instead use "include/common.h". Put the ALIGN and min_t
definitions there, and include that file from "libdump.h"?

As a completely independent patch, you could also clean things up by
removing the definitions from 'mkfs.ubifs/defs.h' and using
'include/common.h' in mkfs.ubifs too.





More information about the linux-mtd mailing list