public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
	vvscore@gmail.com
Subject: Re: [PATCH] 8250: Fix oops from setserial
Date: Sat, 30 May 2009 01:43:11 -0700	[thread overview]
Message-ID: <20090530014311.93577673.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090530092557.57578dd5@lxorguk.ukuu.org.uk>

On Sat, 30 May 2009 09:25:57 +0100 Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> > 
> > >  static void set_io_from_upio(struct uart_port *p)
> > >  {
> > > +	struct uart_8250_port *up = (struct uart_8250_port *)p;
> > 
> > container_of() is nicer, IMO.  It's clearer, and doesn't require that
> > the uart_port be the fist member.
> 
> See the rest of the driver - it was written that way years ago and this
> is just following the existing design.

Sure, huge numbers of drivers use the cast.

But I've never seen past sinnings as being a reason to continue sinning. 
Doing new code the right way doesn't result in worse code, and reduces
the chances of someone copying and pasting the wrong way.

  reply	other threads:[~2009-05-30  8:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28 13:01 [PATCH] 8250: Fix oops from setserial Alan Cox
2009-05-30  3:54 ` Andrew Morton
2009-05-30  8:25   ` Alan Cox
2009-05-30  8:43     ` Andrew Morton [this message]
2009-05-30 10:46       ` Alan Cox
2009-05-30 18:50         ` Andrew Morton

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=20090530014311.93577673.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=vvscore@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