public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Chin Liang See <clsee@altera.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] socfpga: Adding Scan Manager driver
Date: Fri, 21 Feb 2014 09:26:10 -0600	[thread overview]
Message-ID: <1392996370.3602.7.camel@clsee-VirtualBox> (raw)
In-Reply-To: <20140221150746.GA6037@amd.pavel.ucw.cz>

Hi Pavel,

Nice to hear from you again :)

On Fri, 2014-02-21 at 16:07 +0100, ZY - pavel wrote:
> Hi!
> 
> > +	/*
> > +	 * Check if the scan chain engine is inactive and the
> > +	 * WFIFO is empty before enabling the IO scan chain
> > +	 */
> > +	if (SCAN_MGR_IO_SCAN_ENGINE_STATUS_IDLE
> > +		!= scan_mgr_io_scan_chain_engine_is_idle(
> > +		MAX_WAITING_DELAY_IO_SCAN_ENGINE)) {
> > +		return 1;
> > +	}
> 
> Hmm.. function named "_is_idle" maybe should just return 0 or 1?

Yup we can simplify that. Probably just remain for readability. Hope its
ok for you.

> 
> > +		/*
> > +		 * Check if the scan chain engine has completed the
> > +		 * IO scan chain data shifting
> > +		 */
> > +		if (SCAN_MGR_IO_SCAN_ENGINE_STATUS_IDLE
> > +			!= scan_mgr_io_scan_chain_engine_is_idle(
> > +			MAX_WAITING_DELAY_IO_SCAN_ENGINE)) {
> > +			/* Disable IO Scan chain when error detected */
> > +			clrbits_le32(&scan_manager_base->en,
> > +				1 << io_scan_chain_id);
> > +			return 1;
> > +		}
> > +	}
> 
> "goto error" would help avoid code duplication.

Good suggestion here. Will change that.

> 
> > +struct socfpga_scan_manager {
> > +	u32	stat;
> > +	u32	en;
> > +	u32	padding[2];
> > +	u32	fifosinglebyte;
> > +	u32	fifodoublebyte;
> > +	u32	fifoquadbyte;
> > +};
> 
> some underscores should be added here.

Sure, for better readability.

Thanks!

Chin Liang

> 
> Thanks,
> 									Pavel

      reply	other threads:[~2014-02-21 15:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 14:53 [U-Boot] [PATCH v3] socfpga: Adding Scan Manager driver Chin Liang See
2014-02-21 15:07 ` Pavel Machek
2014-02-21 15:26   ` Chin Liang See [this message]

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=1392996370.3602.7.camel@clsee-VirtualBox \
    --to=clsee@altera.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