Linux Media Controller development
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Ezequiel Garcia <elezegarcia@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Sylwester Nawrocki <sylvester.nawrocki@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Senna Tschudin <peter.senna@gmail.com>,
	Julia Lawall <Julia.Lawall@lip6.fr>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-media <linux-media@vger.kernel.org>
Subject: Re: [PATCH 0/23] media: Replace memcpy with struct assignment
Date: Wed, 28 Nov 2012 17:55:44 -0200	[thread overview]
Message-ID: <20121128175544.4266260d@redhat.com> (raw)
In-Reply-To: <CALF0-+USC6ButEO0pMRPFj8hGtL90wi3FrxL-BkE1oF42qcggg@mail.gmail.com>

Em Wed, 28 Nov 2012 16:06:31 -0300
Ezequiel Garcia <elezegarcia@gmail.com> escreveu:

> On Tue, Oct 23, 2012 at 4:57 PM, Ezequiel Garcia <elezegarcia@gmail.com> wrote:
> > Hello everyone,
> >
> > This is a large patchset that replaces struct memcpy with struct assignment,
> > whenever possible at drivers/media.
> >
> > The patches are hand applied and every change has been thoroughly reviewed.
> > However, to avoid regressions and angry users we'd like to have Acks
> > from maintainers.
> >
> > A simplified version of the semantic match that finds
> > this problem is as follows: (http://coccinelle.lip6.fr/)
> >
> > // <smpl>
> > @@
> > identifier struct_name;
> > struct struct_name to;
> > struct struct_name from;
> > expression E;
> > @@
> > -memcpy(&(to), &(from), E);
> > +to = from;
> > // </smpl>
> >
> > If you're thinking this change is very minor and doesn't worh the pain,
> > you might change your opinion reading this report from Dan Carpenter:
> >
> > http://comments.gmane.org/gmane.linux.drivers.video-input-infrastructure/49553
> >
> > The report clearly shows how copy-paste programming paradigm, combined with
> > lack of memcpy type-safety can lead to very strange code.
> >
> > Not to mention, using struct assignment instead of memcpy
> > is by far more readable.
> >
> > Comments, feedback and flames are welcome. Thanks!
> >
> > Peter Senna Tschudin, Ezequiel Garcia (23):
> >  wl128x: Replace memcpy with struct assignment
> >  radio-wl1273: Replace memcpy with struct assignment
> >  dvb-frontends: Replace memcpy with struct assignment
> >  dvb-core: Replace memcpy with struct assignment
> >  bttv: Replace memcpy with struct assignment
> >  cx18: Replace memcpy with struct assignment
> >  cx23885: Replace memcpy with struct assignment
> >  cx88: Replace memcpy with struct assignment
> >  ivtv: Replace memcpy with struct assignment
> >  tuners/tda18271: Replace memcpy with struct assignment
> >  tuners/xc2028: Replace memcpy with struct assignment
> >  tuners/xc4000: Replace memcpy with struct assignment
> >  au0828: Replace memcpy with struct assignment
> >  dvb-usb/friio-fe: Replace memcpy with struct assignment
> >  zr36067: Replace memcpy with struct assignment
> >  cx25840: Replace memcpy with struct assignment
> >  hdpvr: Replace memcpy with struct assignment
> >  pvrusb2: Replace memcpy with struct assignment
> >  pwc: Replace memcpy with struct assignment
> >  sn9c102: Replace memcpy with struct assignment
> >  usbvision: Replace memcpy with struct assignment
> >  cx231xx: Replace memcpy with struct assignment
> >  uvc: Replace memcpy with struct assignment
> >
> >  drivers/media/dvb-core/dvb_frontend.c        |    2 +-
> >  drivers/media/dvb-frontends/cx24116.c        |    2 +-
> >  drivers/media/dvb-frontends/drxd_hard.c      |    5 ++---
> >  drivers/media/dvb-frontends/stv0299.c        |    2 +-
> >  drivers/media/i2c/cx25840/cx25840-ir.c       |    6 ++----
> >  drivers/media/pci/bt8xx/bttv-i2c.c           |    3 +--
> >  drivers/media/pci/cx18/cx18-i2c.c            |    6 ++----
> >  drivers/media/pci/cx23885/cx23885-video.c    |    3 +--
> >  drivers/media/pci/cx23885/cx23888-ir.c       |    6 ++----
> >  drivers/media/pci/cx88/cx88-cards.c          |    2 +-
> >  drivers/media/pci/cx88/cx88-i2c.c            |    3 +--
> >  drivers/media/pci/cx88/cx88-vp3054-i2c.c     |    3 +--
> >  drivers/media/pci/ivtv/ivtv-i2c.c            |   12 ++++--------
> >  drivers/media/pci/zoran/zoran_card.c         |    3 +--
> >  drivers/media/radio/radio-wl1273.c           |    3 +--
> >  drivers/media/radio/wl128x/fmdrv_common.c    |    3 +--
> >  drivers/media/tuners/tda18271-maps.c         |    6 ++----
> >  drivers/media/tuners/tuner-xc2028.c          |    2 +-
> >  drivers/media/tuners/xc4000.c                |    2 +-
> >  drivers/media/usb/au0828/au0828-cards.c      |    2 +-
> >  drivers/media/usb/au0828/au0828-i2c.c        |    9 +++------
> >  drivers/media/usb/cx231xx/cx231xx-cards.c    |    2 +-
> >  drivers/media/usb/cx231xx/cx231xx-video.c    |    3 +--
> >  drivers/media/usb/dvb-usb/friio-fe.c         |    5 ++---
> >  drivers/media/usb/hdpvr/hdpvr-i2c.c          |    3 +--
> >  drivers/media/usb/pvrusb2/pvrusb2-encoder.c  |    3 +--
> >  drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c |    4 ++--
> >  drivers/media/usb/pvrusb2/pvrusb2-v4l2.c     |    2 +-
> >  drivers/media/usb/pwc/pwc-if.c               |    2 +-
> >  drivers/media/usb/sn9c102/sn9c102_core.c     |    4 ++--
> >  drivers/media/usb/usbvision/usbvision-i2c.c  |    3 +--
> >  drivers/media/usb/uvc/uvc_v4l2.c             |    6 +++---
> >  32 files changed, 47 insertions(+), 75 deletions(-)
> >
> 
> Hi Mauro,
> 
> Given we're very near merge window, I'm wondering if you're
> considering picking this series.
> There's no rush, but if there's anything to review, please let me know.

Hi Ezequiel,

Thanks for your offering.

There are 400+ patches pending today at patchwork. I doubt I'll have enough
time for all of them, so, I'll skip cleanup patches like the above, in order
to try to focus on bug fixes and patches that brings new functionality to
existing code and with a low risk of breaking anything.

Next year, we'll start implementing the sub-maintainers, and, with their
help, I suspect we'll be able to finally apply those patches.

If you want us to help, feel free to review/test the individual patches
submitted by non-maintainers to the ML. We tend to apply faster patches
that are more reviewed. 

Hmm... well, actually it is just the opposite: we explicitly delay 
not-reviewed patches for unmaintained/bad maintained drivers,
to see if someone acks or nacks them after testing.

Regards,
Mauro

  reply	other threads:[~2012-11-28 19:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23 19:57 [PATCH 0/23] media: Replace memcpy with struct assignment Ezequiel Garcia
2012-11-28 19:06 ` Ezequiel Garcia
2012-11-28 19:55   ` Mauro Carvalho Chehab [this message]
2012-11-28 20:55     ` Ezequiel Garcia
2012-11-29  2:28   ` Joe Perches

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=20121128175544.4266260d@redhat.com \
    --to=mchehab@redhat.com \
    --cc=Julia.Lawall@lip6.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=elezegarcia@gmail.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=peter.senna@gmail.com \
    --cc=sylvester.nawrocki@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