History log of /drivers/mtd/ubi/attach.c
Revision Date Author Comments
4d525145a6f12b8835795beb833444d3da48fd05 29-Dec-2013 Julia Lawall <Julia.Lawall@lip6.fr> UBI: fix error return code

Set the return variable to an error code as done elsewhere in the function.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: Richard Weinberger <richard@nod.at>
55b80c409a1368b8dff3c78943101bccb0ea3aa1 28-Sep-2013 Richard Genoud <richard.genoud@gmail.com> UBI: simplify image sequence test

The test:
if (!a && b)
a = b;
can be symplified in:
if (!a)
a = b;

And there's no need to test if ubi->image_seq is not null, because if it is,
it is set to image_seq.
So, we just test if image_seq is not null.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
4b3e0a25aa5518892ec8dbfafdd6a57789aa0c22 28-Sep-2013 Richard Weinberger <richard@nod.at> UBI: Call scan_all() with correct offset in error case

If we find an invalid fastmap we have to scan from the very beginning.
Otherwise we leak the first 64 PEBs.

Reported-and-tested-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
64575574f26d7969713ede9bde750c979da4037e 28-Nov-2012 Ezequiel Garcia <elezegarcia@gmail.com> UBI: introduce helpers dbg_chk_{io, gen}

With this patch code is a bit more readable and there's no
generated code or functionality impact.
Furthermore, this abstracts implementation details and
will allow to change ubi_debug_info in a less invasive way.

Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
d125a753425b9de3c251df519e521024c79c663d 26-Oct-2012 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> UBI: do not allocate the memory unnecessarily

UBI reserves an LEB sized buffer for various needs. We can use this buffer
while scanning, instead of allocating another one. This patch was originally
created by Jan Luebbe <jlu@pengutronix.de>, but then he dropped it and I picked
up and tweaked a little bit.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
dac6e2087a4143cfc3fc1017bf24b9d4be3055b7 26-Sep-2012 Richard Weinberger <richard@nod.at> UBI: Add fastmap stuff to attach.c

- Export compare_lebs() as fastmap needs this function.
- Implement fastmap scan logic.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
55393ba1bdedc5ded79b34b4cc08898a7776cddb 31-Aug-2012 Brian Norris <computersforpeace@gmail.com> UBI: fix trivial typo 'it' => 'is'

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
719bb84017fcfc949a77e150dd5b045e90a4ebc9 27-Aug-2012 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> UBI: print less

UBI currently prints a lot of information when it mounts a volume, which
bothers some people. Make it less chatty - print only important information
by default.

Get rid of 'dbg_msg()' macro completely.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
e28453bbb76c290d67eb28b3ff6875a6519c3998 27-Aug-2012 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> UBI: use pr_ helper instead of printk

Use 'pr_err()' instead of 'printk(KERN_ERR', etc.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
049333cecbde11988c49ad4d7861eefbc3534422 27-Aug-2012 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> UBI: comply with coding style

Join all the split printk lines in order to stop checkpatch complaining.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
193819cf2e6e395b1e1be2d36785dc5563a6edca 22-Aug-2012 Matthieu CASTET <matthieu.castet@parrot.com> UBI: erase free PEB with bitflip in EC header

Without this patch, these PEB are not scrubbed until we put data in them.
Bitflip can accumulate latter and we can loose the EC header (but VID header
should be intact and allow to recover data).

Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
Cc: stable@vger.kernel.org
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
6dd3bc7e6032ffb392477fadca77172c1c9e346b 16-May-2012 Joel Reardon <joel@clambassador.com> UBI: add volume id struct ubi_ainf_peb

This patch adds the volume id to struct ubi_ainf_peb when scanning the LEBs at
startup. PEBs now added to the erase queue will know their original LEB number
and volume id, if available, and will be -1 otherwise (for instance, if the VID
header is unreadable).

This was tested by creating an ubi device with 3 volumes and disabiling the
ubi_thread's do_work functionality. The different ubi volumes were formatted
to ubifs and had files created and erased. The ubi modules was reloaded and
the list of LEB's added to the erased list was outputted, confirming the
volume ids and LEB numbers were appropriate.

Signed-off-by: Joel Reardon <reardonj@inf.ethz.ch>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
ae4a8104e3d913d75ad72b43ea112968c14bd5de 18-May-2012 Artem Bityutskiy <artem.bityutskiy@linux.intel.com> UBI: rename scan.c to attach.c

Finally, rename the scan.c file. Now adding fastmap support won't look that
hacky anymore.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>