mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Smirnov <alllecs@yandex.ru>
Cc: barebox@lists.infradead.org
Subject: Re: [RFC V2 2/3] ddr_spd: add routune for printing SPD contents in human readable format
Date: Thu, 25 Jun 2015 08:32:51 +0200	[thread overview]
Message-ID: <20150625063251.GA3795@pengutronix.de> (raw)
In-Reply-To: <1435150649-10266-3-git-send-email-alllecs@yandex.ru>

On Wed, Jun 24, 2015 at 03:57:28PM +0300, Alexander Smirnov wrote:
> Signed-off-by: Alexander Smirnov <alllecs@yandex.ru>
> ---
> +void prin(uint8_t *record)

Please use a more meaningful name.

> +{
> +	int highestCAS = 0;
> +	int cas[256];
> +	int i, i_i, k, x, y;
> +	int ddrclk, tbits, pcclk;
> +	int trcd, trp, tras;
> +	int ctime;
> +	uint8_t parity;
> +	char *ref;
> +
> +	ctime = ddr2_sdram_ctime(record[9]);
> +	ddrclk = 2 * (1000 / ctime) * 100;
> +	tbits = (record[7] << 8) + record[6];
> +	if ((record[11] & 0x03) == 1) {
> +		tbits = tbits - 8;
> +	}
> +	pcclk = ddrclk * tbits / 8;
> +	pcclk = pcclk - (pcclk % 100);
> +	i_i = (record[3] & 0x0f) + (record[4] & 0x0f) - 17;
> +	k = ((record[5] & 0x7) + 1) * record[17];
> +	trcd = ((record[29] >> 2) + ((record[29] & 3) * 0.25)) / ctime * 100;
> +	trp = ((record[27] >> 2) + ((record[27] & 3) * 0.25)) / ctime * 100;
> +	tras = record[30] * 100 / ctime ;
> +	x = (int)(ctime / 100);
> +	y = (ctime - (int)((ctime / 100) * 100)) / 10;
> +
> +	for (i_i = 2; i_i < 7; i_i++) {
> +		if (record[18] & (1 << i_i)) {
> +			highestCAS = i_i;
> +		cas[highestCAS]++;
> +		}

indention broken here.

> +	}
> +
> +	printf("---=== SPD EEPROM Information ===---\n");
> +	printf("EEPROM Checksum of bytes 0-62\t\t\t OK (0x%0X)\n", record[63]);
> +	printf("# of bytes written to SDRAM EEPROM\t\t %d\n", record[0]);
> +	printf("Total number of bytes in EEPROM\t\t\t %d\n", 1 << record[1]);
> +
> +	if (record[2] < 11) {
> +		printf("Fundamental Memory type\t\t\t\t %s\n", type_list[record[2]]);
> +	} else {
> +		printf("Warning: unknown memory type (%02x)\n", record[2]);
> +	}

Please drop unnecessary braces here and elsewhere.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-06-25  6:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-24 12:57 [RFC V2 0/3] add decode command (SPD EEPROM data decoder) Alexander Smirnov
2015-06-24 12:57 ` [RFC V2 1/3] common: move DDR_SPD to common/Kconfig Alexander Smirnov
2015-06-25  9:32   ` Renaud Barbier
2015-06-24 12:57 ` [RFC V2 2/3] ddr_spd: add routune for printing SPD contents in human readable format Alexander Smirnov
2015-06-25  6:32   ` Sascha Hauer [this message]
2015-06-24 12:57 ` [RFC V2 3/3] add decode command (SPD EEPROM data decoder) Alexander Smirnov
2015-06-24 16:50   ` Antony Pavlov
2015-06-25  6:35   ` Sascha Hauer

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=20150625063251.GA3795@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=alllecs@yandex.ru \
    --cc=barebox@lists.infradead.org \
    /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