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]
Date:	Fri, 04 Mar 2011 00:58:52 -0800
From:	Joe Perches <joe@...ches.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: [PATCH 2/2] MAX8997/8966 RTC Driver Initial Release

On Fri, 2011-03-04 at 16:48 +0900, MyungJoo Ham wrote:
> This patch adds support for RTC functionality for MAX8997/8966 chips.

just trivial comments here too.

> diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
[]
> +static void __maybe_unused dump(struct rtc_data *rtc)
> +{
> +	int i, j;
> +	char buf[256];
> +	char *ptr;
> +	u8 val;
> +
> +	for (i = 0; i < 3; i++) {
> +		ptr = buf;
> +		ptr += sprintf(ptr, "[%2.2xh] ", i * 16);
> +		for (j = 0; j < 16; j++) {
> +			max8997_read_reg(rtc->i2c, i * 16 + j, &val);
> +			ptr += sprintf(ptr, "%2.2x ", val);
> +		}
> +		pr_info("%s\n", buf);
> +	}
> +}

It might be better to use a loop to read all the registers
and then print_hex_dump.  Something like:

static void __maybe_unused dump(struct rtc_data *rtc)
{
	int i;
	u8 buf[48];

	for (i = 0; i < 48; i++)
		max8997_read_reg(rtc->i2c, i, &buf[i]);
	print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1,
		       buf, sizeof(buf), false);
}



--
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