linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@kernel.org>
To: Mary Strodl <mstrodl@freedom.csh.rit.edu>
Cc: Mary Strodl <mstrodl@csh.rit.edu>,
	linux-kernel@vger.kernel.org,  akpm@linux-foundation.org,
	urezki@gmail.com, hch@infradead.org, linux-mm@kvack.org,
	 lee@kernel.org, linux-i2c@vger.kernel.org,
	s.hauer@pengutronix.de,  christian.gmeiner@gmail.com
Subject: Re: [PATCH v3 1/2] x86: Add basic support for the Congatec CGEB BIOS interface
Date: Mon, 12 Aug 2024 21:16:47 +0100	[thread overview]
Message-ID: <lek2i4jpc7x257ycxeuto2op742x555a25wxdgh5lzcgtqg3lp@t7opf5nlgspt> (raw)
In-Reply-To: <Zrn1vNgn7q5npxU7@freedom.csh.rit.edu>

Hi Mary,

> > I'm counting too many global variables here and too many global
> > structure definitions. It might get a bit hard to follow.
> > 
> > I'd suggest to simplify this part as much as possible and keep
> > everything in as less structures as possible (ideally just one). 
> > 
> > Please make local as many variables as you can.
> 
> I don't disagree with you here. Unfortunately everything between
> the pack(push, 4) and pack(pop) needs to stay, since those are
> the BIOS's ABI. I'd be open to putting them in a header file or
> something though, but I wasn't sure what convention was on stuff like that.
> 
> What do you think? I think moving the BIOS ABI and maybe the over-the-wire
> types (struct cgeb_request and friends) out would probably make it much
> easier to follow.

mine was a guess, actually... if you see that my comment doesn't
fit, feel free to ignore it.

As I said I didn't look in details all the structures and their
dependencies.

> > > +
> > > +	/* Wait for a response to the request */
> > > +	err = wait_for_completion_interruptible_timeout(
> > > +		&req->done, msecs_to_jiffies(20000));
> > > +	if (err == 0) {
> > > +		pr_err("CGEB: Timed out running request of type %d!\n",
> > > +		       msg.type);
> > > +		err = -ETIMEDOUT;
> > 
> > just "return -ETIMEDOUT;" and you can cleanup the code below
> Here's where I landed on that:
> 
> /* Wait for a response to the request */
> err = wait_for_completion_interruptible_timeout(
> 	&req->done, msecs_to_jiffies(20000));
> if (err == 0) {
> 	pr_err("CGEB: Timed out running request of type %d!\n",
> 	       msg.type);
> 	return -ETIMEDOUT;
> } else if (err < 0) {
> 	return err;
> } else {

you don't ened anymore for this else, at the end, but this looks
correct.

Thanks,
Andi


  reply	other threads:[~2024-08-12 20:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-08 18:35 [PATCH v3 0/2] Add support for " Mary Strodl
2024-08-08 18:35 ` [PATCH v3 1/2] x86: Add basic support for the " Mary Strodl
2024-08-09  0:46   ` Andi Shyti
2024-08-12 11:45     ` Mary Strodl
2024-08-12 20:16       ` Andi Shyti [this message]
2024-08-13 12:26   ` kernel test robot
2024-08-08 18:35 ` [PATCH v3 2/2] i2c: Add Congatec CGEB I2C driver Mary Strodl
2024-08-09  0:55   ` Andi Shyti

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=lek2i4jpc7x257ycxeuto2op742x555a25wxdgh5lzcgtqg3lp@t7opf5nlgspt \
    --to=andi.shyti@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=christian.gmeiner@gmail.com \
    --cc=hch@infradead.org \
    --cc=lee@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mstrodl@csh.rit.edu \
    --cc=mstrodl@freedom.csh.rit.edu \
    --cc=s.hauer@pengutronix.de \
    --cc=urezki@gmail.com \
    /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