On Thu,  6 Aug 2020 12:53:44 +0200
Thomas Huth <th...@redhat.com> wrote:

> Move the code to a separate function to be able to re-use it from a
> different spot later.
> 
> Reviewed-by: Claudio Imbrenda <imbre...@linux.ibm.com>
> Signed-off-by: Thomas Huth <th...@redhat.com>
> ---
>  pc-bios/s390-ccw/main.c | 99 ++++++++++++++++++++++++-----------------
>  1 file changed, 57 insertions(+), 42 deletions(-)

(...)

> @@ -62,53 +116,14 @@ unsigned int get_loadparm_index(void)
>   */
>  static bool find_subch(int dev_no)
>  {
> -    Schib schib;
>      int i, r;
> -    bool is_virtio;
>  
>      for (i = 0; i < 0x10000; i++) {
> -        blk_schid.sch_no = i;
> -        r = stsch_err(blk_schid, &schib);
> -        if ((r == 3) || (r == -EIO)) {
> +        r = is_dev_possibly_bootable(dev_no, i);

Maybe explicitly check for -ENODEV here? But no strong opinion.

> +        if (r < 0) {
>              break;
>          }

(...)

Reviewed-by: Cornelia Huck <coh...@redhat.com>


Reply via email to