lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110305120713.GD30187@opensource.wolfsonmicro.com>
Date:	Sat, 5 Mar 2011 12:07:13 +0000
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	MyungJoo Ham <myungjoo.ham@...sung.com>
Cc:	linux-kernel@...r.kernel.org, rtc-linux@...glegroups.com,
	Alessandro Zummo <a.zummo@...ertech.it>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	kyungmin.park@...sung.com, myungjoo.ham@...il.com
Subject: Re: [rtc-linux] [PATCH 2/2] MAX8997/8966 RTC Driver Initial Release

On Fri, Mar 04, 2011 at 04:48:44PM +0900, MyungJoo Ham wrote:

> +static void tm_to_data(struct rtc_time *tm, u8 *data)
> +{
> +	data[RTC_SEC] = bin2bcd(tm->tm_sec) & 0x7f;
> +	data[RTC_MIN] = bin2bcd(tm->tm_min) & 0x7f;
> +	data[RTC_HOUR] = bin2bcd(tm->tm_hour) & 0x3f;
> +	data[RTC_WEEKDAY] = wday_kernel_to_8997(tm->tm_wday) & 0x7f;
> +	data[RTC_MONTH] = bin2bcd(tm->tm_mon) & 0x1f;
> +	data[RTC_YEAR] = bin2bcd((tm->tm_year > 100) ? (tm->tm_year - 100) : 0)
> +			& 0x7f;
> +	data[RTC_MONTHDAY] = bin2bcd(tm->tm_mday) & 0x3f;
> +
> +	if (tm->tm_year < 100) /* Prior 2000 */
> +		pr_warn("MAX8997 RTC cannot handle the year %d. "
> +				"Assume it's 2000.\n", 1900 + tm->tm_year);

It seems like an attempt to set an unsupported year should return an
error rather than just displaying a warning (though the warning is
useful so the user can figure out what went wrong).

> +MODULE_DESCRIPTION("MAXIM 8997/8966 RTC Driver");
> +MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@...sung.com>");
> +MODULE_LICENSE("GPL");

A MODULE_ALIAS() would allow the driver to be automatically loaded when
built as a module.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ