mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fawad Lateef <fawadlateef@gmail.com>
To: Mateusz Berezecki <mateuszb@gmail.com>
Cc: Michael Buesch <mbuesch@freenet.de>,
	kernel-mentors@selenic.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: kernel list / container_of aka list_entry question
Date: Sun, 25 Dec 2005 23:55:58 +0500	[thread overview]
Message-ID: <1e62d1370512251055t69ce0c5g97e95a05e727852b@mail.gmail.com> (raw)
In-Reply-To: <aec8d6fc0512251028v1338cc2cn2d8d58e4685c178@mail.gmail.com>

On 12/25/05, Mateusz Berezecki <mateuszb@gmail.com> wrote:
> On 12/25/05, Michael Buesch <mbuesch@freenet.de> wrote:
>
> > > >         list_for_each(iterator, &priv->rxbuf.list) {
> > > >                 struct ath_buf *bf = list_entry(iterator, (struct ath_buf), list);
> >                                                               ^              ^
> > Remove the parenthesis.
>
> yikes. that helped. but it's somewhat weird IMHO... why ((struct foo)
> *) wont work?
> and it needs to be (struct foo *) ?
>

What I can say is that compiler will consider the construct like
(struct foo *)  as this (struct foo)* will be making compiler confused
that (struct foo) is type-casting and the * might be for deferencing
the pointer but as * is also in a bracket and wont follow any pointer
thats why compiler is giving error. (CMIIW)

--
Fawad Lateef

  reply	other threads:[~2005-12-25 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-25 16:50 Mateusz Berezecki
2005-12-25 17:24 ` Fawad Lateef
2005-12-25 18:10   ` Michael Buesch
2005-12-25 18:28     ` Mateusz Berezecki
2005-12-25 18:55       ` Fawad Lateef [this message]
2005-12-25 18:30   ` Mateusz Berezecki

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=1e62d1370512251055t69ce0c5g97e95a05e727852b@mail.gmail.com \
    --to=fawadlateef@gmail.com \
    --cc=kernel-mentors@selenic.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mateuszb@gmail.com \
    --cc=mbuesch@freenet.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

all inboxes | Powered by JetHome®