public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: "Németh Márton" <nm127@freemail.hu>
Cc: V4L Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH] gspca: add sanity check for mandatory operations
Date: Tue, 17 Nov 2009 10:51:44 +0100	[thread overview]
Message-ID: <20091117105144.70ee9550@tele> (raw)
In-Reply-To: <4B02470C.7000205@freemail.hu>

On Tue, 17 Nov 2009 07:47:40 +0100
Németh Márton <nm127@freemail.hu> wrote:

> From: Márton Németh <nm127@fremail.hu>
> 
> Add check for the mandatory config, init, start and pkt_scan
> gspca subdriver operations.
> 
> Signed-off-by: Márton Németh <nm127@fremail.hu>
> ---
> diff -r 182b5f8fa160 linux/drivers/media/video/gspca/gspca.c
> --- a/linux/drivers/media/video/gspca/gspca.c	Sun Nov 15
> 10:05:30 2009 +0100 +++
> b/linux/drivers/media/video/gspca/gspca.c	Tue Nov 17 07:42:34
> 2009 +0100 @@ -2035,6 +2035,12 @@ return -ENODEV;
>  	}
> 
> +	/* check for mandatory operations */
> +	BUG_ON(!sd_desc->config);
> +	BUG_ON(!sd_desc->init);
> +	BUG_ON(!sd_desc->start);
> +	BUG_ON(!sd_desc->pkt_scan);
> +
>  	/* create the device */
>  	if (dev_size < sizeof *gspca_dev)
>  		dev_size = sizeof *gspca_dev;

Hi Németh,

I don't think this is useful: the people who write the subdrivers know
the mandatory parameters. If not, the system will simply oops at the
first test...

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

      reply	other threads:[~2009-11-17  9:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17  6:47 [PATCH] gspca: add sanity check for mandatory operations Németh Márton
2009-11-17  9:51 ` Jean-Francois Moine [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=20091117105144.70ee9550@tele \
    --to=moinejf@free.fr \
    --cc=linux-media@vger.kernel.org \
    --cc=nm127@freemail.hu \
    /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