OSDN Git Service

pstore/ram: Simplify ramoops_get_next_prz() arguments
authorJoel Fernandes (Google) <joel@joelfernandes.org>
Sat, 3 Nov 2018 23:38:17 +0000 (16:38 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 4 Dec 2018 00:52:35 +0000 (16:52 -0800)
commitb05c950698fe1edb1d67a00ecd034754e7dad8bb
tree6212516bd7f26234b727167a311d82079ba8c2ae
parentf0f23e5469dc80b482d985898a930be0e249a162
pstore/ram: Simplify ramoops_get_next_prz() arguments

(1) remove type argument from ramoops_get_next_prz()

Since we store the type of the prz when we initialize it, we no longer
need to pass it again in ramoops_get_next_prz() since we can just use
that to setup the pstore record. So lets remove it from the argument list.

(2) remove max argument from ramoops_get_next_prz()

Looking at the code flow, the 'max' checks are already being done on
the prz passed to ramoops_get_next_prz(). Lets remove it to simplify
this function and reduce its arguments.

(3) further reduce ramoops_get_next_prz() arguments by passing record

Both the id and type fields of a pstore_record are set by
ramoops_get_next_prz(). So we can just pass a pointer to the pstore_record
instead of passing individual elements. This results in cleaner more
readable code and fewer lines.

In addition lets also remove the 'update' argument since we can detect
that. Changes are squashed into a single patch to reduce fixup conflicts.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
fs/pstore/ram.c