public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Jordan Justen <jordan.l.justen@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>,
	edk2-devel-01 <edk2-devel@lists.01.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH 1/8] ArmPlatformPkg/NorFlashDxe: correct NumOfLba vararg type in EraseBlocks()
Date: Mon, 22 May 2017 18:50:21 +0100	[thread overview]
Message-ID: <20170522175021.GL1657@bivouac.eciton.net> (raw)
In-Reply-To: <149521314566.21878.13927782008260700274@jljusten-skl>

On Fri, May 19, 2017 at 09:59:06AM -0700, Jordan Justen wrote:
> On 2017-05-19 03:07:56, Leif Lindholm wrote:
> > On Thu, May 18, 2017 at 01:44:58PM -0700, Jordan Justen wrote:
> > > On 2017-05-18 12:29:09, Laszlo Ersek wrote:
> > > > On 05/18/17 19:21, Jordan Justen wrote:
> > > > > On 2017-05-18 08:04:20, Laszlo Ersek wrote:
> > > > >>      // All blocks must be within range
> > > > >> -    DEBUG ((DEBUG_BLKIO, "FvbEraseBlocks: Check if: ( StartingLba=%ld + NumOfLba=%d - 1 ) > LastBlock=%ld.\n", Instance->StartLba + StartingLba, NumOfLba, Instance->Media.LastBlock));
> > > > >> +    DEBUG ((
> > > > >> +      DEBUG_BLKIO,
> > > > >> +      "FvbEraseBlocks: Check if: ( StartingLba=%ld + NumOfLba=%Lu - 1 ) > LastBlock=%ld.\n",
> > > > > 
> > > > > Notably this is still > 80 columns. Maybe?
> > > > > 
> > > > >       "FvbEraseBlocks: Check if: ( StartingLba=%ld + NumOfLba=%Lu - 1 ) "
> > > > >       "> LastBlock=%ld.\n",
> > > > 
> > > > This file ("ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashFvbDxe.c") has
> > > > extremely long lines, the longest one (line 774) has 172 columns. I
> > > > broke up the above DEBUG so that it would at least fit in 120 chars per
> > > > line (which is the "second level" recommendation in the coding spec).
> > > 
> > > Personally, I don't agree with that secondary 120 char rule. If we
> > > ever get the style guide into an 'open source' process, I'd like to
> > > suggest removing it. (But, it'll probably get shot down. :\ )
> > 
> > Oh, I'm all for that one. And the style guide is definitely in need of
> > a shake-up.
> > 
> > But I consider violating line length restrictions less bad than making
> > user-(or in this case developer)-visible strings harder to search for.
> 
> While of less concern, I would say the style guide should recommend
> that logged debug messages should attempt to be less than 80 chars.
> That could help here.

Yes - had that string appeared as a new entity (instead of a
modification of existing code, with Laszlo being the good citizen to
make sure the modified lines complied as well as possible), that would
most likely have been my feedback.

> > > Ah. I guess it is fine for a package maintainer to occasionally decide
> > > to bend the rules for their package.
> > 
> > For this to be bending, it would require the 120-character rule to not
> > exist.
> 
> Yeah. It is very silly to say, we prefer 80 chars, but if it's too
> hard then 120 can be used. :)
> 
> The latest coding standard says: "Preferably, limit line lengths to 80
> columns or less. When this doesn’t leave sufficient space for a good
> postfix style comment, extend the line to a total of 120 columns."
> 
> This seems to imply that the extension beyond 80 chars is reserved for
> postfix comments. This seems like a poor reason to push past 80. It
> would be better to comment above the line instead.

Most definitely.

/
    Leif
 


  reply	other threads:[~2017-05-22 17:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 15:04 [PATCH 0/8] several Pkgs: FVB driver: correct NumOfLba vararg type in EraseBlocks() Laszlo Ersek
2017-05-18 15:04 ` [PATCH 1/8] ArmPlatformPkg/NorFlashDxe: " Laszlo Ersek
2017-05-18 15:12   ` Ard Biesheuvel
2017-05-18 17:21   ` Jordan Justen
2017-05-18 19:29     ` Laszlo Ersek
2017-05-18 20:44       ` Jordan Justen
2017-05-19 10:07         ` Leif Lindholm
2017-05-19 16:59           ` Jordan Justen
2017-05-22 17:50             ` Leif Lindholm [this message]
2017-05-18 22:11   ` Laszlo Ersek
2017-05-18 15:04 ` [PATCH 2/8] DuetPkg/FvbRuntimeService: " Laszlo Ersek
2017-05-24 15:51   ` Laszlo Ersek
2017-05-27  0:54   ` Wu, Hao A
2017-05-29 12:45     ` Laszlo Ersek
2017-05-18 15:04 ` [PATCH 3/8] EmulatorPkg/FvbServicesRuntimeDxe: " Laszlo Ersek
2017-05-18 22:11   ` Laszlo Ersek
2017-05-18 15:04 ` [PATCH 4/8] Nt32Pkg/FvbServicesRuntimeDxe: " Laszlo Ersek
2017-05-24 15:52   ` Laszlo Ersek
2017-05-27  0:54   ` Wu, Hao A
2017-05-29 12:45     ` Laszlo Ersek
2017-05-18 15:04 ` [PATCH 5/8] OvmfPkg/EmuVariableFvbRuntimeDxe: " Laszlo Ersek
2017-05-18 22:11   ` Laszlo Ersek
2017-05-18 15:04 ` [PATCH 6/8] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: " Laszlo Ersek
2017-05-18 22:12   ` Laszlo Ersek
2017-05-18 15:04 ` [PATCH 7/8] QuarkPlatformPkg/SpiFvbServices: " Laszlo Ersek
2017-05-24 15:53   ` Laszlo Ersek
2017-05-24 16:52   ` Kinney, Michael D
2017-05-29 12:45     ` Laszlo Ersek
2017-05-18 15:04 ` [PATCH 8/8] Vlv2TbltDevicePkg/FvbRuntimeDxe: " Laszlo Ersek
2017-05-19  1:49   ` Wei, David
2017-05-26 16:55     ` Laszlo Ersek

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-list 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=20170522175021.GL1657@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /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