public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau@advansee.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 01/10] imx: Homogenize and fix fuse register definitions
Date: Fri, 26 Apr 2013 10:03:25 +0200 (CEST)	[thread overview]
Message-ID: <236720082.263453.1366963405447.JavaMail.root@advansee.com> (raw)
In-Reply-To: <517A2D43.10801@denx.de>

Hi Stefano,

On Friday, April 26, 2013 9:31:15 AM, Stefano Babic wrote:
> On 23/04/2013 22:17, Beno?t Th?baudeau wrote:
> > IIM:
> >  - Homogenize prg_p naming (the reference manuals are not always
> >  self-consistent
> >    for that).
> >  - Add missing SCSx and bank registers.
> >  - Fix the number of banks on i.MX53.
> > 
> > OCOTP:
> >  - Rename iim to ocotp in order to avoid confusion.
> >  - Rename fuse_data to read_fuse_data, and sticky to sw_sticky, according
> >  to the
> >    reference manual.
> >  - Merge the existing spinoff gp1 fuse definition on i.MX6.
> >  - Fix the number of banks on i.MX6.
> > 
> > Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau@advansee.com>
> > ---
> 
> Hi Beno?t.
> 
> I would like to apply your patches and I see some warning from
> clearpatch. Some of them are very annoying and I think to ignore them,
> but before doing that I ask to ML about it. It seems to me that
> checkpatch make stonger tests as in the past, and I do not know if all
> of them are meaningful. Or better, I do not think they are.

Indeed, I have noticed that too since last release. I ignored those on purpose
because they all seem wrong.

> Here the warnings:
> 
> CHECK: Alignment should match open parenthesis
> #589: FILE: common/cmd_fuse.c:77:
> +	if (argc < 2 || strtou32(argv[0], 0, &bank) ||
> +			strtou32(argv[1], 0, &word))
> 
> CHECK: Alignment should match open parenthesis
> #637: FILE: common/cmd_fuse.c:125:
> +			printf("Programming bank %u word 0x%.8x to 0x%.8x...\n",
> +					bank, word, val);
> 
> 
> I would say that this enforcement is crap. The code in the patch is easy
> to read. I want to ignore this warning.

Yes, and that's usual Linux coding style, which is the official coding style for
U-Boot as well.

I'd say that the rule here should be to indent such lines at least at the
position of the opening parenthesis of the previous line, and that the
indentation should be at least 1 or 2 more tabs than on the previous line, which
is the case in my code above.

> WARNING: quoted string split across lines
> #653: FILE: common/cmd_fuse.c:141:
> +			printf("Overriding bank %u word 0x%.8x with "
> +					"0x%.8x...\n", bank, word, val);
> 
> 
> Again, this is the solution when a line is too long. checkpatch
> complains if a line is too long, and in case of static string complains
> that is splitted. This is too much, I would like to ignore also this one.

Yes. The purpose of not splitting long literal strings is only grep-ability of
error messages. Here, it is neither an error message nor a constant sub-string
of it that is split away.

> CHECK: Alignment should match open parenthesis
> #1102: FILE: drivers/misc/fsl_iim.c:118:
> +	if (bank >= ARRAY_SIZE((*regs)->bank) ||
> +			word >= ARRAY_SIZE((*regs)->bank[0].word) ||
> 
> Ditto
> 
> WARNING: line over 80 characters
> #1190: FILE: drivers/misc/fsl_iim.c:206:
> +		puts("fsl_iim fuse_sense(): Explicit sense cycle did not complete\n");
> 
> 
> Ok, this is the one that must be fixed, even if then we have the warning
> with "quoted string"

Initially, this line was less than 80 characters because I had split the string.
But checkpatch complained about the literal string being split, so I kept it on
a single line, which makes sense here for grep-ability: It is an error message,
and all parts of this string are constant (i.e. not printf-ed). And Scott Wood
had already made me do such changes in the past. What should I do?

Would it be possible to have an official detailed coding style everybody agrees
on somewhere? Apparently, the rules are not the same for all custodians.

> WARNING: line over 80 characters
> #2017: FILE: drivers/misc/mxc_ocotp.c:8:
> + *
> http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/tree/drivers/misc/imx_otp.c?h=imx_v2009.08_1.1.0&id=9aa74e6,
> 
> Ditto

I did not know what to do with this one. As it is a URL, I considered it as
unsplittable. So should the 80-character limit really apply here too?

> CHECK: Alignment should match open parenthesis
> #2088: FILE: drivers/misc/mxc_ocotp.c:79:
> +	if (bank >= ARRAY_SIZE((*regs)->bank) ||
> +			word >= ARRAY_SIZE((*regs)->bank[0].fuse_regs) >> 2 ||
> 
> I will not care about this.

OK.

Best regards,
Beno?t

  reply	other threads:[~2013-04-26  8:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-23 20:17 [U-Boot] [PATCH v4 01/10] imx: Homogenize and fix fuse register definitions Benoît Thébaudeau
2013-04-23 20:17 ` [U-Boot] [PATCH v4 02/10] imx: Add useful fuse definitions Benoît Thébaudeau
2013-04-28  9:10   ` Stefano Babic
2013-04-23 20:17 ` [U-Boot] [PATCH v4 03/10] Add fuse API and commands Benoît Thébaudeau
2013-04-28  9:10   ` Stefano Babic
2013-04-23 20:17 ` [U-Boot] [PATCH v4 04/10] Add fsl_iim driver Benoît Thébaudeau
2013-04-28  9:11   ` Stefano Babic
2013-04-23 20:17 ` [U-Boot] [PATCH v4 05/10] mpc: iim: Switch to common fsl_iim Benoît Thébaudeau
2013-04-28  9:11   ` Stefano Babic
2013-04-23 20:17 ` [U-Boot] [PATCH v4 06/10] mx51evk: Enable support for iim Benoît Thébaudeau
2013-04-28  9:11   ` Stefano Babic
2013-04-23 20:17 ` [U-Boot] [PATCH v4 07/10] Add mxc_ocotp driver Benoît Thébaudeau
2013-04-28  9:12   ` Stefano Babic
2013-04-23 20:17 ` [U-Boot] [PATCH v4 08/10] mx6qsabrelite: Enable support for ocotp Benoît Thébaudeau
2013-04-28  9:12   ` Stefano Babic
2013-04-23 20:17 ` [U-Boot] [PATCH v4 09/10] nitrogen6x: " Benoît Thébaudeau
2013-04-28  9:12   ` Stefano Babic
2013-04-23 20:17 ` [U-Boot] [PATCH v4 10/10] imx: Document fuse assignments for MAC addresses Benoît Thébaudeau
2013-04-28  9:10   ` Stefano Babic
2013-04-24 14:44 ` [U-Boot] [PATCH v4 01/10] imx: Homogenize and fix fuse register definitions Benoît Thébaudeau
2013-04-25  7:24 ` Stefano Babic
2013-04-26  7:31 ` Stefano Babic
2013-04-26  8:03   ` Benoît Thébaudeau [this message]
2013-04-26  8:16     ` Stefano Babic
2013-04-28  9:09 ` Stefano Babic

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=236720082.263453.1366963405447.JavaMail.root@advansee.com \
    --to=benoit.thebaudeau@advansee.com \
    --cc=u-boot@lists.denx.de \
    /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