linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Pisati <p.pisati@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Paolo Pisati <p.pisati@gmail.com>, Alan Tull <atull@kernel.org>,
	Moritz Fischer <mdf@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-fpga@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] fpga: lattice machxo2: Add Lattice MachXO2 support
Date: Thu, 22 Mar 2018 18:26:08 +0100	[thread overview]
Message-ID: <20180322172608.GA22179@harukaze> (raw)
In-Reply-To: <1521655492.7999.13.camel@perches.com>

On Wed, Mar 21, 2018 at 11:04:52AM -0700, Joe Perches wrote:
> 
> static const u8 cmd[]
> here and everywhere else as all the tx_buf assignments 
> of cmd are to const void *

Ok
 
> Instead of multiple declarations of dump_status_reg
> it's frequently nicer to use a style like
> 
> static void debug_func(args...)
> {
> #ifdef DEBUG
> 	[code...]
> #endif
> }
> 
> so if function arguments ever need to be changed
> it's only required to be changed in one spot and
> not multiply compilation tested with and without
> the DEBUG definition

Ok
 
> It's frequently nicer to use a static function
> for these enum -> string conversions like:
> 
> static const char *get_err_string(unsigned long err)
> {
> 	switch (err) {
> 	case ENOERR:	return "No Error";
> 	case EID:	return "ID ERR";
> 	case ECMD:	return "CMD ERR";
> 	[...]
> 	}
> 	return "default switch case";
> }

Ok - checkpatch complained when i put the "case ...: return ...;" on the same
line as you did here, that is why i ended up with the ugly "case...: $string;
break" all on different lines
 
> > +	pr_debug("machxo2 status: 0x%08lX - done=%d, cfgena=%d, busy=%d, fail=%d, devver=%d, err=%s\n",
> > +	       *status, test_bit(DONE, status), test_bit(ENAB, status),
> > +	       test_bit(BUSY, status), test_bit(FAIL, status),
> > +		   test_bit(DVER, status), ferr);
> 
> So instead of ferr, this could use
> 	get_err_string(*status)
> 
> And please try to keep a consistent alignment for
> indentation of multiple line statements

I tried, but then checkpatch complained again about the indentation of the above block
and i literally had to guess...

Anyhow, thanks, i'll send a v8 with all these style fixes.
-- 
bye,
p.

  reply	other threads:[~2018-03-22 17:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 17:35 [PATCH 0/2 v7] Lattice MachXO2 Slave SPI FPGA Manager support Paolo Pisati
2018-03-21 17:35 ` [PATCH 1/2] dt: bindings: fpga: add lattice machxo2 slave spi binding description Paolo Pisati
2018-03-21 17:35 ` [PATCH 2/2] fpga: lattice machxo2: Add Lattice MachXO2 support Paolo Pisati
2018-03-21 18:04   ` Joe Perches
2018-03-22 17:26     ` Paolo Pisati [this message]
2018-03-22 18:30       ` Joe Perches
2018-03-22 21:32     ` Alan Tull
2018-03-22 21:34       ` Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2018-03-23 12:27 [PATCH 0/2 v8] Lattice MachXO2 Slave SPI FPGA Manager support Paolo Pisati
2018-03-23 12:27 ` [PATCH 2/2] fpga: lattice machxo2: Add Lattice MachXO2 support Paolo Pisati
2018-03-28 16:26   ` Alan Tull
2018-03-28 20:03     ` Alan Tull
2018-03-29 14:33       ` Paolo Pisati
2018-03-16 15:54 [PATCH 0/2 v6] Lattice MachXO2 Slave SPI FPGA Manager support Paolo Pisati
2018-03-16 15:54 ` [PATCH 2/2] fpga: lattice machxo2: Add Lattice MachXO2 support Paolo Pisati
2018-03-16 16:26   ` Moritz Fischer
2018-03-19 18:09     ` Paolo Pisati

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=20180322172608.GA22179@harukaze \
    --to=p.pisati@gmail.com \
    --cc=atull@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=joe@perches.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mdf@kernel.org \
    --cc=robh+dt@kernel.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;
as well as URLs for NNTP newsgroup(s).