From: Ezequiel <elezegarcia@gmail.com>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: linux-media@vger.kernel.org, hdegoede@redhat.com,
ospite@studenti.unina.it
Subject: Re: Cleanup proposal for media/gspca
Date: Mon, 21 Nov 2011 20:24:21 -0300 [thread overview]
Message-ID: <20111121232421.GA2575@devel2> (raw)
In-Reply-To: <20111120082429.06ad5a32@tele>
On Sun, Nov 20, 2011 at 08:24:29AM +0100, Jean-Francois Moine wrote:
>
> Hi Ezequiel,
>
> It is not a minor patch, but maybe you don't know about object
> programming.
>
> As it is defined, a gspca device _is_ a video device, as a gspca
> subdriver is a gspca device, and as a video device is a device: each
> lower structure is contained in a higher one.
>
> Your patch defines the gspca structure as a separate entity which is
> somewhat related to a video device by two reverse pointers. It
> complexifies the structure accesses, adds more code and hides the
> nature of a gspca device.
>
Hi Jef,
Thanks for the explanation, I have things much clear now.
I didn't realize linux coding style enforces so explicitly OOP.
I based my patch on tm6000 driver and your
previous mail about the -supposedly- ugly cast:
gspca_dev = (struct gspca_dev *) video_devdata(file);
Now it doesn't seems so ugly, I guess I went too far.
Still, maybe the 'container_of' trick could make thins
easier to understand.
Thanks again for your patience,
Ezequiel.
prev parent reply other threads:[~2011-11-21 23:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20111116013445.GA5273@localhost>
2011-11-16 18:19 ` Cleanup proposal for media/gspca Ezequiel García
2011-11-17 10:07 ` Jean-Francois Moine
2011-11-17 18:03 ` Ezequiel
2011-11-19 18:59 ` Ezequiel
2011-11-20 7:24 ` Jean-Francois Moine
2011-11-21 23:24 ` Ezequiel [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=20111121232421.GA2575@devel2 \
--to=elezegarcia@gmail.com \
--cc=hdegoede@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=moinejf@free.fr \
--cc=ospite@studenti.unina.it \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.