Re: [PATCH] MIPS: move mips_{set,get}_machine_name() to a more generic place

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2013.04.11. 8:34 keltezéssel, John Crispin írta:
> Previously this functionality was only available to users of the mips_machine
> api. Moving the code to prom.c allows us to also add a OF wrapper.
> 
> Signed-off-by: John Crispin <blogic@xxxxxxxxxxx>
> ---
>  arch/mips/include/asm/mips_machine.h |    4 ----
>  arch/mips/include/asm/prom.h         |    3 +++
>  arch/mips/kernel/mips_machine.c      |   20 --------------------
>  arch/mips/kernel/proc.c              |    1 +
>  arch/mips/kernel/prom.c              |   33 +++++++++++++++++++++++++++++++++
>  5 files changed, 37 insertions(+), 24 deletions(-)
> 

<...>

> diff --git a/arch/mips/kernel/prom.c b/arch/mips/kernel/prom.c
> index 028f6f8..9d653e1 100644
> --- a/arch/mips/kernel/prom.c
> +++ b/arch/mips/kernel/prom.c
> @@ -23,6 +23,21 @@
>  #include <asm/page.h>
>  #include <asm/prom.h>
>  
> +static char mips_machine_name[64] = "Unknown";
> +
> +__init void mips_set_machine_name(const char *name)
> +{
> +	if (name == NULL)
> +		return;
> +
> +	snprintf(mips_machine_name, sizeof(mips_machine_name), name);

Any specific reason why you are using snprintf? If someone would call this with
format characters in the 'name' that would cause weird things.

-Gabor


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux