linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fw: staging: media: Use dev_err() instead of pr_err()
@ 2013-11-14 13:08 Mauro Carvalho Chehab
  2013-11-15  6:29 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2013-11-14 13:08 UTC (permalink / raw)
  To: Dulshani Gunawardhana
  Cc: Greg Kroah-Hartman, Josh Triplett, Dan Carpenter, linux-media,
	devel, Hans Verkuil

Hi,

I'm not sure how this patch got applied upstream:

	commit b6ea5ef80aa7fd6f4b18ff2e4174930e8772e812
	Author: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
	Date:   Sun Oct 20 22:58:28 2013 +0530
	
	    staging:media: Use dev_dbg() instead of pr_debug()
	    
	    Use dev_dbg() instead of pr_debug() in go7007-usb.c.
    
	    Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
	    Reviewed-by: Josh Triplett <josh@joshtriplett.org>
	    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

But, from the custody chain, it seems it was not C/C to linux-media ML,
doesn't have the driver maintainer's ack[1] and didn't went via my tree.

[1] Dulshani, please next time run the get_maintainer.pl script to get the
proper maintainers:
	$ /scripts/get_maintainer.pl -f drivers/staging/media/go7007/go7007-usb.c
	Hans Verkuil <hans.verkuil@cisco.com> (maintainer:STAGING - GO7007...)
	Mauro Carvalho Chehab <m.chehab@samsung.com> (maintainer:MEDIA INPUT INFRA...)
	Greg Kroah-Hartman <gregkh@linuxfoundation.org> (supporter:STAGING SUBSYSTEM)
	linux-media@vger.kernel.org (open list:MEDIA INPUT INFRA...)
	devel@driverdev.osuosl.org (open list:STAGING SUBSYSTEM)

Anyway, this patch is clearly wrong, and will cause an OOPS if CONFIG_DEBUG is 
enabled, during device probing, because of this change:

@@ -1052,21 +1050,21 @@ static int go7007_usb_probe(struct usb_interface *intf,
                const struct usb_device_id *id)
 {
        struct go7007 *go;
        struct go7007_usb *usb;
        const struct go7007_usb_board *board;
        struct usb_device *usbdev = interface_to_usbdev(intf);
        unsigned num_i2c_devs;
        char *name;
        int video_pipe, i, v_urb_len;
 
-       pr_debug("probing new GO7007 USB board\n");
+       dev_dbg(go->dev, "probing new GO7007 USB board\n");
 
        switch (id->driver_info) {
        case GO7007_BOARDID_MATRIX_II:
                name = "WIS Matrix II or compatible";
                board = &board_matrix_ii;
                break;
        case GO7007_BOARDID_MATRIX_RELOAD:
                name = "WIS Matrix Reloaded or compatible";
                board = &board_matrix_reload;
                break;


As it will try to de-reference the uninitialized "go" struct go7007_usb
pointer.

The alternative of mixing pr_debug with dev_debug, as Dan is suggesting
is, IMHO, worse, as it will lack coherency on the usage of printk
macros inside the driver.

So, I think we should just revert this patch.

Comments?

Regards,
Mauro

Forwarded message:

Date: Tue, 5 Nov 2013 23:26:05 +0300
From: Dan Carpenter <dan.carpenter@oracle.com>
To: dulshani.gunawardhana89@gmail.com
Cc: linux-media@vger.kernel.org, devel@driverdev.osuosl.org
Subject: re: staging: media: Use dev_err() instead of pr_err()


Hello Dulshani Gunawardhana,

The patch 44ee8e801137: "staging: media: Use dev_err() instead of 
pr_err()" from Oct 20, 2013, leads to the following
GCC warning: 

drivers/staging/media/go7007/go7007-usb.c: In function ‘go7007_usb_probe’:
drivers/staging/media/go7007/go7007-usb.c:1100:13: warning: ‘go’ may be used uninitialized in this function [-Wuninitialized]

drivers/staging/media/go7007/go7007-usb.c
  1049  static int go7007_usb_probe(struct usb_interface *intf,
  1050                  const struct usb_device_id *id)
  1051  {
  1052          struct go7007 *go;
  1053          struct go7007_usb *usb;
  1054          const struct go7007_usb_board *board;
  1055          struct usb_device *usbdev = interface_to_usbdev(intf);
  1056          unsigned num_i2c_devs;
  1057          char *name;
  1058          int video_pipe, i, v_urb_len;
  1059  
  1060          dev_dbg(go->dev, "probing new GO7007 USB board\n");
                        ^^^^^^^
  1061  
  1062          switch (id->driver_info) {
  1063          case GO7007_BOARDID_MATRIX_II:
  1064                  name = "WIS Matrix II or compatible";
  1065                  board = &board_matrix_ii;
  1066                  break;

There are several other uses of "go" before it has been initialized.

Probably you will just want to change these back to pr_info().  Some of
the messages are not very useful like:
	dev_info(go->dev, "Sensoray 2250 found\n");
You can delete that one.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fw: staging: media: Use dev_err() instead of pr_err()
  2013-11-14 13:08 Fw: staging: media: Use dev_err() instead of pr_err() Mauro Carvalho Chehab
@ 2013-11-15  6:29 ` Greg Kroah-Hartman
  2013-11-17 12:03   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2013-11-15  6:29 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Dulshani Gunawardhana, Josh Triplett, Dan Carpenter, linux-media,
	devel, Hans Verkuil

On Thu, Nov 14, 2013 at 11:08:14AM -0200, Mauro Carvalho Chehab wrote:
> Hi,
> 
> I'm not sure how this patch got applied upstream:
> 
> 	commit b6ea5ef80aa7fd6f4b18ff2e4174930e8772e812
> 	Author: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
> 	Date:   Sun Oct 20 22:58:28 2013 +0530
> 	
> 	    staging:media: Use dev_dbg() instead of pr_debug()
> 	    
> 	    Use dev_dbg() instead of pr_debug() in go7007-usb.c.
>     
> 	    Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
> 	    Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> 	    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> But, from the custody chain, it seems it was not C/C to linux-media ML,
> doesn't have the driver maintainer's ack[1] and didn't went via my tree.

It came in through my tree as part of the OPW intern application
process.

And yes, sorry, it's broken, I have some follow-on patches to fix this,
but you are right, it should just be reverted for now, very sorry about
that.

Do you want to do that, or should I?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: staging: media: Use dev_err() instead of pr_err()
  2013-11-15  6:29 ` Greg Kroah-Hartman
@ 2013-11-17 12:03   ` Mauro Carvalho Chehab
  2013-11-19  0:47     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2013-11-17 12:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Dulshani Gunawardhana, Josh Triplett, Dan Carpenter, linux-media,
	devel, Hans Verkuil

Em Fri, 15 Nov 2013 15:29:39 +0900
Greg Kroah-Hartman <gregkh@linuxfoundation.org> escreveu:

> On Thu, Nov 14, 2013 at 11:08:14AM -0200, Mauro Carvalho Chehab wrote:
> > Hi,
> > 
> > I'm not sure how this patch got applied upstream:
> > 
> > 	commit b6ea5ef80aa7fd6f4b18ff2e4174930e8772e812
> > 	Author: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
> > 	Date:   Sun Oct 20 22:58:28 2013 +0530
> > 	
> > 	    staging:media: Use dev_dbg() instead of pr_debug()
> > 	    
> > 	    Use dev_dbg() instead of pr_debug() in go7007-usb.c.
> >     
> > 	    Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
> > 	    Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> > 	    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > 
> > But, from the custody chain, it seems it was not C/C to linux-media ML,
> > doesn't have the driver maintainer's ack[1] and didn't went via my tree.
> 
> It came in through my tree as part of the OPW intern application
> process.

Ah, OK.

I don't mind if you apply those directly, but what makes me a little
worried is that at least the final version of the patchset should be
c/c to driver/subsystem maintainers for their review and for them to 
know that the patch will be merged via some other tree, as it might
be causing conflicts with their trees.

> And yes, sorry, it's broken, I have some follow-on patches to fix this,
> but you are right, it should just be reverted for now, very sorry about
> that.

No problem.

> Do you want to do that, or should I?

I prefer if you could do it, as I'm still waiting the merge from my tree,
and I don't want to cascade another pull request before the original
pull requests get handled. In any case, they won't conflict with this,
as I don't have any patch for this driver on my tree for 3.13.

Thanks!
Mauro

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: staging: media: Use dev_err() instead of pr_err()
  2013-11-17 12:03   ` Mauro Carvalho Chehab
@ 2013-11-19  0:47     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2013-11-19  0:47 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Dulshani Gunawardhana, Josh Triplett, Dan Carpenter, linux-media,
	devel, Hans Verkuil

On Sun, Nov 17, 2013 at 10:03:21AM -0200, Mauro Carvalho Chehab wrote:
> Em Fri, 15 Nov 2013 15:29:39 +0900
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> escreveu:
> 
> > On Thu, Nov 14, 2013 at 11:08:14AM -0200, Mauro Carvalho Chehab wrote:
> > > Hi,
> > > 
> > > I'm not sure how this patch got applied upstream:
> > > 
> > > 	commit b6ea5ef80aa7fd6f4b18ff2e4174930e8772e812
> > > 	Author: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
> > > 	Date:   Sun Oct 20 22:58:28 2013 +0530
> > > 	
> > > 	    staging:media: Use dev_dbg() instead of pr_debug()
> > > 	    
> > > 	    Use dev_dbg() instead of pr_debug() in go7007-usb.c.
> > >     
> > > 	    Signed-off-by: Dulshani Gunawardhana <dulshani.gunawardhana89@gmail.com>
> > > 	    Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> > > 	    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > 
> > > But, from the custody chain, it seems it was not C/C to linux-media ML,
> > > doesn't have the driver maintainer's ack[1] and didn't went via my tree.
> > 
> > It came in through my tree as part of the OPW intern application
> > process.
> 
> Ah, OK.
> 
> I don't mind if you apply those directly, but what makes me a little
> worried is that at least the final version of the patchset should be
> c/c to driver/subsystem maintainers for their review and for them to 
> know that the patch will be merged via some other tree, as it might
> be causing conflicts with their trees.
> 
> > And yes, sorry, it's broken, I have some follow-on patches to fix this,
> > but you are right, it should just be reverted for now, very sorry about
> > that.
> 
> No problem.
> 
> > Do you want to do that, or should I?
> 
> I prefer if you could do it, as I'm still waiting the merge from my tree,
> and I don't want to cascade another pull request before the original
> pull requests get handled. In any case, they won't conflict with this,
> as I don't have any patch for this driver on my tree for 3.13.

Ok, I'll do this after 3.13-rc1 is out, sorry for the problems.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-11-19  0:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-14 13:08 Fw: staging: media: Use dev_err() instead of pr_err() Mauro Carvalho Chehab
2013-11-15  6:29 ` Greg Kroah-Hartman
2013-11-17 12:03   ` Mauro Carvalho Chehab
2013-11-19  0:47     ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).