* Broken inlines all over the source tree
@ 2002-08-24 23:47 Luca Barbieri
2002-08-25 8:05 ` Russell King
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Luca Barbieri @ 2002-08-24 23:47 UTC (permalink / raw)
To: Linux-Kernel ML, Kernel Janitors ML
[-- Attachment #1: Type: text/plain, Size: 3195 bytes --]
GCC can only inline functions when the function definition comes before
its use.
Unfortunately a lot of code hasn't been written with this in mind.
Here is a list of files containing forward declarations for inline
functions (that are either broken or redundant).
The list was made with grep -E '(inline|inline__)[ '$'\t''][^{]*;' so
it's not very accurate.
gcc -Winline would provide better results.
How about adding it to the build CFLAGS?
Here is the list (excluding mm/rmap.c that I already fixed).
./drivers/hotplug/ibmphp_res.c
./drivers/net/hamradio/dmascc.c
./drivers/net/tulip/dmfe.c
./drivers/net/au1000_eth.c
./drivers/net/wan/lmc/lmc_debug.h
./drivers/net/wan/lmc/lmc_media.c
./drivers/net/wan/dscc4.c
./drivers/net/e1000/e1000_main.c
./drivers/net/sb1000.c
./drivers/net/ioc3-eth.c
./drivers/net/seeq8005.c
./drivers/net/mace.c
./drivers/net/eql.c
./drivers/net/bonding.c
./drivers/net/via-rhine.c
./drivers/net/hamachi.c
./drivers/net/smc9194.c
./drivers/isdn/hisax/isar.c
./drivers/isdn/hisax/ipacx.c
./drivers/isdn/sc/command.c
./drivers/video/riva/fbdev.c
./drivers/video/fbcon.c
./drivers/video/cyberfb.h
./drivers/video/virgefb.c
./drivers/video/platinumfb.c
./drivers/video/valkyriefb.c
./drivers/media/video/w9966.c
./drivers/media/video/planb.c
./drivers/media/radio/radio-maestro.c
./drivers/char/ftape/zftape/zftape-vtbl.h
./drivers/char/istallion.c
./drivers/char/stallion.c
./drivers/char/dz.h
./drivers/char/ser_a2232.c
./drivers/char/qtronix.c
./drivers/char/rtc.c
./drivers/char/epca.c
./drivers/char/pcxx.c
./drivers/char/mxser.c
./drivers/char/ip2main.c
./drivers/acorn/block/fd1772.c
./drivers/scsi/aic7xxx/aic7xxx_osm.h
./drivers/scsi/aic7xxx/aic7xxx_linux.c
./drivers/scsi/aic7xxx/aic7xxx_inline.h
./drivers/scsi/ips.c
./drivers/scsi/sun3_scsi.c
./drivers/scsi/sim710.c
./drivers/scsi/advansys.c
./drivers/scsi/fastlane.c
./drivers/scsi/sg.c
./drivers/scsi/AM53C974.c
./drivers/scsi/mac_esp.c
./drivers/scsi/tmscsim.c
./drivers/scsi/ultrastor.c
./drivers/scsi/megaraid.h
./drivers/scsi/qla1280.c
./drivers/s390/char/tape.c
./drivers/s390/char/tape.h
./drivers/mtd/devices/doc1000.c
./drivers/usb/media/se401.h
./drivers/usb/serial/whiteheat.c
./drivers/usb/net/rtl8150.c
./drivers/usb/host/hc_simple.h
./drivers/block/cpqarray.c
./drivers/block/ataflop.c
./drivers/block/xd.h
./drivers/block/cciss.c
./drivers/sgi/char/ds1286.c
./drivers/cdrom/sonycd535.c
./arch/mips/au1000/common/irq.c
./arch/ia64/sn/io/l1.c
./include/net/irda/timer.h
./include/net/ip.h
./include/linux/fsfilter.h
./include/linux/elevator.h
./include/linux/sched.h
./include/linux/coda_linux.h
./include/linux/blkdev.h
./include/linux/intermezzo_fs.h
./include/linux/bio.h
./include/linux/reiserfs_fs.h
./include/asm-ppc64/tlb.h
./include/asm-ia64/unistd.h
./include/asm-x86_64/apic.h
./include/asm-s390x/processor.h
./include/asm-arm/thread_info.h
./include/asm-arm/current.h
./include/asm-arm/unistd.h
./include/asm-i386/apic.h
./net/core/sock.c
./net/irda/wrapper.c
./net/bluetooth/sco.c
./net/bluetooth/l2cap.c
./net/atm/lec.c
./net/wanrouter/af_wanpipe.c
./net/appletalk/ddp.c
./fs/jfs/resize.c
./fs/ntfs/ntfs.h
./fs/intermezzo/super.c
./fs/freevxfs/vxfs_extern.h
./fs/affs/file.c
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-08-24 23:47 Broken inlines all over the source tree Luca Barbieri
@ 2002-08-25 8:05 ` Russell King
2002-08-25 10:16 ` Roger Luethi
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Russell King @ 2002-08-25 8:05 UTC (permalink / raw)
To: Luca Barbieri; +Cc: Linux-Kernel ML, Kernel Janitors ML
On Sun, Aug 25, 2002 at 01:47:18AM +0200, Luca Barbieri wrote:
> ./drivers/acorn/block/fd1772.c
False positive; set_head_settle_flag is declared with code before use.
False positive; get_head_settle_flag is declared with code before use.
Correct positive; copy_buffer needs fixing, thanks for finding that.
> ./include/asm-arm/thread_info.h
False positive; current_thread_info is declared with code before use.
> ./include/asm-arm/current.h
False positive; get_current is declared with code before use.
> ./include/asm-arm/unistd.h
False positive; _syscall3 is a macro containing code.
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-08-24 23:47 Broken inlines all over the source tree Luca Barbieri
2002-08-25 8:05 ` Russell King
@ 2002-08-25 10:16 ` Roger Luethi
2002-08-26 7:32 ` David S. Miller
2002-08-26 16:22 ` Greg KH
3 siblings, 0 replies; 12+ messages in thread
From: Roger Luethi @ 2002-08-25 10:16 UTC (permalink / raw)
To: Luca Barbieri; +Cc: Linux-Kernel ML, Kernel Janitors ML
On Sun, 25 Aug 2002 01:47:18 +0200, Luca Barbieri wrote:
> ./drivers/net/via-rhine.c
via_restart_tx() was already defined before use.
clear_tally_counters() is now fixed in my tree.
Thx.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-08-24 23:47 Broken inlines all over the source tree Luca Barbieri
2002-08-25 8:05 ` Russell King
2002-08-25 10:16 ` Roger Luethi
@ 2002-08-26 7:32 ` David S. Miller
2002-08-26 16:22 ` Greg KH
3 siblings, 0 replies; 12+ messages in thread
From: David S. Miller @ 2002-08-26 7:32 UTC (permalink / raw)
To: ldb; +Cc: linux-kernel, kernel-janitor-discuss
From: Luca Barbieri <ldb@ldb.ods.org>
Date: 25 Aug 2002 01:47:18 +0200
./include/net/ip.h
False positive, ip_finish_output is merely declared extern here with
the __inline__ attribute so that the functions args+attributes match
with what the real function definition has in net/ipv4/ip_output.c
We don't intend it to get inlined when called from other files :-)
./net/core/sock.c
ROFL, maybe your script is matching sk->urginline :-)
I can't find anything else in this file.
Franks a lot,
David S. Miller
davem@redhat.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-08-24 23:47 Broken inlines all over the source tree Luca Barbieri
` (2 preceding siblings ...)
2002-08-26 7:32 ` David S. Miller
@ 2002-08-26 16:22 ` Greg KH
2002-08-26 16:39 ` Luca Barbieri
` (3 more replies)
3 siblings, 4 replies; 12+ messages in thread
From: Greg KH @ 2002-08-26 16:22 UTC (permalink / raw)
To: Luca Barbieri, petkan, pe1rxq; +Cc: Linux-Kernel ML, Kernel Janitors ML
On Sun, Aug 25, 2002 at 01:47:18AM +0200, Luca Barbieri wrote:
> ./drivers/usb/media/se401.h
Should be fixed, Jeroen, do you want to do this?
> ./drivers/usb/serial/whiteheat.c
False positive, those functions are never even called :)
> ./drivers/usb/net/rtl8150.c
Should be fixed, Petko want to do it?
> ./drivers/usb/host/hc_simple.h
Hm, these also need to be fixed, but there doesn't seem to be a
maintainer for the code. I'll just take the inline marking off of them,
if no one minds.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-08-26 16:22 ` Greg KH
@ 2002-08-26 16:39 ` Luca Barbieri
2002-08-27 6:47 ` Petko Manolov
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Luca Barbieri @ 2002-08-26 16:39 UTC (permalink / raw)
To: Greg KH; +Cc: Linux-Kernel ML, Kernel Janitors ML
[-- Attachment #1: Type: text/plain, Size: 524 bytes --]
> > ./drivers/usb/serial/whiteheat.c
>
> False positive, those functions are never even called :)
Remove them :)
> > ./drivers/usb/host/hc_simple.h
>
> Hm, these also need to be fixed, but there doesn't seem to be a
> maintainer for the code. I'll just take the inline marking off of them,
> if no one minds.
Or you could fix them by removing the declarations and moving the
definitions where the declarations were (if they use something declared
between the declaration and the definition more changes are required).
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-08-26 16:22 ` Greg KH
2002-08-26 16:39 ` Luca Barbieri
@ 2002-08-27 6:47 ` Petko Manolov
2002-08-28 20:24 ` Jeroen Vreeken
2002-09-03 15:33 ` Jeroen Vreeken
3 siblings, 0 replies; 12+ messages in thread
From: Petko Manolov @ 2002-08-27 6:47 UTC (permalink / raw)
To: Greg KH; +Cc: Luca Barbieri, pe1rxq, Linux-Kernel ML, Kernel Janitors ML
> > ./drivers/usb/net/rtl8150.c
>
> Should be fixed, Petko want to do it?
Will send you a patch soon.
Petko
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-08-26 16:22 ` Greg KH
2002-08-26 16:39 ` Luca Barbieri
2002-08-27 6:47 ` Petko Manolov
@ 2002-08-28 20:24 ` Jeroen Vreeken
2002-09-03 15:33 ` Jeroen Vreeken
3 siblings, 0 replies; 12+ messages in thread
From: Jeroen Vreeken @ 2002-08-28 20:24 UTC (permalink / raw)
To: Greg KH; +Cc: Luca Barbieri, petkan, Linux-Kernel ML, Kernel Janitors ML
On 2002.08.26 18:22:05 +0200 Greg KH wrote:
> On Sun, Aug 25, 2002 at 01:47:18AM +0200, Luca Barbieri wrote:
> > ./drivers/usb/media/se401.h
>
> Should be fixed, Jeroen, do you want to do this?
Ok, already located the cause, I will check the other inlines to and send a
patch.
Jeroen
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-08-26 16:22 ` Greg KH
` (2 preceding siblings ...)
2002-08-28 20:24 ` Jeroen Vreeken
@ 2002-09-03 15:33 ` Jeroen Vreeken
2002-09-04 18:17 ` Greg KH
3 siblings, 1 reply; 12+ messages in thread
From: Jeroen Vreeken @ 2002-09-03 15:33 UTC (permalink / raw)
To: Greg KH; +Cc: Luca Barbieri, petkan, pe1rxq, Linux-Kernel ML,
Kernel Janitors ML
[-- Attachment #1: Type: text/plain, Size: 508 bytes --]
On 2002.08.26 18:22:05 +0200 Greg KH wrote:
> On Sun, Aug 25, 2002 at 01:47:18AM +0200, Luca Barbieri wrote:
> > ./drivers/usb/media/se401.h
>
> Should be fixed, Jeroen, do you want to do this?
Attached is a patch against 2.4.20-pre5 that updates the se401 driver to
update it to version 0.24.
This fixes the inline problem, a memory leak on disconnect and disables the
button for cameras that don't support it.
I haven't been folowing 2.5 for a while, but I think it will apply without
problems.
Jeroen
[-- Attachment #2: se401-0.24.diff --]
[-- Type: application/octet-stream, Size: 5473 bytes --]
--- linux/drivers/usb/se401.c.org Tue Sep 3 15:18:22 2002
+++ linux/drivers/usb/se401.c Tue Sep 3 17:19:06 2002
@@ -25,7 +25,7 @@
* - Jeroen Vreeken
*/
-static const char version[] = "0.23";
+static const char version[] = "0.24";
#include <linux/config.h>
#include <linux/module.h>
@@ -986,6 +986,35 @@
return 0;
}
+static void usb_se401_remove_disconnected (struct usb_se401 *se401)
+{
+ int i;
+
+ se401->dev = NULL;
+
+ for (i=0; i<SE401_NUMSBUF; i++) if (se401->urb[i]) {
+ se401->urb[i]->next = NULL;
+ usb_unlink_urb(se401->urb[i]);
+ usb_free_urb(se401->urb[i]);
+ se401->urb[i] = NULL;
+ kfree(se401->sbuf[i].data);
+ }
+ for (i=0; i<SE401_NUMSCRATCH; i++) if (se401->scratch[i].data) {
+ kfree(se401->scratch[i].data);
+ }
+ if (se401->inturb) {
+ usb_unlink_urb(se401->inturb);
+ usb_free_urb(se401->inturb);
+ }
+ info("%s disconnected", se401->camera_name);
+
+ /* Free the memory */
+ kfree(se401->width);
+ kfree(se401->height);
+ kfree(se401);
+}
+
+
/****************************************************************************
*
@@ -1020,21 +1049,17 @@
struct usb_se401 *se401 = (struct usb_se401 *)dev;
int i;
- for (i=0; i<SE401_NUMFRAMES; i++)
- se401->frame[i].grabstate=FRAME_UNUSED;
- if (se401->streaming)
- se401_stop_stream(se401);
-
rvfree(se401->fbuf, se401->maxframesize * SE401_NUMFRAMES);
- se401->user=0;
-
if (se401->removed) {
video_unregister_device(&se401->vdev);
- kfree(se401->width);
- kfree(se401->height);
- kfree(se401);
- se401 = NULL;
+ usb_se401_remove_disconnected(se401);
info("device unregistered");
+ } else {
+ for (i=0; i<SE401_NUMFRAMES; i++)
+ se401->frame[i].grabstate=FRAME_UNUSED;
+ if (se401->streaming)
+ se401_stop_stream(se401);
+ se401->user=0;
}
MOD_DEC_USE_COUNT;
@@ -1350,7 +1375,7 @@
/***************************/
-static int se401_init(struct usb_se401 *se401)
+static int se401_init(struct usb_se401 *se401, int button)
{
int i=0, rc;
unsigned char cp[0x40];
@@ -1415,22 +1440,25 @@
se401->readcount=0;
/* Start interrupt transfers for snapshot button */
- se401->inturb=usb_alloc_urb(0);
- if (!se401->inturb) {
- info("Allocation of inturb failed");
- return 1;
- }
- FILL_INT_URB(se401->inturb, se401->dev,
- usb_rcvintpipe(se401->dev, SE401_BUTTON_ENDPOINT),
- &se401->button, sizeof(se401->button),
- se401_button_irq,
- se401,
- HZ/10
- );
- if (usb_submit_urb(se401->inturb)) {
- info("int urb burned down");
- return 1;
- }
+ if (button) {
+ se401->inturb=usb_alloc_urb(0);
+ if (!se401->inturb) {
+ info("Allocation of inturb failed");
+ return 1;
+ }
+ FILL_INT_URB(se401->inturb, se401->dev,
+ usb_rcvintpipe(se401->dev, SE401_BUTTON_ENDPOINT),
+ &se401->button, sizeof(se401->button),
+ se401_button_irq,
+ se401,
+ HZ/10
+ );
+ if (usb_submit_urb(se401->inturb)) {
+ info("int urb burned down");
+ return 1;
+ }
+ } else
+ se401->inturb=NULL;
/* Flash the led */
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0);
@@ -1447,6 +1475,7 @@
struct usb_interface_descriptor *interface;
struct usb_se401 *se401;
char *camera_name=NULL;
+ int button=1;
/* We don't handle multi-config cameras */
if (dev->descriptor.bNumConfigurations != 1)
@@ -1470,6 +1499,7 @@
} else if (dev->descriptor.idVendor == 0x047d &&
dev->descriptor.idProduct == 0x5003) {
camera_name="Kensington VideoCAM 67016";
+ button=0;
} else
return NULL;
@@ -1495,7 +1525,7 @@
info("firmware version: %02x", dev->descriptor.bcdDevice & 255);
- if (se401_init(se401)) {
+ if (se401_init(se401, button)) {
kfree(se401);
return NULL;
}
@@ -1526,47 +1556,20 @@
video_unregister_device(&se401->vdev);
usb_se401_remove_disconnected(se401);
} else {
- se401->removed = 1;
- }
- unlock_kernel();
-}
+ se401->frame[0].grabstate = FRAME_ERROR;
+ se401->frame[1].grabstate = FRAME_ERROR;
-static inline void usb_se401_remove_disconnected (struct usb_se401 *se401)
-{
- int i;
-
- se401->dev = NULL;
- se401->frame[0].grabstate = FRAME_ERROR;
- se401->frame[1].grabstate = FRAME_ERROR;
+ se401->streaming = 0;
- se401->streaming = 0;
-
- wake_up_interruptible(&se401->wq);
-
- for (i=0; i<SE401_NUMSBUF; i++) if (se401->urb[i]) {
- se401->urb[i]->next = NULL;
- usb_unlink_urb(se401->urb[i]);
- usb_free_urb(se401->urb[i]);
- se401->urb[i] = NULL;
- kfree(se401->sbuf[i].data);
- }
- for (i=0; i<SE401_NUMSCRATCH; i++) if (se401->scratch[i].data) {
- kfree(se401->scratch[i].data);
- }
- if (se401->inturb) {
- usb_unlink_urb(se401->inturb);
- usb_free_urb(se401->inturb);
+ wake_up_interruptible(&se401->wq);
+ se401->removed = 1;
}
- info("%s disconnected", se401->camera_name);
#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
destroy_proc_se401_cam(se401);
#endif
- /* Free the memory */
- kfree(se401->width);
- kfree(se401->height);
- kfree(se401);
+ unlock_kernel();
}
static struct usb_driver se401_driver = {
--- linux/drivers/usb/se401.h.org Tue Sep 3 17:27:29 2002
+++ linux/drivers/usb/se401.h Tue Sep 3 17:28:11 2002
@@ -230,7 +230,6 @@
int nullpackets;
};
-static inline void usb_se401_remove_disconnected (struct usb_se401 *se401);
#endif
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-09-03 15:33 ` Jeroen Vreeken
@ 2002-09-04 18:17 ` Greg KH
2002-09-05 22:08 ` Jeroen Vreeken
0 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2002-09-04 18:17 UTC (permalink / raw)
To: Jeroen Vreeken; +Cc: Luca Barbieri, petkan, Linux-Kernel ML, Kernel Janitors ML
On Tue, Sep 03, 2002 at 05:33:47PM +0200, Jeroen Vreeken wrote:
> On 2002.08.26 18:22:05 +0200 Greg KH wrote:
> > On Sun, Aug 25, 2002 at 01:47:18AM +0200, Luca Barbieri wrote:
> > > ./drivers/usb/media/se401.h
> >
> > Should be fixed, Jeroen, do you want to do this?
>
> Attached is a patch against 2.4.20-pre5 that updates the se401 driver to
> update it to version 0.24.
> This fixes the inline problem, a memory leak on disconnect and disables the
> button for cameras that don't support it.
>
> I haven't been folowing 2.5 for a while, but I think it will apply without
> problems.
Sorry, but the patch does not apply (even after adjusting the path). I
get lots of failed hunks.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-09-04 18:17 ` Greg KH
@ 2002-09-05 22:08 ` Jeroen Vreeken
2002-09-09 21:20 ` Greg KH
0 siblings, 1 reply; 12+ messages in thread
From: Jeroen Vreeken @ 2002-09-05 22:08 UTC (permalink / raw)
To: Greg KH; +Cc: Linux-Kernel ML, Kernel Janitors ML
[-- Attachment #1: Type: text/plain, Size: 866 bytes --]
On 2002.09.04 20:17:23 +0200 Greg KH wrote:
> On Tue, Sep 03, 2002 at 05:33:47PM +0200, Jeroen Vreeken wrote:
> > On 2002.08.26 18:22:05 +0200 Greg KH wrote:
> > > On Sun, Aug 25, 2002 at 01:47:18AM +0200, Luca Barbieri wrote:
> > > > ./drivers/usb/media/se401.h
> > >
> > > Should be fixed, Jeroen, do you want to do this?
> >
> > Attached is a patch against 2.4.20-pre5 that updates the se401 driver
> to
> > update it to version 0.24.
> > This fixes the inline problem, a memory leak on disconnect and disables
> the
> > button for cameras that don't support it.
> >
> > I haven't been folowing 2.5 for a while, but I think it will apply
> without
> > problems.
>
> Sorry, but the patch does not apply (even after adjusting the path). I
> get lots of failed hunks.
I made a new patch against 2.5.33, it was mostly litle things like the v4l
changes.
Jeroen
[-- Attachment #2: se401-0.24-2.5.33.diff --]
[-- Type: application/octet-stream, Size: 5397 bytes --]
--- linux-2.5.33/drivers/usb/media/se401.c.org Thu Sep 5 23:27:06 2002
+++ linux-2.5.33/drivers/usb/media/se401.c Thu Sep 5 23:59:53 2002
@@ -25,7 +25,7 @@
* - Jeroen Vreeken
*/
-static const char version[] = "0.23";
+static const char version[] = "0.24";
#include <linux/config.h>
#include <linux/module.h>
@@ -980,6 +980,34 @@
return 0;
}
+static void usb_se401_remove_disconnected (struct usb_se401 *se401)
+{
+ int i;
+
+ se401->dev = NULL;
+
+ for (i=0; i<SE401_NUMSBUF; i++) if (se401->urb[i]) {
+ usb_unlink_urb(se401->urb[i]);
+ usb_free_urb(se401->urb[i]);
+ se401->urb[i] = NULL;
+ kfree(se401->sbuf[i].data);
+ }
+ for (i=0; i<SE401_NUMSCRATCH; i++) if (se401->scratch[i].data) {
+ kfree(se401->scratch[i].data);
+ }
+ if (se401->inturb) {
+ usb_unlink_urb(se401->inturb);
+ usb_free_urb(se401->inturb);
+ }
+ info("%s disconnected", se401->camera_name);
+
+ /* Free the memory */
+ kfree(se401->width);
+ kfree(se401->height);
+ kfree(se401);
+}
+
+
/****************************************************************************
*
@@ -1015,20 +1043,16 @@
struct usb_se401 *se401 = (struct usb_se401 *)dev;
int i;
- for (i=0; i<SE401_NUMFRAMES; i++)
- se401->frame[i].grabstate=FRAME_UNUSED;
- if (se401->streaming)
- se401_stop_stream(se401);
-
rvfree(se401->fbuf, se401->maxframesize * SE401_NUMFRAMES);
- se401->user=0;
-
if (se401->removed) {
- kfree(se401->width);
- kfree(se401->height);
- kfree(se401);
- se401 = NULL;
+ usb_se401_remove_disconnected(se401);
info("device unregistered");
+ } else {
+ for (i=0; i<SE401_NUMFRAMES; i++)
+ se401->frame[i].grabstate=FRAME_UNUSED;
+ if (se401->streaming)
+ se401_stop_stream(se401);
+ se401->user=0;
}
file->private_data = NULL;
return 0;
@@ -1302,7 +1326,7 @@
/***************************/
-static int se401_init(struct usb_se401 *se401)
+static int se401_init(struct usb_se401 *se401, int button)
{
int i=0, rc;
unsigned char cp[0x40];
@@ -1367,22 +1391,25 @@
se401->readcount=0;
/* Start interrupt transfers for snapshot button */
- se401->inturb=usb_alloc_urb(0, GFP_KERNEL);
- if (!se401->inturb) {
- info("Allocation of inturb failed");
- return 1;
- }
- FILL_INT_URB(se401->inturb, se401->dev,
- usb_rcvintpipe(se401->dev, SE401_BUTTON_ENDPOINT),
- &se401->button, sizeof(se401->button),
- se401_button_irq,
- se401,
- HZ/10
- );
- if (usb_submit_urb(se401->inturb, GFP_KERNEL)) {
- info("int urb burned down");
- return 1;
- }
+ if (button) {
+ se401->inturb=usb_alloc_urb(0, GFP_KERNEL);
+ if (!se401->inturb) {
+ info("Allocation of inturb failed");
+ return 1;
+ }
+ FILL_INT_URB(se401->inturb, se401->dev,
+ usb_rcvintpipe(se401->dev, SE401_BUTTON_ENDPOINT),
+ &se401->button, sizeof(se401->button),
+ se401_button_irq,
+ se401,
+ HZ/10
+ );
+ if (usb_submit_urb(se401->inturb, GFP_KERNEL)) {
+ info("int urb burned down");
+ return 1;
+ }
+ } else
+ se401->inturb=NULL;
/* Flash the led */
se401_sndctrl(1, se401, SE401_REQ_CAMERA_POWER, 1, NULL, 0);
@@ -1399,6 +1426,7 @@
struct usb_interface_descriptor *interface;
struct usb_se401 *se401;
char *camera_name=NULL;
+ int button=1;
/* We don't handle multi-config cameras */
if (dev->descriptor.bNumConfigurations != 1)
@@ -1422,6 +1450,7 @@
} else if (dev->descriptor.idVendor == 0x047d &&
dev->descriptor.idProduct == 0x5003) {
camera_name="Kensington VideoCAM 67016";
+ button=0;
} else
return NULL;
@@ -1447,7 +1476,7 @@
info("firmware version: %02x", dev->descriptor.bcdDevice & 255);
- if (se401_init(se401)) {
+ if (se401_init(se401, button)) {
kfree(se401);
return NULL;
}
@@ -1479,45 +1508,18 @@
if (!se401->user){
usb_se401_remove_disconnected(se401);
} else {
- se401->removed = 1;
- }
-}
+ se401->frame[0].grabstate = FRAME_ERROR;
+ se401->frame[0].grabstate = FRAME_ERROR;
-static inline void usb_se401_remove_disconnected (struct usb_se401 *se401)
-{
- int i;
-
- se401->dev = NULL;
- se401->frame[0].grabstate = FRAME_ERROR;
- se401->frame[1].grabstate = FRAME_ERROR;
-
- se401->streaming = 0;
-
- wake_up_interruptible(&se401->wq);
-
- for (i=0; i<SE401_NUMSBUF; i++) if (se401->urb[i]) {
- usb_unlink_urb(se401->urb[i]);
- usb_free_urb(se401->urb[i]);
- se401->urb[i] = NULL;
- kfree(se401->sbuf[i].data);
- }
- for (i=0; i<SE401_NUMSCRATCH; i++) if (se401->scratch[i].data) {
- kfree(se401->scratch[i].data);
- }
- if (se401->inturb) {
- usb_unlink_urb(se401->inturb);
- usb_free_urb(se401->inturb);
+ se401->streaming = 0;
+
+ wake_up_interruptible(&se401->wq);
+ se401->removed = 1;
}
- info("%s disconnected", se401->camera_name);
-
#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS)
destroy_proc_se401_cam(se401);
#endif
- /* Free the memory */
- kfree(se401->width);
- kfree(se401->height);
- kfree(se401);
}
static struct usb_driver se401_driver = {
--- linux-2.5.33/drivers/usb/media/se401.h.org Thu Sep 5 23:27:10 2002
+++ linux-2.5.33/drivers/usb/media/se401.h Thu Sep 5 23:27:15 2002
@@ -230,7 +230,6 @@
int nullpackets;
};
-static inline void usb_se401_remove_disconnected (struct usb_se401 *se401);
#endif
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: Broken inlines all over the source tree
2002-09-05 22:08 ` Jeroen Vreeken
@ 2002-09-09 21:20 ` Greg KH
0 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2002-09-09 21:20 UTC (permalink / raw)
To: Jeroen Vreeken; +Cc: Linux-Kernel ML, Kernel Janitors ML
On Fri, Sep 06, 2002 at 12:08:32AM +0200, Jeroen Vreeken wrote:
>
> I made a new patch against 2.5.33, it was mostly litle things like the v4l
> changes.
This works fine, applied.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2002-09-09 21:18 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-24 23:47 Broken inlines all over the source tree Luca Barbieri
2002-08-25 8:05 ` Russell King
2002-08-25 10:16 ` Roger Luethi
2002-08-26 7:32 ` David S. Miller
2002-08-26 16:22 ` Greg KH
2002-08-26 16:39 ` Luca Barbieri
2002-08-27 6:47 ` Petko Manolov
2002-08-28 20:24 ` Jeroen Vreeken
2002-09-03 15:33 ` Jeroen Vreeken
2002-09-04 18:17 ` Greg KH
2002-09-05 22:08 ` Jeroen Vreeken
2002-09-09 21:20 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox