• Joel Fernandes (Google)'s avatar
    pstore/ram: Simplify ramoops_get_next_prz() arguments · b05c9506
    Joel Fernandes (Google) authored
    (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: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
    Signed-off-by: default avatarKees Cook <keescook@chromium.org>
    b05c9506
ram.c 24.5 KB