]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit6fea810ab2c0b95bf7b818b3d09e04d483a5f6e8
tree6212516bd7f26234b727167a311d82079ba8c2ae
parent339a1aa6fb13667cb9d98bd2abaf9f1e8406f81f
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