mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: rtc-linux@googlegroups.com
Cc: Roman Fietze <roman.fietze@telemotive.de>,
	linux-kernel@vger.kernel.org,
	Alessandro Zummo <a.zummo@towertech.it>
Subject: Re: [rtc-linux] [PATCH 2/2] Allow to override the hctosys RTC using a kernel parameter
Date: Tue, 15 Jul 2014 16:15:59 -0700	[thread overview]
Message-ID: <20140715161559.c142128556ce4ade8bcdc514@linux-foundation.org> (raw)
In-Reply-To: <2398890.hEQ05gdLB8@rfietze>

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;
> +}


  parent reply	other threads:[~2014-07-15 23:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-07 11:30 [PATCH 1/2] " Roman Fietze
2014-07-07 11:50 ` [PATCH 2/2] " Roman Fietze
2014-07-07 13:01   ` Alexander Holler
2014-07-15 23:15   ` Andrew Morton [this message]
2014-07-07 12:20 ` [rtc-linux] [PATCH 1/2] " Alexander Holler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140715161559.c142128556ce4ade8bcdc514@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roman.fietze@telemotive.de \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome