Re: [PATCH for-5.2 2/6] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function

2020-08-05 Thread Cornelia Huck
On Wed, 29 Jul 2020 13:05:08 +0200
Thomas Huth  wrote:

> On 29/07/2020 10.47, Cornelia Huck wrote:
> > On Tue, 28 Jul 2020 20:37:30 +0200
> > Thomas Huth  wrote:
> >   
> >> Let's move this part of the code into a separate function to be able
> >> to use it from multiple spots later.
> >>
> >> Signed-off-by: Thomas Huth 
> >> ---
> >>  pc-bios/s390-ccw/main.c | 20 
> >>  1 file changed, 12 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> >> index 146a50760b..9b64eb0c24 100644
> >> --- a/pc-bios/s390-ccw/main.c
> >> +++ b/pc-bios/s390-ccw/main.c
> >> @@ -223,14 +223,8 @@ static void virtio_setup(void)
> >>  }
> >>  }
> >>  
> >> -int main(void)
> >> +static void ipl_boot_device(void)
> >>  {
> >> -sclp_setup();
> >> -css_setup();
> >> -boot_setup();
> >> -find_boot_device();
> >> -enable_subchannel(blk_schid);
> >> -
> >>  switch (cutype) {
> >>  case CU_TYPE_DASD_3990:
> >>  case CU_TYPE_DASD_2107:
> >> @@ -242,8 +236,18 @@ int main(void)
> >>  break;
> >>  default:
> >>  print_int("Attempting to boot from unexpected device type", 
> >> cutype);
> >> -panic("");
> >> +panic("\nBoot failed.\n");  
> > 
> > Maybe "Boot failed: no supported device type"?  
> 
> The print_int right before already talks about "unexpected device type",
> so I think the simple "Boot failed" should be enough?

Yes, as long as we don't end up with other boot failures printing the
same messages.




Re: [PATCH for-5.2 2/6] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function

2020-08-04 Thread Janosch Frank
On 7/28/20 8:37 PM, Thomas Huth wrote:
> Let's move this part of the code into a separate function to be able
> to use it from multiple spots later.
> 
> Signed-off-by: Thomas Huth 

Reviewed-by: Janosch Frank 

> ---
>  pc-bios/s390-ccw/main.c | 20 
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index 146a50760b..9b64eb0c24 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -223,14 +223,8 @@ static void virtio_setup(void)
>  }
>  }
>  
> -int main(void)
> +static void ipl_boot_device(void)
>  {
> -sclp_setup();
> -css_setup();
> -boot_setup();
> -find_boot_device();
> -enable_subchannel(blk_schid);
> -
>  switch (cutype) {
>  case CU_TYPE_DASD_3990:
>  case CU_TYPE_DASD_2107:
> @@ -242,8 +236,18 @@ int main(void)
>  break;
>  default:
>  print_int("Attempting to boot from unexpected device type", cutype);
> -panic("");
> +panic("\nBoot failed.\n");
>  }
> +}
> +
> +int main(void)
> +{
> +sclp_setup();
> +css_setup();
> +boot_setup();
> +find_boot_device();
> +enable_subchannel(blk_schid);
> +ipl_boot_device();
>  
>  panic("Failed to load OS from hard disk\n");
>  return 0; /* make compiler happy */
> 




signature.asc
Description: OpenPGP digital signature


Re: [PATCH for-5.2 2/6] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function

2020-07-29 Thread Thomas Huth
On 29/07/2020 10.47, Cornelia Huck wrote:
> On Tue, 28 Jul 2020 20:37:30 +0200
> Thomas Huth  wrote:
> 
>> Let's move this part of the code into a separate function to be able
>> to use it from multiple spots later.
>>
>> Signed-off-by: Thomas Huth 
>> ---
>>  pc-bios/s390-ccw/main.c | 20 
>>  1 file changed, 12 insertions(+), 8 deletions(-)
>>
>> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
>> index 146a50760b..9b64eb0c24 100644
>> --- a/pc-bios/s390-ccw/main.c
>> +++ b/pc-bios/s390-ccw/main.c
>> @@ -223,14 +223,8 @@ static void virtio_setup(void)
>>  }
>>  }
>>  
>> -int main(void)
>> +static void ipl_boot_device(void)
>>  {
>> -sclp_setup();
>> -css_setup();
>> -boot_setup();
>> -find_boot_device();
>> -enable_subchannel(blk_schid);
>> -
>>  switch (cutype) {
>>  case CU_TYPE_DASD_3990:
>>  case CU_TYPE_DASD_2107:
>> @@ -242,8 +236,18 @@ int main(void)
>>  break;
>>  default:
>>  print_int("Attempting to boot from unexpected device type", cutype);
>> -panic("");
>> +panic("\nBoot failed.\n");
> 
> Maybe "Boot failed: no supported device type"?

The print_int right before already talks about "unexpected device type",
so I think the simple "Boot failed" should be enough?

>>  }
>> +}
>> +
>> +int main(void)
>> +{
>> +sclp_setup();
>> +css_setup();
>> +boot_setup();
>> +find_boot_device();
>> +enable_subchannel(blk_schid);
>> +ipl_boot_device();
>>  
>>  panic("Failed to load OS from hard disk\n");
>>  return 0; /* make compiler happy */
> 
> Anyway,
> Reviewed-by: Cornelia Huck 

Thanks!

 Thomas




Re: [PATCH for-5.2 2/6] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function

2020-07-29 Thread Claudio Imbrenda
On Tue, 28 Jul 2020 20:37:30 +0200
Thomas Huth  wrote:

> Let's move this part of the code into a separate function to be able
> to use it from multiple spots later.
> 
> Signed-off-by: Thomas Huth 
> ---
>  pc-bios/s390-ccw/main.c | 20 
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index 146a50760b..9b64eb0c24 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -223,14 +223,8 @@ static void virtio_setup(void)
>  }
>  }
>  
> -int main(void)
> +static void ipl_boot_device(void)
>  {
> -sclp_setup();
> -css_setup();
> -boot_setup();
> -find_boot_device();
> -enable_subchannel(blk_schid);
> -
>  switch (cutype) {
>  case CU_TYPE_DASD_3990:
>  case CU_TYPE_DASD_2107:
> @@ -242,8 +236,18 @@ int main(void)
>  break;
>  default:
>  print_int("Attempting to boot from unexpected device type",
> cutype);
> -panic("");
> +panic("\nBoot failed.\n");
>  }
> +}
> +
> +int main(void)
> +{
> +sclp_setup();
> +css_setup();
> +boot_setup();
> +find_boot_device();
> +enable_subchannel(blk_schid);
> +ipl_boot_device();
>  
>  panic("Failed to load OS from hard disk\n");
>  return 0; /* make compiler happy */

Reviewed-by: Claudio Imbrenda 



Re: [PATCH for-5.2 2/6] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function

2020-07-29 Thread Cornelia Huck
On Tue, 28 Jul 2020 20:37:30 +0200
Thomas Huth  wrote:

> Let's move this part of the code into a separate function to be able
> to use it from multiple spots later.
> 
> Signed-off-by: Thomas Huth 
> ---
>  pc-bios/s390-ccw/main.c | 20 
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
> index 146a50760b..9b64eb0c24 100644
> --- a/pc-bios/s390-ccw/main.c
> +++ b/pc-bios/s390-ccw/main.c
> @@ -223,14 +223,8 @@ static void virtio_setup(void)
>  }
>  }
>  
> -int main(void)
> +static void ipl_boot_device(void)
>  {
> -sclp_setup();
> -css_setup();
> -boot_setup();
> -find_boot_device();
> -enable_subchannel(blk_schid);
> -
>  switch (cutype) {
>  case CU_TYPE_DASD_3990:
>  case CU_TYPE_DASD_2107:
> @@ -242,8 +236,18 @@ int main(void)
>  break;
>  default:
>  print_int("Attempting to boot from unexpected device type", cutype);
> -panic("");
> +panic("\nBoot failed.\n");

Maybe "Boot failed: no supported device type"?

>  }
> +}
> +
> +int main(void)
> +{
> +sclp_setup();
> +css_setup();
> +boot_setup();
> +find_boot_device();
> +enable_subchannel(blk_schid);
> +ipl_boot_device();
>  
>  panic("Failed to load OS from hard disk\n");
>  return 0; /* make compiler happy */

Anyway,
Reviewed-by: Cornelia Huck 




[PATCH for-5.2 2/6] pc-bios/s390-ccw: Move ipl-related code from main() into a separate function

2020-07-28 Thread Thomas Huth
Let's move this part of the code into a separate function to be able
to use it from multiple spots later.

Signed-off-by: Thomas Huth 
---
 pc-bios/s390-ccw/main.c | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 146a50760b..9b64eb0c24 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -223,14 +223,8 @@ static void virtio_setup(void)
 }
 }
 
-int main(void)
+static void ipl_boot_device(void)
 {
-sclp_setup();
-css_setup();
-boot_setup();
-find_boot_device();
-enable_subchannel(blk_schid);
-
 switch (cutype) {
 case CU_TYPE_DASD_3990:
 case CU_TYPE_DASD_2107:
@@ -242,8 +236,18 @@ int main(void)
 break;
 default:
 print_int("Attempting to boot from unexpected device type", cutype);
-panic("");
+panic("\nBoot failed.\n");
 }
+}
+
+int main(void)
+{
+sclp_setup();
+css_setup();
+boot_setup();
+find_boot_device();
+enable_subchannel(blk_schid);
+ipl_boot_device();
 
 panic("Failed to load OS from hard disk\n");
 return 0; /* make compiler happy */
-- 
2.18.1