[PATCH 1/3] s390: add variable command line size

Sven Schnelle svens at linux.ibm.com
Tue Dec 7 08:06:58 PST 2021


Hi Philipp,

Philipp Rudo <prudo at redhat.com> writes:

>> diff --git a/kexec/arch/s390/kexec-image.c b/kexec/arch/s390/kexec-image.c
>> index 3c24fdfe3c7c..7747d02399db 100644
>> --- a/kexec/arch/s390/kexec-image.c
>> +++ b/kexec/arch/s390/kexec-image.c
>> @@ -25,7 +25,7 @@
>>  #include <fcntl.h>
>>  
>>  static uint64_t crash_base, crash_end;
>> -static char command_line[COMMAND_LINESIZE];
>> +static char *command_line;
>
> isn't this the perfect opportunity to get rid of this global variable
> and...
>
>>  static void add_segment_check(struct kexec_info *info, const void *buf,
>>  			      size_t bufsz, unsigned long base, size_t memsz)
>> @@ -38,11 +38,16 @@ static void add_segment_check(struct kexec_info *info, const void *buf,
>>  
>>  int command_line_add(const char *str)
>
> ... simply pass the pointer as an argument ;)

The reason for it being global is that command_line_add() might get
called multiple times. But yes, we could move that variable scope into
the calling function.

Thanks
Sven



More information about the kexec mailing list