lkml.org 
[lkml]   [2014]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [rtc-linux] [PATCH 2/2] Allow to override the hctosys RTC using a kernel parameter
On Mon, 07 Jul 2014 13:50:12 +0200 Roman Fietze <roman.fietze@telemotive.de> wrote:

> This change allows to overwrite the default of the hctosys RTC
> specified in the kernnel configuration by using a kernel parameter in
> the form of
>
> hctosys=rtc<n>
>

Seems reasonable to me, but...

> +char rtc_hctosys_device[RTC_HCTOSYS_DEVICE_SIZE] = CONFIG_RTC_HCTOSYS_DEVICE;
> +
> +static int __init parse_hctosys(char *str)
> +{
> + if (!str)
> + return -EINVAL;
> +
> + if (strlen(str) >= RTC_HCTOSYS_DEVICE_SIZE)
> + return -ENOMEM;
> +
> + strcpy(rtc_hctosys_device, str);

Can we just strdup() this thing and do away with all this futzing around
with the maximum string length?

> + return 0;
> +}



\
 
 \ /
  Last update: 2014-07-16 02:41    [W:0.118 / U:0.380 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site