Re: Kill I4L?
Am 08.02.2015 um 20:47 schrieb Tilman Schmidt: > Am 07.02.2015 um 21:43 schrieb Paul Bolle: >> On Sat, 2015-02-07 at 11:19 -0800, Joe Perches wrote: >>> Does anyone still use these cards? > >> 0) Good question. > > I very much doubt it. It was an ISA card, not even PnP. I'd imagine > any systems of that kind would be retired by now. > Agreed in general, but I know people still running such ISA based machines - mostly PC in industrial environments with ISDN uplinks for service and maintenance. And I4L is also used in some vending machines for card authorization so far I know. They usually using old kernels (<3.0) so they are not directly affected if this will be removed. >> 2) Broader picture: if I remember correctly there are now four >> different flavors of ISDN in the kernel: - really old: pre-i4l > > I don't think any traces of that are still present in current kernel > releases. It should all have been left behind on the switch to 2.6. > Yes. >> - very old: i4l - just old: CAPI - not so old: mISDN > > Those are the in-tree ones. To make matters worse, the Asterisk people > invented three more (Zaptel, DAHDI and vISDN) which are maintained > out-of-tree. Apparently they weren't satisfied with any the in-tree > ones and didn't feel like helping to improve one of them to match > their needs. > >> [snip] So the current ISDN situation is a bit messy. > > That's putting it mildly. > >> Tilman might be able to provide a clearer, and maybe less grumpy, >> summary of the current situation. > > Don't know about either. ;-) > >> [M]aybe we should consider, say, removing i4l and pre i4l and see >> who complains. That might be a rude thing to do. So perhaps the >> various ISDN flavors should be left alone until ... what exactly? > > I'd support that step. I don't think it'll hurt anyone because the > cards supported by i4l are mostly ISA cards anyway. The only exceptions > are the HiSax family which is now supported by mISDN, and the Hypercope > family which is supported by CAPI. > > In the past we had Documentation/feature-removal-schedule.txt for > announcing removals like that but Linus shot that down on 2012-10-01 > (commit 9c0ece069b32e8e122aea71aa47181c10eb85ba7) so I guess > somebody could just submit a patch series starting with > > --- a/drivers/isdn/Kconfig > +++ b/drivers/isdn/Kconfig > @@ -20,25 +20,6 @@ menuconfig ISDN > > if ISDN > > -menuconfig ISDN_I4L > - tristate "Old ISDN4Linux (deprecated)" > - depends on TTY > - ---help--- > - This driver allows you to use an ISDN adapter for networking > - connections and as dialin/out device. The isdn-tty's have a > built > - in AT-compatible modem emulator. Network devices support > autodial, > - channel-bundling, callback and caller-authentication without > having > - a daemon running. A reduced T.70 protocol is supported with > tty's > - suitable for German BTX. On D-Channel, the protocols EDSS1 > - (Euro-ISDN) and 1TR6 (German style) are supported. See > - for more information. > - > - ISDN support in the linux kernel is moving towards a new API, > - called CAPI (Common ISDN Application Programming Interface). > - Therefore the old ISDN4Linux layer will eventually become > obsolete. > - It is still available, though, for use with adapters that > are not > - supported by the new CAPI subsystem yet. > - > source "drivers/isdn/i4l/Kconfig" > > menuconfig ISDN_CAPI > > and working its way from that to remove anything that's become > unreachable. > > Shall I? > But I4L is still the default in some Distros, so we should allow a warning period. But again, I'm fine with this to do it. Karsten -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Kill I4L?
Am 08.02.2015 um 20:47 schrieb Tilman Schmidt: Am 07.02.2015 um 21:43 schrieb Paul Bolle: On Sat, 2015-02-07 at 11:19 -0800, Joe Perches wrote: Does anyone still use these cards? 0) Good question. I very much doubt it. It was an ISA card, not even PnP. I'd imagine any systems of that kind would be retired by now. Agreed in general, but I know people still running such ISA based machines - mostly PC in industrial environments with ISDN uplinks for service and maintenance. And I4L is also used in some vending machines for card authorization so far I know. They usually using old kernels (3.0) so they are not directly affected if this will be removed. 2) Broader picture: if I remember correctly there are now four different flavors of ISDN in the kernel: - really old: pre-i4l I don't think any traces of that are still present in current kernel releases. It should all have been left behind on the switch to 2.6. Yes. - very old: i4l - just old: CAPI - not so old: mISDN Those are the in-tree ones. To make matters worse, the Asterisk people invented three more (Zaptel, DAHDI and vISDN) which are maintained out-of-tree. Apparently they weren't satisfied with any the in-tree ones and didn't feel like helping to improve one of them to match their needs. [snip] So the current ISDN situation is a bit messy. That's putting it mildly. Tilman might be able to provide a clearer, and maybe less grumpy, summary of the current situation. Don't know about either. ;-) [M]aybe we should consider, say, removing i4l and pre i4l and see who complains. That might be a rude thing to do. So perhaps the various ISDN flavors should be left alone until ... what exactly? I'd support that step. I don't think it'll hurt anyone because the cards supported by i4l are mostly ISA cards anyway. The only exceptions are the HiSax family which is now supported by mISDN, and the Hypercope family which is supported by CAPI. In the past we had Documentation/feature-removal-schedule.txt for announcing removals like that but Linus shot that down on 2012-10-01 (commit 9c0ece069b32e8e122aea71aa47181c10eb85ba7) so I guess somebody could just submit a patch series starting with --- a/drivers/isdn/Kconfig +++ b/drivers/isdn/Kconfig @@ -20,25 +20,6 @@ menuconfig ISDN if ISDN -menuconfig ISDN_I4L - tristate Old ISDN4Linux (deprecated) - depends on TTY - ---help--- - This driver allows you to use an ISDN adapter for networking - connections and as dialin/out device. The isdn-tty's have a built - in AT-compatible modem emulator. Network devices support autodial, - channel-bundling, callback and caller-authentication without having - a daemon running. A reduced T.70 protocol is supported with tty's - suitable for German BTX. On D-Channel, the protocols EDSS1 - (Euro-ISDN) and 1TR6 (German style) are supported. See - file:Documentation/isdn/README for more information. - - ISDN support in the linux kernel is moving towards a new API, - called CAPI (Common ISDN Application Programming Interface). - Therefore the old ISDN4Linux layer will eventually become obsolete. - It is still available, though, for use with adapters that are not - supported by the new CAPI subsystem yet. - source drivers/isdn/i4l/Kconfig menuconfig ISDN_CAPI and working its way from that to remove anything that's become unreachable. Shall I? But I4L is still the default in some Distros, so we should allow a warning period. But again, I'm fine with this to do it. Karsten -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 00/16] sleep_on removal, second try
Am 26.02.2014 12:01, schrieb Arnd Bergmann: > It's been a while since the first submission of these patches, > but a lot of them have made it into linux-next already, so here > is the stuff that is not merged yet, hopefully addressing all > the comments. > > Geert and Michael: the I was expecting the ataflop and atari_scsi > patches to be merged already, based on earlier discussion. > Can you apply them to the linux-m68k tree, or do you prefer > them to go through the scsi and block maintainers? > > Jens: I did not get any comments for the DAC960 and swim3 patches, > I assume they are good to go in. Please merge. > > Hans and Mauro: As I commented on the old thread, I thought the > four media patches were on their way. I have addressed the one > comment that I missed earlier now, and used Hans' version for > the two patches he changed. Please merge or let me know the status > if you have already put them in some tree, but not yet into linux-next > > Greg or Andrew: The parport subsystem is orphaned unfortunately, > can one of you pick up that patch? > > Davem: The two ATM patches got acks, but I did not hear back from > Karsten regarding the ISDN patches. Can you pick up all six, or > should we wait for comments about the ISDN patches? > Ack on the ISDN stuff (12,13,14,15) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 00/16] sleep_on removal, second try
Am 26.02.2014 12:01, schrieb Arnd Bergmann: It's been a while since the first submission of these patches, but a lot of them have made it into linux-next already, so here is the stuff that is not merged yet, hopefully addressing all the comments. Geert and Michael: the I was expecting the ataflop and atari_scsi patches to be merged already, based on earlier discussion. Can you apply them to the linux-m68k tree, or do you prefer them to go through the scsi and block maintainers? Jens: I did not get any comments for the DAC960 and swim3 patches, I assume they are good to go in. Please merge. Hans and Mauro: As I commented on the old thread, I thought the four media patches were on their way. I have addressed the one comment that I missed earlier now, and used Hans' version for the two patches he changed. Please merge or let me know the status if you have already put them in some tree, but not yet into linux-next Greg or Andrew: The parport subsystem is orphaned unfortunately, can one of you pick up that patch? Davem: The two ATM patches got acks, but I did not hear back from Karsten regarding the ISDN patches. Can you pick up all six, or should we wait for comments about the ISDN patches? Ack on the ISDN stuff (12,13,14,15) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH linux-next] hisax: disable build for big-endian arm
Am 22.11.2013 08:29, schrieb Takashi Iwai: > At Fri, 22 Nov 2013 00:49:54 +0100, > Vincent Stehlé wrote: >> >> Teles PCI and HFC PCI-bus refuse to build on big-endian ARM; disable them in >> Kconfig. >> >> Signed-off-by: Vincent Stehlé >> Cc: Karsten Keil >> --- >> >> Hi, >> >> This can be seen on e.g. linux next-20131121 with arm allyesconfig. >> >> Best regards, >> >> V. >> >> drivers/isdn/hisax/Kconfig | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig >> index d9edcc9..53dbb75 100644 >> --- a/drivers/isdn/hisax/Kconfig >> +++ b/drivers/isdn/hisax/Kconfig >> @@ -109,7 +109,7 @@ config HISAX_16_3 >> >> config HISAX_TELESPCI >> bool "Teles PCI" >> -depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS >> && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN))) >> +depends on PCI && (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS >> && !CPU_LITTLE_ENDIAN) || FRV || (XTENSA && !CPU_LITTLE_ENDIAN) || (ARM && >> !CPU_LITTLE_ENDIAN))) > > Isn't it a bit better to exclude CPU_LITTLE_ENDIAN globally? > > depends on PCI && CPU_LITTLE_ENDIAN && (BROKEN || !(SPARC || PPC || > PARISC || M68K || MIPS || FRV || XTENSA || ARM)) > > Or maybe just > > depends on PCI && (X86 || BROKEN) > > (Alpha? Can anyone test? :) I never got this card so it was never in my tests, if I remember correctely somebody had it running with Alpha before 2000. And yes I'm fine if we simplify this mess to only X86. Karsten -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH linux-next] hisax: disable build for big-endian arm
Am 22.11.2013 08:29, schrieb Takashi Iwai: At Fri, 22 Nov 2013 00:49:54 +0100, Vincent Stehlé wrote: Teles PCI and HFC PCI-bus refuse to build on big-endian ARM; disable them in Kconfig. Signed-off-by: Vincent Stehlé vincent.ste...@laposte.net Cc: Karsten Keil i...@linux-pingi.de --- Hi, This can be seen on e.g. linux next-20131121 with arm allyesconfig. Best regards, V. drivers/isdn/hisax/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/isdn/hisax/Kconfig b/drivers/isdn/hisax/Kconfig index d9edcc9..53dbb75 100644 --- a/drivers/isdn/hisax/Kconfig +++ b/drivers/isdn/hisax/Kconfig @@ -109,7 +109,7 @@ config HISAX_16_3 config HISAX_TELESPCI bool Teles PCI -depends on PCI (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS !CPU_LITTLE_ENDIAN) || FRV || (XTENSA !CPU_LITTLE_ENDIAN))) +depends on PCI (BROKEN || !(SPARC || PPC || PARISC || M68K || (MIPS !CPU_LITTLE_ENDIAN) || FRV || (XTENSA !CPU_LITTLE_ENDIAN) || (ARM !CPU_LITTLE_ENDIAN))) Isn't it a bit better to exclude CPU_LITTLE_ENDIAN globally? depends on PCI CPU_LITTLE_ENDIAN (BROKEN || !(SPARC || PPC || PARISC || M68K || MIPS || FRV || XTENSA || ARM)) Or maybe just depends on PCI (X86 || BROKEN) (Alpha? Can anyone test? :) I never got this card so it was never in my tests, if I remember correctely somebody had it running with Alpha before 2000. And yes I'm fine if we simplify this mess to only X86. Karsten -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 09/36] ISDN: convert class code to use dev_groups
Am 25.07.2013 00:05, schrieb Greg Kroah-Hartman: > The dev_attrs field of struct class is going away soon, dev_groups > should be used instead. This converts the mISDN class code to use the > correct field. > > Cc: Karsten Keil > Signed-off-by: Greg Kroah-Hartman Acked-by: Karsten Keil > --- > > Karsten, feel free to apply this to your tree, or ACK it and I can take it > through mine. > > drivers/isdn/mISDN/core.c | 64 > ++- > 1 file changed, 36 insertions(+), 28 deletions(-) > > diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c > index da30c5cb..faf50546 100644 > --- a/drivers/isdn/mISDN/core.c > +++ b/drivers/isdn/mISDN/core.c > @@ -37,8 +37,8 @@ static void mISDN_dev_release(struct device *dev) > /* nothing to do: the device is part of its parent's data structure */ > } > > -static ssize_t _show_id(struct device *dev, > - struct device_attribute *attr, char *buf) > +static ssize_t id_show(struct device *dev, > +struct device_attribute *attr, char *buf) > { > struct mISDNdevice *mdev = dev_to_mISDN(dev); > > @@ -46,9 +46,10 @@ static ssize_t _show_id(struct device *dev, > return -ENODEV; > return sprintf(buf, "%d\n", mdev->id); > } > +static DEVICE_ATTR_RO(id); > > -static ssize_t _show_nrbchan(struct device *dev, > - struct device_attribute *attr, char *buf) > +static ssize_t nrbchan_show(struct device *dev, > + struct device_attribute *attr, char *buf) > { > struct mISDNdevice *mdev = dev_to_mISDN(dev); > > @@ -56,9 +57,10 @@ static ssize_t _show_nrbchan(struct device *dev, > return -ENODEV; > return sprintf(buf, "%d\n", mdev->nrbchan); > } > +static DEVICE_ATTR_RO(nrbchan); > > -static ssize_t _show_d_protocols(struct device *dev, > - struct device_attribute *attr, char *buf) > +static ssize_t d_protocols_show(struct device *dev, > + struct device_attribute *attr, char *buf) > { > struct mISDNdevice *mdev = dev_to_mISDN(dev); > > @@ -66,9 +68,10 @@ static ssize_t _show_d_protocols(struct device *dev, > return -ENODEV; > return sprintf(buf, "%d\n", mdev->Dprotocols); > } > +static DEVICE_ATTR_RO(d_protocols); > > -static ssize_t _show_b_protocols(struct device *dev, > - struct device_attribute *attr, char *buf) > +static ssize_t b_protocols_show(struct device *dev, > + struct device_attribute *attr, char *buf) > { > struct mISDNdevice *mdev = dev_to_mISDN(dev); > > @@ -76,9 +79,10 @@ static ssize_t _show_b_protocols(struct device *dev, > return -ENODEV; > return sprintf(buf, "%d\n", mdev->Bprotocols | get_all_Bprotocols()); > } > +static DEVICE_ATTR_RO(b_protocols); > > -static ssize_t _show_protocol(struct device *dev, > - struct device_attribute *attr, char *buf) > +static ssize_t protocol_show(struct device *dev, > + struct device_attribute *attr, char *buf) > { > struct mISDNdevice *mdev = dev_to_mISDN(dev); > > @@ -86,17 +90,19 @@ static ssize_t _show_protocol(struct device *dev, > return -ENODEV; > return sprintf(buf, "%d\n", mdev->D.protocol); > } > +static DEVICE_ATTR_RO(protocol); > > -static ssize_t _show_name(struct device *dev, > - struct device_attribute *attr, char *buf) > +static ssize_t name_show(struct device *dev, > + struct device_attribute *attr, char *buf) > { > strcpy(buf, dev_name(dev)); > return strlen(buf); > } > +static DEVICE_ATTR_RO(name); > > #if 0 /* hangs */ > -static ssize_t _set_name(struct device *dev, struct device_attribute *attr, > - const char *buf, size_t count) > +static ssize_t name_set(struct device *dev, struct device_attribute *attr, > + const char *buf, size_t count) > { > int err = 0; > char *out = kmalloc(count + 1, GFP_KERNEL); > @@ -113,10 +119,11 @@ static ssize_t _set_name(struct device *dev, struct > device_attribute *attr, > > return (err < 0) ? err : count; > } > +static DEVICE_ATTR_RW(name); > #endif > > -static ssize_t _show_channelmap(struct device *dev, > - struct device_attribute *attr, char *buf) > +static ssize_t channelmap_show(struct device *dev, > +struct
Re: [PATCH 09/36] ISDN: convert class code to use dev_groups
Am 25.07.2013 00:05, schrieb Greg Kroah-Hartman: The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the mISDN class code to use the correct field. Cc: Karsten Keil i...@linux-pingi.de Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org Acked-by: Karsten Keil i...@linux-pingi.de --- Karsten, feel free to apply this to your tree, or ACK it and I can take it through mine. drivers/isdn/mISDN/core.c | 64 ++- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/drivers/isdn/mISDN/core.c b/drivers/isdn/mISDN/core.c index da30c5cb..faf50546 100644 --- a/drivers/isdn/mISDN/core.c +++ b/drivers/isdn/mISDN/core.c @@ -37,8 +37,8 @@ static void mISDN_dev_release(struct device *dev) /* nothing to do: the device is part of its parent's data structure */ } -static ssize_t _show_id(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t id_show(struct device *dev, +struct device_attribute *attr, char *buf) { struct mISDNdevice *mdev = dev_to_mISDN(dev); @@ -46,9 +46,10 @@ static ssize_t _show_id(struct device *dev, return -ENODEV; return sprintf(buf, %d\n, mdev-id); } +static DEVICE_ATTR_RO(id); -static ssize_t _show_nrbchan(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t nrbchan_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct mISDNdevice *mdev = dev_to_mISDN(dev); @@ -56,9 +57,10 @@ static ssize_t _show_nrbchan(struct device *dev, return -ENODEV; return sprintf(buf, %d\n, mdev-nrbchan); } +static DEVICE_ATTR_RO(nrbchan); -static ssize_t _show_d_protocols(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t d_protocols_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct mISDNdevice *mdev = dev_to_mISDN(dev); @@ -66,9 +68,10 @@ static ssize_t _show_d_protocols(struct device *dev, return -ENODEV; return sprintf(buf, %d\n, mdev-Dprotocols); } +static DEVICE_ATTR_RO(d_protocols); -static ssize_t _show_b_protocols(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t b_protocols_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct mISDNdevice *mdev = dev_to_mISDN(dev); @@ -76,9 +79,10 @@ static ssize_t _show_b_protocols(struct device *dev, return -ENODEV; return sprintf(buf, %d\n, mdev-Bprotocols | get_all_Bprotocols()); } +static DEVICE_ATTR_RO(b_protocols); -static ssize_t _show_protocol(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t protocol_show(struct device *dev, + struct device_attribute *attr, char *buf) { struct mISDNdevice *mdev = dev_to_mISDN(dev); @@ -86,17 +90,19 @@ static ssize_t _show_protocol(struct device *dev, return -ENODEV; return sprintf(buf, %d\n, mdev-D.protocol); } +static DEVICE_ATTR_RO(protocol); -static ssize_t _show_name(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t name_show(struct device *dev, + struct device_attribute *attr, char *buf) { strcpy(buf, dev_name(dev)); return strlen(buf); } +static DEVICE_ATTR_RO(name); #if 0 /* hangs */ -static ssize_t _set_name(struct device *dev, struct device_attribute *attr, - const char *buf, size_t count) +static ssize_t name_set(struct device *dev, struct device_attribute *attr, + const char *buf, size_t count) { int err = 0; char *out = kmalloc(count + 1, GFP_KERNEL); @@ -113,10 +119,11 @@ static ssize_t _set_name(struct device *dev, struct device_attribute *attr, return (err 0) ? err : count; } +static DEVICE_ATTR_RW(name); #endif -static ssize_t _show_channelmap(struct device *dev, - struct device_attribute *attr, char *buf) +static ssize_t channelmap_show(struct device *dev, +struct device_attribute *attr, char *buf) { struct mISDNdevice *mdev = dev_to_mISDN(dev); char *bp = buf; @@ -127,18 +134,19 @@ static ssize_t _show_channelmap(struct device *dev, return bp - buf; } - -static struct device_attribute mISDN_dev_attrs[] = { - __ATTR(id, S_IRUGO, _show_id, NULL), - __ATTR(d_protocols, S_IRUGO, _show_d_protocols, NULL), - __ATTR(b_protocols, S_IRUGO, _show_b_protocols, NULL
Re: [PATCH v2] isdnloop: fix and simplify isdnloop_init()
Am 03.08.2012 09:32, schrieb Fengguang Wu: > On Thu, Aug 02, 2012 at 04:21:56PM -0700, David Miller wrote: >> From: Fengguang Wu >> Date: Thu, 2 Aug 2012 19:05:43 +0800 >> >>> Fix a buffer overflow bug by removing the revision transform code. >>> >>> [ 22.016214] isdnloop-ISDN-driver Rev 1.11.6.7 >>> [ 22.097508] isdnloop: (loop0) virtual card added >>> [ 22.174400] Kernel panic - not syncing: stack-protector: Kernel stack is >>> corrupted in: 83244972 >>> [ 22.174400] >>> [ 22.436157] Pid: 1, comm: swapper Not tainted >>> 3.5.0-bisect-00018-gfa8bbb1-dirty #129 >>> [ 22.624071] Call Trace: >>> [ 22.720558] [] ? CallcNew+0x56/0x56 >>> [ 22.815248] [] panic+0x110/0x329 >>> [ 22.914330] [] ? isdnloop_init+0xaf/0xb1 >>> [ 23.014800] [] ? CallcNew+0x56/0x56 >>> [ 23.090763] [] __stack_chk_fail+0x2b/0x30 >>> [ 23.185748] [] isdnloop_init+0xaf/0xb1 >>> >>> Signed-off-by: Fengguang Wu >> >> The reason the "$Revision ..." prefix is there is so that automated >> version control tools will change the string automatically when code >> is committed in CVS. >> >> In the GIT era this revision style is obsolete. >> >> Therefore you might as well just delete this crap altogether. > > OK. The below updated version will simply print the hard coded > revision number as it's unlikely to change any more. > > Thanks, > Fengguang > --- > isdnloop: fix and simplify isdnloop_init > > Fix a buffer overflow bug by hard coding the revision number. > > [ 22.016214] isdnloop-ISDN-driver Rev 1.11.6.7 > [ 22.097508] isdnloop: (loop0) virtual card added > [ 22.174400] Kernel panic - not syncing: stack-protector: Kernel stack is > corrupted in: 83244972 > [ 22.174400] > [ 22.436157] Pid: 1, comm: swapper Not tainted > 3.5.0-bisect-00018-gfa8bbb1-dirty #129 > [ 22.624071] Call Trace: > [ 22.720558] [] ? CallcNew+0x56/0x56 > [ 22.815248] [] panic+0x110/0x329 > [ 22.914330] [] ? isdnloop_init+0xaf/0xb1 > [ 23.014800] [] ? CallcNew+0x56/0x56 > [ 23.090763] [] __stack_chk_fail+0x2b/0x30 > [ 23.185748] [] isdnloop_init+0xaf/0xb1 > > Signed-off-by: Fengguang Wu > --- > drivers/isdn/isdnloop/isdnloop.c | 12 +--- > 1 file changed, 1 insertion(+), 11 deletions(-) > > --- linux.orig/drivers/isdn/isdnloop/isdnloop.c 2012-08-03 > 15:24:49.047544323 +0800 > +++ linux/drivers/isdn/isdnloop/isdnloop.c2012-08-03 15:27:39.503548375 > +0800 > @@ -16,7 +16,6 @@ > #include > #include "isdnloop.h" > > -static char *revision = "$Revision: 1.11.6.7 $"; > static char *isdnloop_id = "loop0"; > > MODULE_DESCRIPTION("ISDN4Linux: Pseudo Driver that simulates an ISDN card"); > @@ -1494,16 +1493,7 @@ isdnloop_addcard(char *id1) > static int __init > isdnloop_init(void) > { > - char *p; > - char rev[10]; > - > - if ((p = strchr(revision, ':'))) { > - strcpy(rev, p + 1); > - p = strchr(rev, '$'); > - *p = 0; > - } else > - strcpy(rev, " ??? "); > - printk(KERN_NOTICE "isdnloop-ISDN-driver Rev%s\n", rev); > + printk(KERN_NOTICE "isdnloop-ISDN-driver Rev 1.11.6.7\n"); > > if (isdnloop_id) > return (isdnloop_addcard(isdnloop_id)); > > You could remove the revision completely, even from the printk. Maybe use pr_notice("isdnloop-ISDN driver loaded\n"); Best Regards Karsten -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] isdnloop: fix and simplify isdnloop_init()
Am 03.08.2012 09:32, schrieb Fengguang Wu: On Thu, Aug 02, 2012 at 04:21:56PM -0700, David Miller wrote: From: Fengguang Wu fengguang...@intel.com Date: Thu, 2 Aug 2012 19:05:43 +0800 Fix a buffer overflow bug by removing the revision transform code. [ 22.016214] isdnloop-ISDN-driver Rev 1.11.6.7 [ 22.097508] isdnloop: (loop0) virtual card added [ 22.174400] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: 83244972 [ 22.174400] [ 22.436157] Pid: 1, comm: swapper Not tainted 3.5.0-bisect-00018-gfa8bbb1-dirty #129 [ 22.624071] Call Trace: [ 22.720558] [832448c3] ? CallcNew+0x56/0x56 [ 22.815248] [8222b623] panic+0x110/0x329 [ 22.914330] [83244972] ? isdnloop_init+0xaf/0xb1 [ 23.014800] [832448c3] ? CallcNew+0x56/0x56 [ 23.090763] [8108e24b] __stack_chk_fail+0x2b/0x30 [ 23.185748] [83244972] isdnloop_init+0xaf/0xb1 Signed-off-by: Fengguang Wu fengguang...@intel.com The reason the $Revision ... prefix is there is so that automated version control tools will change the string automatically when code is committed in CVS. In the GIT era this revision style is obsolete. Therefore you might as well just delete this crap altogether. OK. The below updated version will simply print the hard coded revision number as it's unlikely to change any more. Thanks, Fengguang --- isdnloop: fix and simplify isdnloop_init Fix a buffer overflow bug by hard coding the revision number. [ 22.016214] isdnloop-ISDN-driver Rev 1.11.6.7 [ 22.097508] isdnloop: (loop0) virtual card added [ 22.174400] Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: 83244972 [ 22.174400] [ 22.436157] Pid: 1, comm: swapper Not tainted 3.5.0-bisect-00018-gfa8bbb1-dirty #129 [ 22.624071] Call Trace: [ 22.720558] [832448c3] ? CallcNew+0x56/0x56 [ 22.815248] [8222b623] panic+0x110/0x329 [ 22.914330] [83244972] ? isdnloop_init+0xaf/0xb1 [ 23.014800] [832448c3] ? CallcNew+0x56/0x56 [ 23.090763] [8108e24b] __stack_chk_fail+0x2b/0x30 [ 23.185748] [83244972] isdnloop_init+0xaf/0xb1 Signed-off-by: Fengguang Wu fengguang...@intel.com --- drivers/isdn/isdnloop/isdnloop.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) --- linux.orig/drivers/isdn/isdnloop/isdnloop.c 2012-08-03 15:24:49.047544323 +0800 +++ linux/drivers/isdn/isdnloop/isdnloop.c2012-08-03 15:27:39.503548375 +0800 @@ -16,7 +16,6 @@ #include linux/sched.h #include isdnloop.h -static char *revision = $Revision: 1.11.6.7 $; static char *isdnloop_id = loop0; MODULE_DESCRIPTION(ISDN4Linux: Pseudo Driver that simulates an ISDN card); @@ -1494,16 +1493,7 @@ isdnloop_addcard(char *id1) static int __init isdnloop_init(void) { - char *p; - char rev[10]; - - if ((p = strchr(revision, ':'))) { - strcpy(rev, p + 1); - p = strchr(rev, '$'); - *p = 0; - } else - strcpy(rev, ??? ); - printk(KERN_NOTICE isdnloop-ISDN-driver Rev%s\n, rev); + printk(KERN_NOTICE isdnloop-ISDN-driver Rev 1.11.6.7\n); if (isdnloop_id) return (isdnloop_addcard(isdnloop_id)); You could remove the revision completely, even from the printk. Maybe use pr_notice(isdnloop-ISDN driver loaded\n); Best Regards Karsten -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Plans for mISDN? Was: [PATCH 00/14] [ISDN] ...
Hi, sorry that I step in so late, procmail sorted this thread in the wrong box. Normally I reserved the complete last week for working on mISDN to get it ready to submit it to -mm, but reality did hit me and I had to do some other importent stuff :-( On Thu, Feb 21, 2008 at 11:33:04AM +0100, Simon Richter wrote: > Hi, > > Tilman Schmidt wrote: > > > mISDN has two problems, which are of course interrelated: > > mISDN has one problem that is even bigger than these: the kernel oopses > if modules aren't loaded in the right order. misdn-init works around > that, but if it doesn't work for some reason (and I can think of > multiple here), the user is left with a kernel that oopses during > hardware discovery and never gets to a stage where this can be > rectified, as almost all distributions now have hardware discovery > before the first opportunity to get a shell. At least these were my > experiences the last time I tried it on my test box. > > This is the reason I've kept mISDN out of the last two Debian stable > releases, despite users' requests. > > When a hardware driver module is loaded, it should only do basic > hardware initialisation; it is certainly not necessary to set up the > entire stack (or even decide on a protocol, which currently needs to be > handed in via module parameter -- before userland code is there that > wants to talk to the hardware, there is no reason to have the hardware > active). > These design issues are fixed in the new mISDN socket branch. The old mISDN design was too complicated because it allow access to every layer and build the ISDN stack dynamically, both feature were never needed in practice and contain many race conditions. The new design only has one core module and hardware specific modules with a very simple interface. The interface to the userspace are sockets (one per channel). -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Plans for mISDN? Was: [PATCH 00/14] [ISDN] ...
Hi, sorry that I step in so late, procmail sorted this thread in the wrong box. Normally I reserved the complete last week for working on mISDN to get it ready to submit it to -mm, but reality did hit me and I had to do some other importent stuff :-( On Thu, Feb 21, 2008 at 11:33:04AM +0100, Simon Richter wrote: Hi, Tilman Schmidt wrote: mISDN has two problems, which are of course interrelated: mISDN has one problem that is even bigger than these: the kernel oopses if modules aren't loaded in the right order. misdn-init works around that, but if it doesn't work for some reason (and I can think of multiple here), the user is left with a kernel that oopses during hardware discovery and never gets to a stage where this can be rectified, as almost all distributions now have hardware discovery before the first opportunity to get a shell. At least these were my experiences the last time I tried it on my test box. This is the reason I've kept mISDN out of the last two Debian stable releases, despite users' requests. When a hardware driver module is loaded, it should only do basic hardware initialisation; it is certainly not necessary to set up the entire stack (or even decide on a protocol, which currently needs to be handed in via module parameter -- before userland code is there that wants to talk to the hardware, there is no reason to have the hardware active). These design issues are fixed in the new mISDN socket branch. The old mISDN design was too complicated because it allow access to every layer and build the ISDN stack dynamically, both feature were never needed in practice and contain many race conditions. The new design only has one core module and hardware specific modules with a very simple interface. The interface to the userspace are sockets (one per channel). -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/5] isdn: fix section mismatch warnings in isdn
On Fri, Feb 01, 2008 at 02:38:38PM +0100, Sam Ravnborg wrote: > drivers/isdn resulted in 34 section mismatch warnings - so > I decided to give them a try. > This resulted in 5 simple patches. > > I know Jeff Garzik has some ISDN clean-up patches pending > but rather than waiting forever to have them acked I deciced > to fix the warnings in the current kernel. > > This for no other reason than to get the noise level down. > > Andrew - I expect you to pick them up in -mm and forward to Linus. > Yes these fixes should go in, Acked. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 0/5] isdn: fix section mismatch warnings in isdn
On Fri, Feb 01, 2008 at 02:38:38PM +0100, Sam Ravnborg wrote: drivers/isdn resulted in 34 section mismatch warnings - so I decided to give them a try. This resulted in 5 simple patches. I know Jeff Garzik has some ISDN clean-up patches pending but rather than waiting forever to have them acked I deciced to fix the warnings in the current kernel. This for no other reason than to get the noise level down. Andrew - I expect you to pick them up in -mm and forward to Linus. Yes these fixes should go in, Acked. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 09/26] mount options: fix capifs
On Thu, Jan 24, 2008 at 08:33:50PM +0100, Miklos Szeredi wrote: > From: Miklos Szeredi <[EMAIL PROTECTED]> > > Add a .show_options super operation to capifs. > > Use generic_show_options() and save the complete option string in > capifs_remount(). > > Signed-off-by: Miklos Szeredi <[EMAIL PROTECTED]> Acked-by: Karsten Keil <[EMAIL PROTECTED]> > --- > > Index: linux/drivers/isdn/capi/capifs.c > === > --- linux.orig/drivers/isdn/capi/capifs.c 2007-10-09 22:31:38.0 > +0200 > +++ linux/drivers/isdn/capi/capifs.c 2008-01-24 11:37:42.0 +0100 > @@ -52,6 +52,7 @@ static int capifs_remount(struct super_b > gid_t gid = 0; > umode_t mode = 0600; > char *this_char; > + char *new_opt = kstrdup(data, GFP_KERNEL); > > this_char = NULL; > while ((this_char = strsep(, ",")) != NULL) { > @@ -72,11 +73,16 @@ static int capifs_remount(struct super_b > return -EINVAL; > } > } > + > + kfree(s->s_options); > + s->s_options = new_opt; > + > config.setuid = setuid; > config.setgid = setgid; > config.uid = uid; > config.gid = gid; > config.mode= mode; > + > return 0; > } > > @@ -84,6 +90,7 @@ static struct super_operations capifs_so > { > .statfs = simple_statfs, > .remount_fs = capifs_remount, > + .show_options = generic_show_options, > }; > > > > -- -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 09/26] mount options: fix capifs
On Thu, Jan 24, 2008 at 08:33:50PM +0100, Miklos Szeredi wrote: From: Miklos Szeredi [EMAIL PROTECTED] Add a .show_options super operation to capifs. Use generic_show_options() and save the complete option string in capifs_remount(). Signed-off-by: Miklos Szeredi [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] --- Index: linux/drivers/isdn/capi/capifs.c === --- linux.orig/drivers/isdn/capi/capifs.c 2007-10-09 22:31:38.0 +0200 +++ linux/drivers/isdn/capi/capifs.c 2008-01-24 11:37:42.0 +0100 @@ -52,6 +52,7 @@ static int capifs_remount(struct super_b gid_t gid = 0; umode_t mode = 0600; char *this_char; + char *new_opt = kstrdup(data, GFP_KERNEL); this_char = NULL; while ((this_char = strsep(data, ,)) != NULL) { @@ -72,11 +73,16 @@ static int capifs_remount(struct super_b return -EINVAL; } } + + kfree(s-s_options); + s-s_options = new_opt; + config.setuid = setuid; config.setgid = setgid; config.uid = uid; config.gid = gid; config.mode= mode; + return 0; } @@ -84,6 +90,7 @@ static struct super_operations capifs_so { .statfs = simple_statfs, .remount_fs = capifs_remount, + .show_options = generic_show_options, }; -- -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [ISDN] sc: Really, really fix warning
On Wed, Nov 14, 2007 at 03:46:20PM +0100, Frank Lichtenheld wrote: > CC [M] drivers/isdn/sc/shmem.o > drivers/isdn/sc/shmem.c: In function ‘memcpy_toshmem’: > drivers/isdn/sc/shmem.c:53: warning: passing argument 1 of ‘memcpy_toio’ > makes pointer from integer without a cast > > 9317d4313e0cd51b2256ea9a9316f2d8561e37a8 claimed to fix it, but > it didn't. > > CC: Jeff Garzik <[EMAIL PROTECTED]> Acked-by:Karsten Keil > Signed-off-by: Frank Lichtenheld <[EMAIL PROTECTED]> > --- > drivers/isdn/sc/shmem.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c > index e0331e0..06a5554 100644 > --- a/drivers/isdn/sc/shmem.c > +++ b/drivers/isdn/sc/shmem.c > @@ -50,7 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, > size_t n) > > outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | > 0x80, > sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]); > - memcpy_toio(sc_adapter[card]->rambase + dest_rem, src, n); > + memcpy_toio((void*)(sc_adapter[card]->rambase + dest_rem), src, n); > spin_unlock_irqrestore(_adapter[card]->lock, flags); > pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename, > ((sc_adapter[card]->shmem_magic + ch * > SRAM_PAGESIZE)>>14)|0x80); > -- > 1.5.3.4 -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] [ISDN] sc: Really, really fix warning
On Wed, Nov 14, 2007 at 03:46:20PM +0100, Frank Lichtenheld wrote: CC [M] drivers/isdn/sc/shmem.o drivers/isdn/sc/shmem.c: In function ‘memcpy_toshmem’: drivers/isdn/sc/shmem.c:53: warning: passing argument 1 of ‘memcpy_toio’ makes pointer from integer without a cast 9317d4313e0cd51b2256ea9a9316f2d8561e37a8 claimed to fix it, but it didn't. CC: Jeff Garzik [EMAIL PROTECTED] Acked-by:Karsten Keil kkeilæsuse.de Signed-off-by: Frank Lichtenheld [EMAIL PROTECTED] --- drivers/isdn/sc/shmem.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c index e0331e0..06a5554 100644 --- a/drivers/isdn/sc/shmem.c +++ b/drivers/isdn/sc/shmem.c @@ -50,7 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n) outb(((sc_adapter[card]-shmem_magic + ch * SRAM_PAGESIZE) 14) | 0x80, sc_adapter[card]-ioport[sc_adapter[card]-shmem_pgport]); - memcpy_toio(sc_adapter[card]-rambase + dest_rem, src, n); + memcpy_toio((void*)(sc_adapter[card]-rambase + dest_rem), src, n); spin_unlock_irqrestore(sc_adapter[card]-lock, flags); pr_debug(%s: set page to %#x\n,sc_adapter[card]-devicename, ((sc_adapter[card]-shmem_magic + ch * SRAM_PAGESIZE)14)|0x80); -- 1.5.3.4 -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] ISDN/capidrv: address two longstanding warnings
* change #warning to a code comment * add comment and special ifdef'd 64-bit code for a situation where we must store a pointer into a CAPI field 'Data', which is fixed by the interface at 32 bits. Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> Acked-by: Karsten Keil <[EMAIL PROTECTED]> --- drivers/isdn/capi/capidrv.c | 25 +++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index 476012b..48c1775 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c @@ -1843,6 +1843,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) int msglen; u16 errcode; u16 datahandle; + u32 data; if (!card) { printk(KERN_ERR "capidrv: if_sendbuf called with invalid driverId %d!\n", @@ -1860,9 +1861,26 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) return 0; } datahandle = nccip->datahandle; + + /* +* Here we copy pointer skb->data into the 32-bit 'Data' field. +* The 'Data' field is not used in practice in linux kernel +* (neither in 32 or 64 bit), but should have some value, +* since a CAPI message trace will display it. +* +* The correct value in the 32 bit case is the address of the +* data, in 64 bit it makes no sense, we use 0 there. +*/ + +#ifdef CONFIG_64BIT + data = 0; +#else + data = (unsigned long) skb->data; +#endif + capi_fill_DATA_B3_REQ(, global.ap.applid, card->msgid++, nccip->ncci, /* adr */ - (u32) skb->data, /* Data */ + data, /* Data */ skb->len, /* DataLength */ datahandle, /* DataHandle */ 0 /* Flags */ @@ -2123,7 +2141,10 @@ static int capidrv_delcontr(u16 contr) printk(KERN_ERR "capidrv: delcontr: no contr %u\n", contr); return -1; } - #warning FIXME: maybe a race condition the card should be removed here from global list /kkeil + + /* FIXME: maybe a race condition the card should be removed +* here from global list /kkeil +*/ spin_unlock_irqrestore(_lock, flags); del_timer(>listentimer); -- 1.5.2.4 -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v2] ISDN/capidrv: address two longstanding warnings
* change #warning to a code comment * add comment and special ifdef'd 64-bit code for a situation where we must store a pointer into a CAPI field 'Data', which is fixed by the interface at 32 bits. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/capi/capidrv.c | 25 +++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index 476012b..48c1775 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c @@ -1843,6 +1843,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) int msglen; u16 errcode; u16 datahandle; + u32 data; if (!card) { printk(KERN_ERR capidrv: if_sendbuf called with invalid driverId %d!\n, @@ -1860,9 +1861,26 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) return 0; } datahandle = nccip-datahandle; + + /* +* Here we copy pointer skb-data into the 32-bit 'Data' field. +* The 'Data' field is not used in practice in linux kernel +* (neither in 32 or 64 bit), but should have some value, +* since a CAPI message trace will display it. +* +* The correct value in the 32 bit case is the address of the +* data, in 64 bit it makes no sense, we use 0 there. +*/ + +#ifdef CONFIG_64BIT + data = 0; +#else + data = (unsigned long) skb-data; +#endif + capi_fill_DATA_B3_REQ(sendcmsg, global.ap.applid, card-msgid++, nccip-ncci, /* adr */ - (u32) skb-data, /* Data */ + data, /* Data */ skb-len, /* DataLength */ datahandle, /* DataHandle */ 0 /* Flags */ @@ -2123,7 +2141,10 @@ static int capidrv_delcontr(u16 contr) printk(KERN_ERR capidrv: delcontr: no contr %u\n, contr); return -1; } - #warning FIXME: maybe a race condition the card should be removed here from global list /kkeil + + /* FIXME: maybe a race condition the card should be removed +* here from global list /kkeil +*/ spin_unlock_irqrestore(global_lock, flags); del_timer(card-listentimer); -- 1.5.2.4 -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Remove #warnings for longstanding conditions.
On Thu, Oct 25, 2007 at 04:06:15AM -0400, Jeff Garzik wrote: > These two warnings... > > drivers/isdn/capi/capidrv.c:2126:3: warning: #warning FIXME: maybe a > race condition the card should be removed here from global list /kkeil > > drivers/scsi/advansys.c:71:2: warning: #warning this driver is still > not properly converted to the DMA API > > ...represent conditions that have existed for years, and are duly noted > in FIXMEs. There does not seem to be much need to warn on every kernel > build for a driver bug or handicap that has existed for years. > > Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> > --- > drivers/isdn/capi/capidrv.c |3 ++- Acked. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ISDN/capidrv: fix casting warning
On Thu, Oct 25, 2007 at 04:06:16AM -0400, Jeff Garzik wrote: > drivers/isdn/capi/capidrv.c: In function 'if_sendbuf': > drivers/isdn/capi/capidrv.c:1865: warning: cast from pointer to integer > of different size > > We are passing a kernel pointer, skb->data, but the interface itself is > limited to 32 bits. A future changeset may want to mark this code > 32-bit only, if it turns out cmsg->Data value truncation on 64-bit > platforms is problematic in practice. > I think I should really add somewhere a comment for this issue. This field is not used in practice in linux kernel (neither in 32 or 64 bit), but should have some value, since a CAPI message trace will display it. The correct value in the 32 bit case is the address of the data, in 64 bit it makes no sense, maybe we should use 0 here. > Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> > --- > drivers/isdn/capi/capidrv.c |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c > index 44f954d..a4814e1 100644 > --- a/drivers/isdn/capi/capidrv.c > +++ b/drivers/isdn/capi/capidrv.c > @@ -1862,7 +1862,7 @@ static int if_sendbuf(int id, int channel, int doack, > struct sk_buff *skb) > datahandle = nccip->datahandle; > capi_fill_DATA_B3_REQ(, global.ap.applid, card->msgid++, > nccip->ncci, /* adr */ > - (u32) skb->data, /* Data */ > + (unsigned long) skb->data, /* Data */ > skb->len, /* DataLength */ > datahandle, /* DataHandle */ > 0 /* Flags */ > -- > 1.5.2.4 -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ISDN/capidrv: fix casting warning
On Thu, Oct 25, 2007 at 04:06:16AM -0400, Jeff Garzik wrote: drivers/isdn/capi/capidrv.c: In function 'if_sendbuf': drivers/isdn/capi/capidrv.c:1865: warning: cast from pointer to integer of different size We are passing a kernel pointer, skb-data, but the interface itself is limited to 32 bits. A future changeset may want to mark this code 32-bit only, if it turns out cmsg-Data value truncation on 64-bit platforms is problematic in practice. I think I should really add somewhere a comment for this issue. This field is not used in practice in linux kernel (neither in 32 or 64 bit), but should have some value, since a CAPI message trace will display it. The correct value in the 32 bit case is the address of the data, in 64 bit it makes no sense, maybe we should use 0 here. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/isdn/capi/capidrv.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index 44f954d..a4814e1 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c @@ -1862,7 +1862,7 @@ static int if_sendbuf(int id, int channel, int doack, struct sk_buff *skb) datahandle = nccip-datahandle; capi_fill_DATA_B3_REQ(sendcmsg, global.ap.applid, card-msgid++, nccip-ncci, /* adr */ - (u32) skb-data, /* Data */ + (unsigned long) skb-data, /* Data */ skb-len, /* DataLength */ datahandle, /* DataHandle */ 0 /* Flags */ -- 1.5.2.4 -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Remove #warnings for longstanding conditions.
On Thu, Oct 25, 2007 at 04:06:15AM -0400, Jeff Garzik wrote: These two warnings... drivers/isdn/capi/capidrv.c:2126:3: warning: #warning FIXME: maybe a race condition the card should be removed here from global list /kkeil drivers/scsi/advansys.c:71:2: warning: #warning this driver is still not properly converted to the DMA API ...represent conditions that have existed for years, and are duly noted in FIXMEs. There does not seem to be much need to warn on every kernel build for a driver bug or handicap that has existed for years. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/isdn/capi/capidrv.c |3 ++- Acked. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 5/12] ISDN/sc: fix longstanding warning
On Tue, Oct 23, 2007 at 06:36:39PM -0400, Jeff Garzik wrote: > drivers/isdn/sc/shmem.c: In function ‘memcpy_toshmem’: > drivers/isdn/sc/shmem.c:54: warning: passing argument 1 of ‘memcpy_toio’ > makes pointer from integer without a cast > > Also, remove some unneeded braces, and add some useful whitespace. > > Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> Acked. > --- > > diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c > index 034d41a..e0331e0 100644 > --- a/drivers/isdn/sc/shmem.c > +++ b/drivers/isdn/sc/shmem.c > @@ -28,15 +28,15 @@ void memcpy_toshmem(int card, void *dest, const void > *src, size_t n) > { > unsigned long flags; > unsigned char ch; > + unsigned long dest_rem = ((unsigned long) dest) % 0x4000; > > - if(!IS_VALID_CARD(card)) { > + if (!IS_VALID_CARD(card)) { > pr_debug("Invalid param: %d is not a valid card id\n", card); > return; > } > > - if(n > SRAM_PAGESIZE) { > + if (n > SRAM_PAGESIZE) > return; > - } > > /* >* determine the page to load from the address > @@ -50,8 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, > size_t n) > > outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | > 0x80, > sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]); > - memcpy_toio(sc_adapter[card]->rambase + > - ((unsigned long) dest % 0x4000), src, n); > + memcpy_toio(sc_adapter[card]->rambase + dest_rem, src, n); > spin_unlock_irqrestore(_adapter[card]->lock, flags); > pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename, > ((sc_adapter[card]->shmem_magic + ch * > SRAM_PAGESIZE)>>14)|0x80); > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 5/12] ISDN/sc: fix longstanding warning
On Tue, Oct 23, 2007 at 06:36:39PM -0400, Jeff Garzik wrote: drivers/isdn/sc/shmem.c: In function ‘memcpy_toshmem’: drivers/isdn/sc/shmem.c:54: warning: passing argument 1 of ‘memcpy_toio’ makes pointer from integer without a cast Also, remove some unneeded braces, and add some useful whitespace. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] Acked. --- diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c index 034d41a..e0331e0 100644 --- a/drivers/isdn/sc/shmem.c +++ b/drivers/isdn/sc/shmem.c @@ -28,15 +28,15 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n) { unsigned long flags; unsigned char ch; + unsigned long dest_rem = ((unsigned long) dest) % 0x4000; - if(!IS_VALID_CARD(card)) { + if (!IS_VALID_CARD(card)) { pr_debug(Invalid param: %d is not a valid card id\n, card); return; } - if(n SRAM_PAGESIZE) { + if (n SRAM_PAGESIZE) return; - } /* * determine the page to load from the address @@ -50,8 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n) outb(((sc_adapter[card]-shmem_magic + ch * SRAM_PAGESIZE) 14) | 0x80, sc_adapter[card]-ioport[sc_adapter[card]-shmem_pgport]); - memcpy_toio(sc_adapter[card]-rambase + - ((unsigned long) dest % 0x4000), src, n); + memcpy_toio(sc_adapter[card]-rambase + dest_rem, src, n); spin_unlock_irqrestore(sc_adapter[card]-lock, flags); pr_debug(%s: set page to %#x\n,sc_adapter[card]-devicename, ((sc_adapter[card]-shmem_magic + ch * SRAM_PAGESIZE)14)|0x80); - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 12/17] isdn/sc: irq handler clean
commit ebf0fb18d5c19bb0201912850d14a9fda292ee0e Author: Jeff Garzik <[EMAIL PROTECTED]> Date: Fri Oct 19 19:31:27 2007 -0400 isdn/sc: irq handler clean * pass card number to irq handler * use card number in irq handler to avoid looping through each adapter Acked-by: Karsten Keil <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> drivers/isdn/sc/init.c |3 ++- drivers/isdn/sc/interrupt.c | 17 ++--- 2 files changed, 4 insertions(+), 16 deletions(-) ebf0fb18d5c19bb0201912850d14a9fda292ee0e diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c index d09c854..dd0acd0 100644 --- a/drivers/isdn/sc/init.c +++ b/drivers/isdn/sc/init.c @@ -334,7 +334,8 @@ static int __init sc_init(void) */ sc_adapter[cinst]->interrupt = irq[b]; if (request_irq(sc_adapter[cinst]->interrupt, interrupt_handler, - IRQF_DISABLED, interface->id, NULL)) + IRQF_DISABLED, interface->id, + (void *)(unsigned long) cinst)) { kfree(sc_adapter[cinst]->channel); indicate_status(cinst, ISDN_STAT_UNLOAD, 0, NULL); /* Fix me */ diff --git a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c index bef7963..485be8b 100644 --- a/drivers/isdn/sc/interrupt.c +++ b/drivers/isdn/sc/interrupt.c @@ -21,28 +21,15 @@ #include "card.h" #include -static int get_card_from_irq(int irq) -{ - int i; - - for(i = 0 ; i < cinst ; i++) { - if(sc_adapter[i]->interrupt == irq) - return i; - } - return -1; -} - /* * */ -irqreturn_t interrupt_handler(int interrupt, void *cardptr) +irqreturn_t interrupt_handler(int dummy, void *card_inst) { RspMessage rcvmsg; int channel; - int card; - - card = get_card_from_irq(interrupt); + int card = (int)(unsigned long) card_inst; if(!IS_VALID_CARD(card)) { pr_debug("Invalid param: %d is not a valid card id\n", card); -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 11/17] isdn/act2000: fix major bug. clean irq handler
commit e295b1287f0f559f4795ae75acb793b480594a04 Author: Jeff Garzik <[EMAIL PROTECTED]> Date: Fri Oct 19 19:30:28 2007 -0400 isdn/act2000: fix major bug. clean irq handler. * invert sense of request_irq() test. otherwise we will always fail, when IRQ is available. * no need to use 'irq' function arg, its stored in a data struct already Acked-by: Karsten Keil <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> drivers/isdn/act2000/act2000_isa.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) e295b1287f0f559f4795ae75acb793b480594a04 diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 819ea85..1bd8960 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c @@ -61,7 +61,7 @@ act2000_isa_detect(unsigned short portbase) } static irqreturn_t -act2000_isa_interrupt(int irq, void *dev_id) +act2000_isa_interrupt(int dummy, void *dev_id) { act2000_card *card = dev_id; u_char istatus; @@ -80,7 +80,7 @@ act2000_isa_interrupt(int irq, void *dev_id) printk(KERN_WARNING "act2000: errIRQ\n"); } if (istatus) - printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", irq, istatus); + printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, istatus); return IRQ_HANDLED; } @@ -131,6 +131,8 @@ act2000_isa_enable_irq(act2000_card * card) int act2000_isa_config_irq(act2000_card * card, short irq) { + int old_irq; + if (card->flags & ACT2000_FLAGS_IVALID) { free_irq(card->irq, card); } @@ -139,8 +141,10 @@ act2000_isa_config_irq(act2000_card * card, short irq) if (!irq) return 0; - if (!request_irq(irq, _isa_interrupt, 0, card->regname, card)) { - card->irq = irq; + old_irq = card->irq; + card->irq = irq; + if (request_irq(irq, _isa_interrupt, 0, card->regname, card)) { + card->irq = old_irq; card->flags |= ACT2000_FLAGS_IVALID; printk(KERN_WARNING "act2000: Could not request irq %d\n",irq); -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 11/17] isdn/act2000: fix major bug. clean irq handler
commit e295b1287f0f559f4795ae75acb793b480594a04 Author: Jeff Garzik [EMAIL PROTECTED] Date: Fri Oct 19 19:30:28 2007 -0400 isdn/act2000: fix major bug. clean irq handler. * invert sense of request_irq() test. otherwise we will always fail, when IRQ is available. * no need to use 'irq' function arg, its stored in a data struct already Acked-by: Karsten Keil [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] drivers/isdn/act2000/act2000_isa.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) e295b1287f0f559f4795ae75acb793b480594a04 diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 819ea85..1bd8960 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c @@ -61,7 +61,7 @@ act2000_isa_detect(unsigned short portbase) } static irqreturn_t -act2000_isa_interrupt(int irq, void *dev_id) +act2000_isa_interrupt(int dummy, void *dev_id) { act2000_card *card = dev_id; u_char istatus; @@ -80,7 +80,7 @@ act2000_isa_interrupt(int irq, void *dev_id) printk(KERN_WARNING act2000: errIRQ\n); } if (istatus) - printk(KERN_DEBUG act2000: ?IRQ %d %02x\n, irq, istatus); + printk(KERN_DEBUG act2000: ?IRQ %d %02x\n, card-irq, istatus); return IRQ_HANDLED; } @@ -131,6 +131,8 @@ act2000_isa_enable_irq(act2000_card * card) int act2000_isa_config_irq(act2000_card * card, short irq) { + int old_irq; + if (card-flags ACT2000_FLAGS_IVALID) { free_irq(card-irq, card); } @@ -139,8 +141,10 @@ act2000_isa_config_irq(act2000_card * card, short irq) if (!irq) return 0; - if (!request_irq(irq, act2000_isa_interrupt, 0, card-regname, card)) { - card-irq = irq; + old_irq = card-irq; + card-irq = irq; + if (request_irq(irq, act2000_isa_interrupt, 0, card-regname, card)) { + card-irq = old_irq; card-flags |= ACT2000_FLAGS_IVALID; printk(KERN_WARNING act2000: Could not request irq %d\n,irq); -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 12/17] isdn/sc: irq handler clean
commit ebf0fb18d5c19bb0201912850d14a9fda292ee0e Author: Jeff Garzik [EMAIL PROTECTED] Date: Fri Oct 19 19:31:27 2007 -0400 isdn/sc: irq handler clean * pass card number to irq handler * use card number in irq handler to avoid looping through each adapter Acked-by: Karsten Keil [EMAIL PROTECTED] Signed-off-by: Jeff Garzik [EMAIL PROTECTED] drivers/isdn/sc/init.c |3 ++- drivers/isdn/sc/interrupt.c | 17 ++--- 2 files changed, 4 insertions(+), 16 deletions(-) ebf0fb18d5c19bb0201912850d14a9fda292ee0e diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c index d09c854..dd0acd0 100644 --- a/drivers/isdn/sc/init.c +++ b/drivers/isdn/sc/init.c @@ -334,7 +334,8 @@ static int __init sc_init(void) */ sc_adapter[cinst]-interrupt = irq[b]; if (request_irq(sc_adapter[cinst]-interrupt, interrupt_handler, - IRQF_DISABLED, interface-id, NULL)) + IRQF_DISABLED, interface-id, + (void *)(unsigned long) cinst)) { kfree(sc_adapter[cinst]-channel); indicate_status(cinst, ISDN_STAT_UNLOAD, 0, NULL); /* Fix me */ diff --git a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c index bef7963..485be8b 100644 --- a/drivers/isdn/sc/interrupt.c +++ b/drivers/isdn/sc/interrupt.c @@ -21,28 +21,15 @@ #include card.h #include linux/interrupt.h -static int get_card_from_irq(int irq) -{ - int i; - - for(i = 0 ; i cinst ; i++) { - if(sc_adapter[i]-interrupt == irq) - return i; - } - return -1; -} - /* * */ -irqreturn_t interrupt_handler(int interrupt, void *cardptr) +irqreturn_t interrupt_handler(int dummy, void *card_inst) { RspMessage rcvmsg; int channel; - int card; - - card = get_card_from_irq(interrupt); + int card = (int)(unsigned long) card_inst; if(!IS_VALID_CARD(card)) { pr_debug(Invalid param: %d is not a valid card id\n, card); -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN]Fix random hard freeze with AVM cards using b1dma
This fix the hard freeze debuged for AVM C4 cards using the b1dma interface. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> --- drivers/isdn/hardware/avm/b1dma.c | 28 +++- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c index 428872b..a40997b 100644 --- a/drivers/isdn/hardware/avm/b1dma.c +++ b/drivers/isdn/hardware/avm/b1dma.c @@ -486,11 +486,13 @@ static void b1dma_handle_rx(avmcard *card) card->name); } else { memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen); - if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF) + if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF) { + spin_lock(>lock); capilib_data_b3_conf(>ncci_head, ApplId, -CAPIMSG_NCCI(skb->data), -CAPIMSG_MSGID(skb->data)); - + CAPIMSG_NCCI(skb->data), + CAPIMSG_MSGID(skb->data)); + spin_unlock(>lock); + } capi_ctr_handle_message(ctrl, ApplId, skb); } break; @@ -500,9 +502,9 @@ static void b1dma_handle_rx(avmcard *card) ApplId = _get_word(); NCCI = _get_word(); WindowSize = _get_word(); - + spin_lock(>lock); capilib_new_ncci(>ncci_head, ApplId, NCCI, WindowSize); - + spin_unlock(>lock); break; case RECEIVE_FREE_NCCI: @@ -510,9 +512,11 @@ static void b1dma_handle_rx(avmcard *card) ApplId = _get_word(); NCCI = _get_word(); - if (NCCI != 0x) + if (NCCI != 0x) { + spin_lock(>lock); capilib_free_ncci(>ncci_head, ApplId, NCCI); - + spin_unlock(>lock); + } break; case RECEIVE_START: @@ -751,10 +755,10 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl) spin_lock_irqsave(>lock, flags); b1dma_reset(card); - spin_unlock_irqrestore(>lock, flags); memset(cinfo->version, 0, sizeof(cinfo->version)); capilib_release(>ncci_head); + spin_unlock_irqrestore(>lock, flags); capi_ctr_reseted(ctrl); } @@ -803,8 +807,11 @@ void b1dma_release_appl(struct capi_ctr *ctrl, u16 appl) avmcard *card = cinfo->card; struct sk_buff *skb; void *p; + unsigned long flags; + spin_lock_irqsave(>lock, flags); capilib_release_appl(>ncci_head, appl); + spin_unlock_irqrestore(>lock, flags); skb = alloc_skb(7, GFP_ATOMIC); if (!skb) { @@ -832,10 +839,13 @@ u16 b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u16 retval = CAPI_NOERROR; if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) { + unsigned long flags; + spin_lock_irqsave(>lock, flags); retval = capilib_data_b3_req(>ncci_head, CAPIMSG_APPID(skb->data), CAPIMSG_NCCI(skb->data), CAPIMSG_MSGID(skb->data)); + spin_unlock_irqrestore(>lock, flags); } if (retval == CAPI_NOERROR) b1dma_queue_tx(card, skb); -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN]Fix random hard freeze with AVM T1 cards
This fix the hard freeze debuged for AVM C4 cards for the AVM T1 cards. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> --- drivers/isdn/hardware/avm/t1isa.c | 28 1 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c index c925020..6130724 100644 --- a/drivers/isdn/hardware/avm/t1isa.c +++ b/drivers/isdn/hardware/avm/t1isa.c @@ -180,8 +180,8 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) ApplId = (unsigned) b1_get_word(card->port); MsgLen = t1_get_slice(card->port, card->msgbuf); - spin_unlock_irqrestore(>lock, flags); if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) { + spin_unlock_irqrestore(>lock, flags); printk(KERN_ERR "%s: incoming packet dropped\n", card->name); } else { @@ -190,7 +190,7 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) capilib_data_b3_conf(>ncci_head, ApplId, CAPIMSG_NCCI(skb->data), CAPIMSG_MSGID(skb->data)); - + spin_unlock_irqrestore(>lock, flags); capi_ctr_handle_message(ctrl, ApplId, skb); } break; @@ -200,21 +200,17 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) ApplId = b1_get_word(card->port); NCCI = b1_get_word(card->port); WindowSize = b1_get_word(card->port); - spin_unlock_irqrestore(>lock, flags); - capilib_new_ncci(>ncci_head, ApplId, NCCI, WindowSize); - + spin_unlock_irqrestore(>lock, flags); break; case RECEIVE_FREE_NCCI: ApplId = b1_get_word(card->port); NCCI = b1_get_word(card->port); - spin_unlock_irqrestore(>lock, flags); - if (NCCI != 0x) capilib_free_ncci(>ncci_head, ApplId, NCCI); - + spin_unlock_irqrestore(>lock, flags); break; case RECEIVE_START: @@ -333,13 +329,16 @@ static void t1isa_reset_ctr(struct capi_ctr *ctrl) avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmcard *card = cinfo->card; unsigned int port = card->port; + unsigned long flags; t1_disable_irq(port); b1_reset(port); b1_reset(port); memset(cinfo->version, 0, sizeof(cinfo->version)); + spin_lock_irqsave(>lock, flags); capilib_release(>ncci_head); + spin_unlock_irqrestore(>lock, flags); capi_ctr_reseted(ctrl); } @@ -466,29 +465,26 @@ static u16 t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data); u16 dlen, retval; + spin_lock_irqsave(>lock, flags); if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { retval = capilib_data_b3_req(>ncci_head, CAPIMSG_APPID(skb->data), CAPIMSG_NCCI(skb->data), CAPIMSG_MSGID(skb->data)); - if (retval != CAPI_NOERROR) + if (retval != CAPI_NOERROR) { + spin_unlock_irqrestore(>lock, flags); return retval; - + } dlen = CAPIMSG_DATALEN(skb->data); - spin_lock_irqsave(>lock, flags); b1_put_byte(port, SEND_DATA_B3_REQ); t1_put_slice(port, skb->data, len); t1_put_slice(port, skb->data + len, dlen); - spin_unlock_irqrestore(>lock, flags); } else { - - spin_lock_irqsave(>lock, flags); b1_put_byte(port, SEND_MESSAGE); t1_put_slice(port, skb->data, len); - spin_unlock_irqrestore(>lock, flags); } - + spin_unlock_irqrestore(>lock, flags); dev_kfree_skb_any(skb); return CAPI_NOERROR; } -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN]Fix random hard freeze with AVM c4 card part 2
One call was missing in the previous patch. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> --- drivers/isdn/hardware/avm/c4.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index 4c6ef91..d69c05e 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -678,7 +678,9 @@ static irqreturn_t c4_handle_interrupt(avmcard *card) for (i=0; i < card->nr_controllers; i++) { avmctrl_info *cinfo = >ctrlinfo[i]; memset(cinfo->version, 0, sizeof(cinfo->version)); + spin_lock_irqsave(>lock, flags); capilib_release(>ncci_head); + spin_unlock_irqrestore(>lock, flags); capi_ctr_reseted(>capi_ctrl); } card->nlogcontr = 0; -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN]Fix random hard freeze with AVM c4 card part 2
One call was missing in the previous patch. Signed-off-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/hardware/avm/c4.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index 4c6ef91..d69c05e 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -678,7 +678,9 @@ static irqreturn_t c4_handle_interrupt(avmcard *card) for (i=0; i card-nr_controllers; i++) { avmctrl_info *cinfo = card-ctrlinfo[i]; memset(cinfo-version, 0, sizeof(cinfo-version)); + spin_lock_irqsave(card-lock, flags); capilib_release(cinfo-ncci_head); + spin_unlock_irqrestore(card-lock, flags); capi_ctr_reseted(cinfo-capi_ctrl); } card-nlogcontr = 0; -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN]Fix random hard freeze with AVM cards using b1dma
This fix the hard freeze debuged for AVM C4 cards using the b1dma interface. Signed-off-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/hardware/avm/b1dma.c | 28 +++- 1 files changed, 19 insertions(+), 9 deletions(-) diff --git a/drivers/isdn/hardware/avm/b1dma.c b/drivers/isdn/hardware/avm/b1dma.c index 428872b..a40997b 100644 --- a/drivers/isdn/hardware/avm/b1dma.c +++ b/drivers/isdn/hardware/avm/b1dma.c @@ -486,11 +486,13 @@ static void b1dma_handle_rx(avmcard *card) card-name); } else { memcpy(skb_put(skb, MsgLen), card-msgbuf, MsgLen); - if (CAPIMSG_CMD(skb-data) == CAPI_DATA_B3_CONF) + if (CAPIMSG_CMD(skb-data) == CAPI_DATA_B3_CONF) { + spin_lock(card-lock); capilib_data_b3_conf(cinfo-ncci_head, ApplId, -CAPIMSG_NCCI(skb-data), -CAPIMSG_MSGID(skb-data)); - + CAPIMSG_NCCI(skb-data), + CAPIMSG_MSGID(skb-data)); + spin_unlock(card-lock); + } capi_ctr_handle_message(ctrl, ApplId, skb); } break; @@ -500,9 +502,9 @@ static void b1dma_handle_rx(avmcard *card) ApplId = _get_word(p); NCCI = _get_word(p); WindowSize = _get_word(p); - + spin_lock(card-lock); capilib_new_ncci(cinfo-ncci_head, ApplId, NCCI, WindowSize); - + spin_unlock(card-lock); break; case RECEIVE_FREE_NCCI: @@ -510,9 +512,11 @@ static void b1dma_handle_rx(avmcard *card) ApplId = _get_word(p); NCCI = _get_word(p); - if (NCCI != 0x) + if (NCCI != 0x) { + spin_lock(card-lock); capilib_free_ncci(cinfo-ncci_head, ApplId, NCCI); - + spin_unlock(card-lock); + } break; case RECEIVE_START: @@ -751,10 +755,10 @@ void b1dma_reset_ctr(struct capi_ctr *ctrl) spin_lock_irqsave(card-lock, flags); b1dma_reset(card); - spin_unlock_irqrestore(card-lock, flags); memset(cinfo-version, 0, sizeof(cinfo-version)); capilib_release(cinfo-ncci_head); + spin_unlock_irqrestore(card-lock, flags); capi_ctr_reseted(ctrl); } @@ -803,8 +807,11 @@ void b1dma_release_appl(struct capi_ctr *ctrl, u16 appl) avmcard *card = cinfo-card; struct sk_buff *skb; void *p; + unsigned long flags; + spin_lock_irqsave(card-lock, flags); capilib_release_appl(cinfo-ncci_head, appl); + spin_unlock_irqrestore(card-lock, flags); skb = alloc_skb(7, GFP_ATOMIC); if (!skb) { @@ -832,10 +839,13 @@ u16 b1dma_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u16 retval = CAPI_NOERROR; if (CAPIMSG_CMD(skb-data) == CAPI_DATA_B3_REQ) { + unsigned long flags; + spin_lock_irqsave(card-lock, flags); retval = capilib_data_b3_req(cinfo-ncci_head, CAPIMSG_APPID(skb-data), CAPIMSG_NCCI(skb-data), CAPIMSG_MSGID(skb-data)); + spin_unlock_irqrestore(card-lock, flags); } if (retval == CAPI_NOERROR) b1dma_queue_tx(card, skb); -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN]Fix random hard freeze with AVM T1 cards
This fix the hard freeze debuged for AVM C4 cards for the AVM T1 cards. Signed-off-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/hardware/avm/t1isa.c | 28 1 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/isdn/hardware/avm/t1isa.c b/drivers/isdn/hardware/avm/t1isa.c index c925020..6130724 100644 --- a/drivers/isdn/hardware/avm/t1isa.c +++ b/drivers/isdn/hardware/avm/t1isa.c @@ -180,8 +180,8 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) ApplId = (unsigned) b1_get_word(card-port); MsgLen = t1_get_slice(card-port, card-msgbuf); - spin_unlock_irqrestore(card-lock, flags); if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) { + spin_unlock_irqrestore(card-lock, flags); printk(KERN_ERR %s: incoming packet dropped\n, card-name); } else { @@ -190,7 +190,7 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) capilib_data_b3_conf(cinfo-ncci_head, ApplId, CAPIMSG_NCCI(skb-data), CAPIMSG_MSGID(skb-data)); - + spin_unlock_irqrestore(card-lock, flags); capi_ctr_handle_message(ctrl, ApplId, skb); } break; @@ -200,21 +200,17 @@ static irqreturn_t t1isa_interrupt(int interrupt, void *devptr) ApplId = b1_get_word(card-port); NCCI = b1_get_word(card-port); WindowSize = b1_get_word(card-port); - spin_unlock_irqrestore(card-lock, flags); - capilib_new_ncci(cinfo-ncci_head, ApplId, NCCI, WindowSize); - + spin_unlock_irqrestore(card-lock, flags); break; case RECEIVE_FREE_NCCI: ApplId = b1_get_word(card-port); NCCI = b1_get_word(card-port); - spin_unlock_irqrestore(card-lock, flags); - if (NCCI != 0x) capilib_free_ncci(cinfo-ncci_head, ApplId, NCCI); - + spin_unlock_irqrestore(card-lock, flags); break; case RECEIVE_START: @@ -333,13 +329,16 @@ static void t1isa_reset_ctr(struct capi_ctr *ctrl) avmctrl_info *cinfo = (avmctrl_info *)(ctrl-driverdata); avmcard *card = cinfo-card; unsigned int port = card-port; + unsigned long flags; t1_disable_irq(port); b1_reset(port); b1_reset(port); memset(cinfo-version, 0, sizeof(cinfo-version)); + spin_lock_irqsave(card-lock, flags); capilib_release(cinfo-ncci_head); + spin_unlock_irqrestore(card-lock, flags); capi_ctr_reseted(ctrl); } @@ -466,29 +465,26 @@ static u16 t1isa_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u8 subcmd = CAPIMSG_SUBCOMMAND(skb-data); u16 dlen, retval; + spin_lock_irqsave(card-lock, flags); if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { retval = capilib_data_b3_req(cinfo-ncci_head, CAPIMSG_APPID(skb-data), CAPIMSG_NCCI(skb-data), CAPIMSG_MSGID(skb-data)); - if (retval != CAPI_NOERROR) + if (retval != CAPI_NOERROR) { + spin_unlock_irqrestore(card-lock, flags); return retval; - + } dlen = CAPIMSG_DATALEN(skb-data); - spin_lock_irqsave(card-lock, flags); b1_put_byte(port, SEND_DATA_B3_REQ); t1_put_slice(port, skb-data, len); t1_put_slice(port, skb-data + len, dlen); - spin_unlock_irqrestore(card-lock, flags); } else { - - spin_lock_irqsave(card-lock, flags); b1_put_byte(port, SEND_MESSAGE); t1_put_slice(port, skb-data, len); - spin_unlock_irqrestore(card-lock, flags); } - + spin_unlock_irqrestore(card-lock, flags); dev_kfree_skb_any(skb); return CAPI_NOERROR; } -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN] fix random freezes with AVM B1 drivers
This fix the same issue which was debbuged for the C4 controller for the B1 versions. The capilib_ function modify or traverse a linked list without locking. This patch extend the existing locking to the calls of these function to prevent access to a list which is in the middle of a modification. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> --- drivers/isdn/hardware/avm/b1.c | 28 +--- 1 files changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c index 7a69a18..4484a64 100644 --- a/drivers/isdn/hardware/avm/b1.c +++ b/drivers/isdn/hardware/avm/b1.c @@ -321,12 +321,15 @@ void b1_reset_ctr(struct capi_ctr *ctrl) avmctrl_info *cinfo = (avmctrl_info *)(ctrl->driverdata); avmcard *card = cinfo->card; unsigned int port = card->port; + unsigned long flags; b1_reset(port); b1_reset(port); memset(cinfo->version, 0, sizeof(cinfo->version)); + spin_lock_irqsave(>lock, flags); capilib_release(>ncci_head); + spin_unlock_irqrestore(>lock, flags); capi_ctr_reseted(ctrl); } @@ -361,9 +364,8 @@ void b1_release_appl(struct capi_ctr *ctrl, u16 appl) unsigned int port = card->port; unsigned long flags; - capilib_release_appl(>ncci_head, appl); - spin_lock_irqsave(>lock, flags); + capilib_release_appl(>ncci_head, appl); b1_put_byte(port, SEND_RELEASE); b1_put_word(port, appl); spin_unlock_irqrestore(>lock, flags); @@ -380,27 +382,27 @@ u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u8 subcmd = CAPIMSG_SUBCOMMAND(skb->data); u16 dlen, retval; + spin_lock_irqsave(>lock, flags); if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { retval = capilib_data_b3_req(>ncci_head, CAPIMSG_APPID(skb->data), CAPIMSG_NCCI(skb->data), CAPIMSG_MSGID(skb->data)); - if (retval != CAPI_NOERROR) + if (retval != CAPI_NOERROR) { + spin_unlock_irqrestore(>lock, flags); return retval; + } dlen = CAPIMSG_DATALEN(skb->data); - spin_lock_irqsave(>lock, flags); b1_put_byte(port, SEND_DATA_B3_REQ); b1_put_slice(port, skb->data, len); b1_put_slice(port, skb->data + len, dlen); - spin_unlock_irqrestore(>lock, flags); } else { - spin_lock_irqsave(>lock, flags); b1_put_byte(port, SEND_MESSAGE); b1_put_slice(port, skb->data, len); - spin_unlock_irqrestore(>lock, flags); } + spin_unlock_irqrestore(>lock, flags); dev_kfree_skb_any(skb); return CAPI_NOERROR; @@ -534,17 +536,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) ApplId = (unsigned) b1_get_word(card->port); MsgLen = b1_get_slice(card->port, card->msgbuf); - spin_unlock_irqrestore(>lock, flags); if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) { printk(KERN_ERR "%s: incoming packet dropped\n", card->name); + spin_unlock_irqrestore(>lock, flags); } else { memcpy(skb_put(skb, MsgLen), card->msgbuf, MsgLen); if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_CONF) capilib_data_b3_conf(>ncci_head, ApplId, CAPIMSG_NCCI(skb->data), CAPIMSG_MSGID(skb->data)); - + spin_unlock_irqrestore(>lock, flags); capi_ctr_handle_message(ctrl, ApplId, skb); } break; @@ -554,21 +556,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) ApplId = b1_get_word(card->port); NCCI = b1_get_word(card->port); WindowSize = b1_get_word(card->port); - spin_unlock_irqrestore(>lock, flags); - capilib_new_ncci(>ncci_head, ApplId, NCCI, WindowSize); - + spin_unlock_irqrestore(>lock, flags); break; case RECEIVE_FREE_NCCI: ApplId = b1_get_word(card->port); NCCI = b1_get_word(card->port); - spin_unlock_irqrestore(>lock, flags); - if (NCCI != 0x) capilib_free_ncci(>ncci_head, ApplId, NCCI); - +
[PATCH] [ISDN] Fix random hard freeze with AVM c4 card
The patch - Includes the call to capilib_data_b3_req in the spinlock. This routine in turn calls the offending mq_enqueue routine that triggered the freeze if not locked. This should also fix other indicators of incosistent capilib_msgidqueue list, that trigger messages like: Oct 5 03:05:57 BERL0 kernel: kcapi: msgid 3019 ncci 0x30301 not on queue that we saw several times a day (usually several in a row). - Fixes all occurrences of c4_dispatch_tx to be called with active spinlock, there were some instances where no lock was active. Mostly these are in very infrequently called routines, so the additional performance penalty is minimal. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> Signed-off-by: Rainer Brestan <[EMAIL PROTECTED]> Signed-off-by: Ralf Schlatterbeck <[EMAIL PROTECTED]> --- drivers/isdn/hardware/avm/c4.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index d58f927..4c6ef91 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -727,6 +727,7 @@ static void c4_send_init(avmcard *card) { struct sk_buff *skb; void *p; + unsigned long flags; skb = alloc_skb(15, GFP_ATOMIC); if (!skb) { @@ -744,12 +745,15 @@ static void c4_send_init(avmcard *card) skb_put(skb, (u8 *)p - (u8 *)skb->data); skb_queue_tail(>dma->send_queue, skb); + spin_lock_irqsave(>lock, flags); c4_dispatch_tx(card); + spin_unlock_irqrestore(>lock, flags); } static int queue_sendconfigword(avmcard *card, u32 val) { struct sk_buff *skb; + unsigned long flags; void *p; skb = alloc_skb(3+4, GFP_ATOMIC); @@ -766,7 +770,9 @@ static int queue_sendconfigword(avmcard *card, u32 val) skb_put(skb, (u8 *)p - (u8 *)skb->data); skb_queue_tail(>dma->send_queue, skb); + spin_lock_irqsave(>lock, flags); c4_dispatch_tx(card); + spin_unlock_irqrestore(>lock, flags); return 0; } @@ -986,7 +992,9 @@ static void c4_release_appl(struct capi_ctr *ctrl, u16 appl) struct sk_buff *skb; void *p; + spin_lock_irqsave(>lock, flags); capilib_release_appl(>ncci_head, appl); + spin_unlock_irqrestore(>lock, flags); if (ctrl->cnr == card->cardnr) { skb = alloc_skb(7, GFP_ATOMIC); @@ -1018,8 +1026,9 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) avmcard *card = cinfo->card; u16 retval = CAPI_NOERROR; unsigned long flags; - - if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) { + + spin_lock_irqsave(>lock, flags); + if (CAPIMSG_CMD(skb->data) == CAPI_DATA_B3_REQ) { retval = capilib_data_b3_req(>ncci_head, CAPIMSG_APPID(skb->data), CAPIMSG_NCCI(skb->data), @@ -1027,10 +1036,9 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) } if (retval == CAPI_NOERROR) { skb_queue_tail(>dma->send_queue, skb); - spin_lock_irqsave(>lock, flags); c4_dispatch_tx(card); - spin_unlock_irqrestore(>lock, flags); } + spin_unlock_irqrestore(>lock, flags); return retval; } -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN] Fix random hard freeze with AVM c4 card
The patch - Includes the call to capilib_data_b3_req in the spinlock. This routine in turn calls the offending mq_enqueue routine that triggered the freeze if not locked. This should also fix other indicators of incosistent capilib_msgidqueue list, that trigger messages like: Oct 5 03:05:57 BERL0 kernel: kcapi: msgid 3019 ncci 0x30301 not on queue that we saw several times a day (usually several in a row). - Fixes all occurrences of c4_dispatch_tx to be called with active spinlock, there were some instances where no lock was active. Mostly these are in very infrequently called routines, so the additional performance penalty is minimal. Signed-off-by: Karsten Keil [EMAIL PROTECTED] Signed-off-by: Rainer Brestan [EMAIL PROTECTED] Signed-off-by: Ralf Schlatterbeck [EMAIL PROTECTED] --- drivers/isdn/hardware/avm/c4.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c index d58f927..4c6ef91 100644 --- a/drivers/isdn/hardware/avm/c4.c +++ b/drivers/isdn/hardware/avm/c4.c @@ -727,6 +727,7 @@ static void c4_send_init(avmcard *card) { struct sk_buff *skb; void *p; + unsigned long flags; skb = alloc_skb(15, GFP_ATOMIC); if (!skb) { @@ -744,12 +745,15 @@ static void c4_send_init(avmcard *card) skb_put(skb, (u8 *)p - (u8 *)skb-data); skb_queue_tail(card-dma-send_queue, skb); + spin_lock_irqsave(card-lock, flags); c4_dispatch_tx(card); + spin_unlock_irqrestore(card-lock, flags); } static int queue_sendconfigword(avmcard *card, u32 val) { struct sk_buff *skb; + unsigned long flags; void *p; skb = alloc_skb(3+4, GFP_ATOMIC); @@ -766,7 +770,9 @@ static int queue_sendconfigword(avmcard *card, u32 val) skb_put(skb, (u8 *)p - (u8 *)skb-data); skb_queue_tail(card-dma-send_queue, skb); + spin_lock_irqsave(card-lock, flags); c4_dispatch_tx(card); + spin_unlock_irqrestore(card-lock, flags); return 0; } @@ -986,7 +992,9 @@ static void c4_release_appl(struct capi_ctr *ctrl, u16 appl) struct sk_buff *skb; void *p; + spin_lock_irqsave(card-lock, flags); capilib_release_appl(cinfo-ncci_head, appl); + spin_unlock_irqrestore(card-lock, flags); if (ctrl-cnr == card-cardnr) { skb = alloc_skb(7, GFP_ATOMIC); @@ -1018,8 +1026,9 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) avmcard *card = cinfo-card; u16 retval = CAPI_NOERROR; unsigned long flags; - - if (CAPIMSG_CMD(skb-data) == CAPI_DATA_B3_REQ) { + + spin_lock_irqsave(card-lock, flags); + if (CAPIMSG_CMD(skb-data) == CAPI_DATA_B3_REQ) { retval = capilib_data_b3_req(cinfo-ncci_head, CAPIMSG_APPID(skb-data), CAPIMSG_NCCI(skb-data), @@ -1027,10 +1036,9 @@ static u16 c4_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) } if (retval == CAPI_NOERROR) { skb_queue_tail(card-dma-send_queue, skb); - spin_lock_irqsave(card-lock, flags); c4_dispatch_tx(card); - spin_unlock_irqrestore(card-lock, flags); } + spin_unlock_irqrestore(card-lock, flags); return retval; } -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] [ISDN] fix random freezes with AVM B1 drivers
This fix the same issue which was debbuged for the C4 controller for the B1 versions. The capilib_ function modify or traverse a linked list without locking. This patch extend the existing locking to the calls of these function to prevent access to a list which is in the middle of a modification. Signed-off-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/hardware/avm/b1.c | 28 +--- 1 files changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c index 7a69a18..4484a64 100644 --- a/drivers/isdn/hardware/avm/b1.c +++ b/drivers/isdn/hardware/avm/b1.c @@ -321,12 +321,15 @@ void b1_reset_ctr(struct capi_ctr *ctrl) avmctrl_info *cinfo = (avmctrl_info *)(ctrl-driverdata); avmcard *card = cinfo-card; unsigned int port = card-port; + unsigned long flags; b1_reset(port); b1_reset(port); memset(cinfo-version, 0, sizeof(cinfo-version)); + spin_lock_irqsave(card-lock, flags); capilib_release(cinfo-ncci_head); + spin_unlock_irqrestore(card-lock, flags); capi_ctr_reseted(ctrl); } @@ -361,9 +364,8 @@ void b1_release_appl(struct capi_ctr *ctrl, u16 appl) unsigned int port = card-port; unsigned long flags; - capilib_release_appl(cinfo-ncci_head, appl); - spin_lock_irqsave(card-lock, flags); + capilib_release_appl(cinfo-ncci_head, appl); b1_put_byte(port, SEND_RELEASE); b1_put_word(port, appl); spin_unlock_irqrestore(card-lock, flags); @@ -380,27 +382,27 @@ u16 b1_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) u8 subcmd = CAPIMSG_SUBCOMMAND(skb-data); u16 dlen, retval; + spin_lock_irqsave(card-lock, flags); if (CAPICMD(cmd, subcmd) == CAPI_DATA_B3_REQ) { retval = capilib_data_b3_req(cinfo-ncci_head, CAPIMSG_APPID(skb-data), CAPIMSG_NCCI(skb-data), CAPIMSG_MSGID(skb-data)); - if (retval != CAPI_NOERROR) + if (retval != CAPI_NOERROR) { + spin_unlock_irqrestore(card-lock, flags); return retval; + } dlen = CAPIMSG_DATALEN(skb-data); - spin_lock_irqsave(card-lock, flags); b1_put_byte(port, SEND_DATA_B3_REQ); b1_put_slice(port, skb-data, len); b1_put_slice(port, skb-data + len, dlen); - spin_unlock_irqrestore(card-lock, flags); } else { - spin_lock_irqsave(card-lock, flags); b1_put_byte(port, SEND_MESSAGE); b1_put_slice(port, skb-data, len); - spin_unlock_irqrestore(card-lock, flags); } + spin_unlock_irqrestore(card-lock, flags); dev_kfree_skb_any(skb); return CAPI_NOERROR; @@ -534,17 +536,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) ApplId = (unsigned) b1_get_word(card-port); MsgLen = b1_get_slice(card-port, card-msgbuf); - spin_unlock_irqrestore(card-lock, flags); if (!(skb = alloc_skb(MsgLen, GFP_ATOMIC))) { printk(KERN_ERR %s: incoming packet dropped\n, card-name); + spin_unlock_irqrestore(card-lock, flags); } else { memcpy(skb_put(skb, MsgLen), card-msgbuf, MsgLen); if (CAPIMSG_CMD(skb-data) == CAPI_DATA_B3_CONF) capilib_data_b3_conf(cinfo-ncci_head, ApplId, CAPIMSG_NCCI(skb-data), CAPIMSG_MSGID(skb-data)); - + spin_unlock_irqrestore(card-lock, flags); capi_ctr_handle_message(ctrl, ApplId, skb); } break; @@ -554,21 +556,17 @@ irqreturn_t b1_interrupt(int interrupt, void *devptr) ApplId = b1_get_word(card-port); NCCI = b1_get_word(card-port); WindowSize = b1_get_word(card-port); - spin_unlock_irqrestore(card-lock, flags); - capilib_new_ncci(cinfo-ncci_head, ApplId, NCCI, WindowSize); - + spin_unlock_irqrestore(card-lock, flags); break; case RECEIVE_FREE_NCCI: ApplId = b1_get_word(card-port); NCCI = b1_get_word(card-port); - spin_unlock_irqrestore(card-lock, flags); - if (NCCI != 0x) capilib_free_ncci(cinfo-ncci_head, ApplId, NCCI); - + spin_unlock_irqrestore(card-lock, flags); break; case RECEIVE_START
Re: [PATCHes] ISDN simple cleanups - hotplug API prep
On Thu, Oct 11, 2007 at 03:06:55PM -0400, Jeff Garzik wrote: > Karsten, > > As I mentioned in previous emails, I would like to send these upstream > for 2.6.24. These are the first step in converting the hisax driver > over to the modular, hotplug-friendly ISA/PNP/PCI APIs. > > The second step in that conversion is 95% complete (one more driver), > and is stored in branch 'isdn-pci' of the repository below. > > The changes below were posted as patches many weeks ago, without > comment. I also propagated these to the 'ALL' branch that gets copied > into -mm for testing, though some changes have been there longer than > others. > > All these changes are code movement changes, without any changes to the > logic -- even the existing whitespace funnies were kept in many cases. > > Would you mind pulling these, or permitting me to push them upstream? > Tested and Acked. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCHes] ISDN simple cleanups - hotplug API prep
On Thu, Oct 11, 2007 at 03:06:55PM -0400, Jeff Garzik wrote: Karsten, As I mentioned in previous emails, I would like to send these upstream for 2.6.24. These are the first step in converting the hisax driver over to the modular, hotplug-friendly ISA/PNP/PCI APIs. The second step in that conversion is 95% complete (one more driver), and is stored in branch 'isdn-pci' of the repository below. The changes below were posted as patches many weeks ago, without comment. I also propagated these to the 'ALL' branch that gets copied into -mm for testing, though some changes have been there longer than others. All these changes are code movement changes, without any changes to the logic -- even the existing whitespace funnies were kept in many cases. Would you mind pulling these, or permitting me to push them upstream? Tested and Acked. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Fix data access out of array bounds
Fix against access random data bytes outside the dev->chanmap array. Thanks to Oliver Neukum for pointing me to this issue. Patch is against 2.6.23-rc9-git6 Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> --- drivers/isdn/i4l/isdn_common.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index ec5f404..4910bca 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -1135,7 +1135,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off) if (count > dev->drv[drvidx]->stavail) count = dev->drv[drvidx]->stavail; len = dev->drv[drvidx]->interface->readstat(buf, count, - drvidx, isdn_minor2chan(minor)); + drvidx, isdn_minor2chan(minor - ISDN_MINOR_CTRL)); if (len < 0) { retval = len; goto out; @@ -1207,7 +1207,8 @@ isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off */ if (dev->drv[drvidx]->interface->writecmd) retval = dev->drv[drvidx]->interface-> - writecmd(buf, count, drvidx, isdn_minor2chan(minor)); + writecmd(buf, count, drvidx, + isdn_minor2chan(minor - ISDN_MINOR_CTRL)); else retval = count; goto out; -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Fix data access out of array bounds
Fix against access random data bytes outside the dev-chanmap array. Thanks to Oliver Neukum for pointing me to this issue. Patch is against 2.6.23-rc9-git6 Signed-off-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/i4l/isdn_common.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index ec5f404..4910bca 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -1135,7 +1135,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off) if (count dev-drv[drvidx]-stavail) count = dev-drv[drvidx]-stavail; len = dev-drv[drvidx]-interface-readstat(buf, count, - drvidx, isdn_minor2chan(minor)); + drvidx, isdn_minor2chan(minor - ISDN_MINOR_CTRL)); if (len 0) { retval = len; goto out; @@ -1207,7 +1207,8 @@ isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off */ if (dev-drv[drvidx]-interface-writecmd) retval = dev-drv[drvidx]-interface- - writecmd(buf, count, drvidx, isdn_minor2chan(minor)); + writecmd(buf, count, drvidx, + isdn_minor2chan(minor - ISDN_MINOR_CTRL)); else retval = count; goto out; -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] isdn/sc: remove unused REQUEST_IRQ and unnecessary header file
[PATCH] isdn/sc: remove unused REQUEST_IRQ and unnecessary REQUEST_IRQ is never used, so delete it. In the process get rid of the macro FREE_IRQ which makes the code unnecessarily difficult to read. Signed-off-by: Fernando Luis Vazquez Cao <[EMAIL PROTECTED]> Acked-by: Karsten Keil <[EMAIL PROTECTED]> --- diff -urNp linux-2.6.23-rc3-orig/drivers/isdn/sc/debug.h linux-2.6.23-rc3/drivers/isdn/sc/debug.h --- linux-2.6.23-rc3-orig/drivers/isdn/sc/debug.h 2007-07-09 08:32:17.0 +0900 +++ linux-2.6.23-rc3/drivers/isdn/sc/debug.h1970-01-01 09:00:00.0 +0900 @@ -1,19 +0,0 @@ -/* $Id: debug.h,v 1.2.8.1 2001/09/23 22:24:59 kai Exp $ - * - * Copyright (C) 1996 SpellCaster Telecommunications Inc. - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - * - * For more information, please contact [EMAIL PROTECTED] or write: - * - * SpellCaster Telecommunications Inc. - * 5621 Finch Avenue East, Unit #3 - * Scarborough, Ontario Canada - * M1B 2T9 - * +1 (416) 297-8565 - * +1 (416) 297-6433 Facsimile - */ - -#define REQUEST_IRQ(a,b,c,d,e) request_irq(a,b,c,d,e) -#define FREE_IRQ(a,b) free_irq(a,b) diff -urNp linux-2.6.23-rc3-orig/drivers/isdn/sc/includes.h linux-2.6.23-rc3/drivers/isdn/sc/includes.h --- linux-2.6.23-rc3-orig/drivers/isdn/sc/includes.h2007-07-09 08:32:17.0 +0900 +++ linux-2.6.23-rc3/drivers/isdn/sc/includes.h 2007-08-24 20:55:45.0 +0900 @@ -14,4 +14,3 @@ #include #include #include -#include "debug.h" diff -urNp linux-2.6.23-rc3-orig/drivers/isdn/sc/init.c linux-2.6.23-rc3/drivers/isdn/sc/init.c --- linux-2.6.23-rc3-orig/drivers/isdn/sc/init.c2007-07-09 08:32:17.0 +0900 +++ linux-2.6.23-rc3/drivers/isdn/sc/init.c 2007-08-24 20:31:58.0 +0900 @@ -404,7 +404,7 @@ static void __exit sc_exit(void) /* * Release the IRQ */ - FREE_IRQ(sc_adapter[i]->interrupt, NULL); + free_irq(sc_adapter[i]->interrupt, NULL); /* * Reset for a clean start -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] isdn/sc: remove unused REQUEST_IRQ and unnecessary header file
[PATCH] isdn/sc: remove unused REQUEST_IRQ and unnecessary REQUEST_IRQ is never used, so delete it. In the process get rid of the macro FREE_IRQ which makes the code unnecessarily difficult to read. Signed-off-by: Fernando Luis Vazquez Cao [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] --- diff -urNp linux-2.6.23-rc3-orig/drivers/isdn/sc/debug.h linux-2.6.23-rc3/drivers/isdn/sc/debug.h --- linux-2.6.23-rc3-orig/drivers/isdn/sc/debug.h 2007-07-09 08:32:17.0 +0900 +++ linux-2.6.23-rc3/drivers/isdn/sc/debug.h1970-01-01 09:00:00.0 +0900 @@ -1,19 +0,0 @@ -/* $Id: debug.h,v 1.2.8.1 2001/09/23 22:24:59 kai Exp $ - * - * Copyright (C) 1996 SpellCaster Telecommunications Inc. - * - * This software may be used and distributed according to the terms - * of the GNU General Public License, incorporated herein by reference. - * - * For more information, please contact [EMAIL PROTECTED] or write: - * - * SpellCaster Telecommunications Inc. - * 5621 Finch Avenue East, Unit #3 - * Scarborough, Ontario Canada - * M1B 2T9 - * +1 (416) 297-8565 - * +1 (416) 297-6433 Facsimile - */ - -#define REQUEST_IRQ(a,b,c,d,e) request_irq(a,b,c,d,e) -#define FREE_IRQ(a,b) free_irq(a,b) diff -urNp linux-2.6.23-rc3-orig/drivers/isdn/sc/includes.h linux-2.6.23-rc3/drivers/isdn/sc/includes.h --- linux-2.6.23-rc3-orig/drivers/isdn/sc/includes.h2007-07-09 08:32:17.0 +0900 +++ linux-2.6.23-rc3/drivers/isdn/sc/includes.h 2007-08-24 20:55:45.0 +0900 @@ -14,4 +14,3 @@ #include linux/timer.h #include linux/wait.h #include linux/isdnif.h -#include debug.h diff -urNp linux-2.6.23-rc3-orig/drivers/isdn/sc/init.c linux-2.6.23-rc3/drivers/isdn/sc/init.c --- linux-2.6.23-rc3-orig/drivers/isdn/sc/init.c2007-07-09 08:32:17.0 +0900 +++ linux-2.6.23-rc3/drivers/isdn/sc/init.c 2007-08-24 20:31:58.0 +0900 @@ -404,7 +404,7 @@ static void __exit sc_exit(void) /* * Release the IRQ */ - FREE_IRQ(sc_adapter[i]-interrupt, NULL); + free_irq(sc_adapter[i]-interrupt, NULL); /* * Reset for a clean start -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 17/30] isdn: Get rid of some pointless allocation casts in common and bsd comp.
On Fri, Aug 24, 2007 at 02:09:34AM +0200, Jesper Juhl wrote: > vmalloc() returns a void pointer - no need to cast the return value. > > Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> Acked-by: Karsten Keil <[EMAIL PROTECTED]> > --- > drivers/isdn/i4l/isdn_bsdcomp.c |5 ++--- > drivers/isdn/i4l/isdn_common.c |2 +- > 2 files changed, 3 insertions(+), 4 deletions(-) > ... -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 17/30] isdn: Get rid of some pointless allocation casts in common and bsd comp.
On Fri, Aug 24, 2007 at 02:09:34AM +0200, Jesper Juhl wrote: vmalloc() returns a void pointer - no need to cast the return value. Signed-off-by: Jesper Juhl [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/i4l/isdn_bsdcomp.c |5 ++--- drivers/isdn/i4l/isdn_common.c |2 +- 2 files changed, 3 insertions(+), 4 deletions(-) ... -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 14/14] Convert from class_device to device for ISDN capi
On Mon, Aug 20, 2007 at 03:48:20PM -0700, [EMAIL PROTECTED] wrote: > -- > Content-Disposition: inline; filename=isdn-capi.patch > > Convert from class_device to device for drivers/isdn/capi. This is > part of the work to eliminate struct class_device. > If you add a Signed-off-by: I'll ack this patch. > --- > drivers/isdn/capi/capi.c |6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > --- a/drivers/isdn/capi/capi.c > +++ b/drivers/isdn/capi/capi.c > @@ -1544,11 +1544,11 @@ static int __init capi_init(void) > return PTR_ERR(capi_class); > } > > - class_device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, > "capi"); > + device_create(capi_class, NULL, MKDEV(capi_major, 0), "capi"); > > #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE > if (capinc_tty_init() < 0) { > - class_device_destroy(capi_class, MKDEV(capi_major, 0)); > + device_destroy(capi_class, MKDEV(capi_major, 0)); > class_destroy(capi_class); > unregister_chrdev(capi_major, "capi20"); > return -ENOMEM; > @@ -1576,7 +1576,7 @@ static void __exit capi_exit(void) > { > proc_exit(); > > - class_device_destroy(capi_class, MKDEV(capi_major, 0)); > + device_destroy(capi_class, MKDEV(capi_major, 0)); > class_destroy(capi_class); > unregister_chrdev(capi_major, "capi20"); > > > -- -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 14/14] Convert from class_device to device for ISDN capi
On Mon, Aug 20, 2007 at 03:48:20PM -0700, [EMAIL PROTECTED] wrote: -- Content-Disposition: inline; filename=isdn-capi.patch Convert from class_device to device for drivers/isdn/capi. This is part of the work to eliminate struct class_device. If you add a Signed-off-by: I'll ack this patch. --- drivers/isdn/capi/capi.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -1544,11 +1544,11 @@ static int __init capi_init(void) return PTR_ERR(capi_class); } - class_device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, capi); + device_create(capi_class, NULL, MKDEV(capi_major, 0), capi); #ifdef CONFIG_ISDN_CAPI_MIDDLEWARE if (capinc_tty_init() 0) { - class_device_destroy(capi_class, MKDEV(capi_major, 0)); + device_destroy(capi_class, MKDEV(capi_major, 0)); class_destroy(capi_class); unregister_chrdev(capi_major, capi20); return -ENOMEM; @@ -1576,7 +1576,7 @@ static void __exit capi_exit(void) { proc_exit(); - class_device_destroy(capi_class, MKDEV(capi_major, 0)); + device_destroy(capi_class, MKDEV(capi_major, 0)); class_destroy(capi_class); unregister_chrdev(capi_major, capi20); -- -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: drivers/infiniband/mlx/mad.c misplaced ;
On Thu, Aug 16, 2007 at 01:22:04PM +0300, Ilpo Järvinen wrote: > > ...I guess those guys hunting for broken busyloops in the other thread > could also benefit from similar searching commands introduced in this > thread... ...Ccing Satyam to caught their attention too. > > > ./drivers/isdn/hisax/hfc_pci.c > 125: if (Read_hfc(cs, HFCPCI_INT_S1)) ; > 155: if (Read_hfc(cs, HFCPCI_INT_S1)) ; > 1483: if (Read_hfc(cs, HFCPCI_INT_S1)) ; > -- > ./drivers/isdn/hisax/hfc_sx.c > 377: if (Read_hfc(cs, HFCSX_INT_S1)) ; > 407: if (Read_hfc(cs, HFCSX_INT_S2)) ; > 1246: if (Read_hfc(cs, HFCSX_INT_S1)) ; > -- These are workaround to not get compiler warnings about ignored return values I got some time ago under some architecture. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: drivers/infiniband/mlx/mad.c misplaced ;
On Thu, Aug 16, 2007 at 01:22:04PM +0300, Ilpo Järvinen wrote: ...I guess those guys hunting for broken busyloops in the other thread could also benefit from similar searching commands introduced in this thread... ...Ccing Satyam to caught their attention too. ./drivers/isdn/hisax/hfc_pci.c 125: if (Read_hfc(cs, HFCPCI_INT_S1)) ; 155: if (Read_hfc(cs, HFCPCI_INT_S1)) ; 1483: if (Read_hfc(cs, HFCPCI_INT_S1)) ; -- ./drivers/isdn/hisax/hfc_sx.c 377: if (Read_hfc(cs, HFCSX_INT_S1)) ; 407: if (Read_hfc(cs, HFCSX_INT_S2)) ; 1246: if (Read_hfc(cs, HFCSX_INT_S1)) ; -- These are workaround to not get compiler warnings about ignored return values I got some time ago under some architecture. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH][RESEND][ISDN] Guard against a potential NULL pointer dereference in old_capi_manufacturer()
On Sat, Aug 04, 2007 at 08:31:54PM +0200, Jesper Juhl wrote: > (first send: Monday 25 June 2007, resending due to no response) > (resending again on August 8'th, 2007) > > > In drivers/isdn/capi/kcapi.c::old_capi_manufacturer(), if the call > to get_capi_ctr_by_nr(ldef.contr); in line 823 returns NULL, then > we'll be dereferencing a NULL pointer in the very next line. > > (Found by Coverity checker as bug #402) > > > Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> Acked-by: Karsten Keil <[EMAIL PROTECTED]> > --- > > drivers/isdn/capi/kcapi.c |2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c > index 3ed34f7..3f9e962 100644 > --- a/drivers/isdn/capi/kcapi.c > +++ b/drivers/isdn/capi/kcapi.c > @@ -821,6 +821,8 @@ static int old_capi_manufacturer(unsigned int cmd, void > __user *data) > return -EFAULT; > } > card = get_capi_ctr_by_nr(ldef.contr); > + if (!card) > + return -EINVAL; > card = capi_ctr_get(card); > if (!card) > return -ESRCH; > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH][RESEND][ISDN] fix possible NULL deref on low memory condition in capidrv.c::send_message()
On Sat, Aug 04, 2007 at 08:31:37PM +0200, Jesper Juhl wrote: > (first send: Monday 25 June 2007, resending due to no response) > (resending again since there has still been no response) > > > If we fail to allocate an skb in > drivers/isdn/capi/capidrv.c::send_message(), then we'll end up > dereferencing a NULL pointer. > Since out of memory conditions are not unheard of, I believe it > is better to print a error message and just return rather than > bring down the whole kernel. > Sure, doing this may upset some application, but that's still > better than crashing the whole system. > > (ps. please Cc me on replies from the isdn4linux list since I'm not > subscribed > there) > > > Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> Acked-by: Karsten Keil <[EMAIL PROTECTED]> > --- > > drivers/isdn/capi/capidrv.c |5 + > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c > index 23b6f7b..476012b 100644 > --- a/drivers/isdn/capi/capidrv.c > +++ b/drivers/isdn/capi/capidrv.c > @@ -506,9 +506,14 @@ static void send_message(capidrv_contr * card, _cmsg * > cmsg) > { > struct sk_buff *skb; > size_t len; > + > capi_cmsg2message(cmsg, cmsg->buf); > len = CAPIMSG_LEN(cmsg->buf); > skb = alloc_skb(len, GFP_ATOMIC); > + if (!skb) { > + printk(KERN_ERR "capidrv::send_message: can't allocate mem\n"); > + return; > + } > memcpy(skb_put(skb, len), cmsg->buf, len); > if (capi20_put_message(, skb) != CAPI_NOERROR) > kfree_skb(skb); > > > - > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH][RESEND][ISDN] fix possible NULL deref on low memory condition in capidrv.c::send_message()
On Sat, Aug 04, 2007 at 08:31:37PM +0200, Jesper Juhl wrote: (first send: Monday 25 June 2007, resending due to no response) (resending again since there has still been no response) If we fail to allocate an skb in drivers/isdn/capi/capidrv.c::send_message(), then we'll end up dereferencing a NULL pointer. Since out of memory conditions are not unheard of, I believe it is better to print a error message and just return rather than bring down the whole kernel. Sure, doing this may upset some application, but that's still better than crashing the whole system. (ps. please Cc me on replies from the isdn4linux list since I'm not subscribed there) Signed-off-by: Jesper Juhl [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/capi/capidrv.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index 23b6f7b..476012b 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c @@ -506,9 +506,14 @@ static void send_message(capidrv_contr * card, _cmsg * cmsg) { struct sk_buff *skb; size_t len; + capi_cmsg2message(cmsg, cmsg-buf); len = CAPIMSG_LEN(cmsg-buf); skb = alloc_skb(len, GFP_ATOMIC); + if (!skb) { + printk(KERN_ERR capidrv::send_message: can't allocate mem\n); + return; + } memcpy(skb_put(skb, len), cmsg-buf, len); if (capi20_put_message(global.ap, skb) != CAPI_NOERROR) kfree_skb(skb); - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH][RESEND][ISDN] Guard against a potential NULL pointer dereference in old_capi_manufacturer()
On Sat, Aug 04, 2007 at 08:31:54PM +0200, Jesper Juhl wrote: (first send: Monday 25 June 2007, resending due to no response) (resending again on August 8'th, 2007) In drivers/isdn/capi/kcapi.c::old_capi_manufacturer(), if the call to get_capi_ctr_by_nr(ldef.contr); in line 823 returns NULL, then we'll be dereferencing a NULL pointer in the very next line. (Found by Coverity checker as bug #402) Signed-off-by: Jesper Juhl [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/capi/kcapi.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/isdn/capi/kcapi.c b/drivers/isdn/capi/kcapi.c index 3ed34f7..3f9e962 100644 --- a/drivers/isdn/capi/kcapi.c +++ b/drivers/isdn/capi/kcapi.c @@ -821,6 +821,8 @@ static int old_capi_manufacturer(unsigned int cmd, void __user *data) return -EFAULT; } card = get_capi_ctr_by_nr(ldef.contr); + if (!card) + return -EINVAL; card = capi_ctr_get(card); if (!card) return -ESRCH; - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/5] Use mutex instead of semaphore in ISDN subsystem common functions
On Sun, Jul 29, 2007 at 11:41:05PM +0200, Matthias Kaehlcke wrote: > The ISDN subsystem common functions use a semaphore as mutex. Use the > mutex API instead of the (binary) semaphore. > > Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]> > Acked-by: Karsten Keil <[EMAIL PROTECTED]> -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/5] Use mutex instead of semaphore in ISDN subsystem common functions
On Sun, Jul 29, 2007 at 11:41:05PM +0200, Matthias Kaehlcke wrote: The ISDN subsystem common functions use a semaphore as mutex. Use the mutex API instead of the (binary) semaphore. Signed-off-by: Matthias Kaehlcke [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [KJ] Re: [PATCH] drivers/isdn/hisax: ARRAY_SIZE instead of sizeof
On Mon, Jun 11, 2007 at 10:25:31PM +1000, Darren Jenkins wrote: > G'day Andi, > > On 6/11/07, Andi Drebes <[EMAIL PROTECTED]> wrote: > > >> I'd suggest to not use another define, but use ARRAY_SIZE(foo) > >> _instead of_ eg. FNCOUNT. > >I thought of this, too, but I tried to keep things consistent. Let me > >explain that a little bit more in detail. If you have a look at the files > >in drivers/isdn/hisax then you will see that a lot of array size > >definitions > >are assigned to preprocessor macros. So I thought removing just one > >of the macros while the other continue to exist would make the code > >a little bit more inconsistent. However, one might disagree about that. > >So here's another patch that includes the changes from the original patch > >and removes the FNCOUNT preprocessor definition. Perhaps the original > >authors of the files should decide wether they want to keep it or not. > > I think what was meant here was to remove _all_ the macros that you > assigned to the ARRAY_SIZE() macro. > ... Agree, here is a new version. This patch replaces various array size calculations in drivers/isdn/hisax done using sizeof with the ARRAY_SIZE macro. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> Signed-off-by: Andi Drebes <[EMAIL PROTECTED]> --- drivers/isdn/hisax/callc.c |4 +-- drivers/isdn/hisax/isdnl1.c | 12 ++- drivers/isdn/hisax/isdnl2.c |4 +-- drivers/isdn/hisax/isdnl3.c |4 +-- drivers/isdn/hisax/l3_1tr6.c | 20 +++ drivers/isdn/hisax/l3dss1.c | 26 -- drivers/isdn/hisax/l3ni1.c | 24 - drivers/isdn/hisax/q931.c| 77 ++--- drivers/isdn/hisax/tei.c |4 +-- 9 files changed, 55 insertions(+), 120 deletions(-) diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c index 7c56c44..0b9ed8e 100644 --- a/drivers/isdn/hisax/callc.c +++ b/drivers/isdn/hisax/callc.c @@ -834,8 +834,6 @@ static struct FsmNode fnlist[] __initdata = }; /* *INDENT-ON* */ -#define FNCOUNT (sizeof(fnlist)/sizeof(struct FsmNode)) - int __init CallcNew(void) { @@ -843,7 +841,7 @@ CallcNew(void) callcfsm.event_count = EVENT_COUNT; callcfsm.strEvent = strEvent; callcfsm.strState = strState; - return FsmNew(, fnlist, FNCOUNT); + return FsmNew(, fnlist, ARRAY_SIZE(fnlist)); } void diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c index a14204e..80e923e 100644 --- a/drivers/isdn/hisax/isdnl1.c +++ b/drivers/isdn/hisax/isdnl1.c @@ -647,8 +647,6 @@ static struct FsmNode L1SFnList[] __initdata = {ST_L1_F8, EV_TIMER_DEACT, l1_timer_deact}, }; -#define L1S_FN_COUNT (sizeof(L1SFnList)/sizeof(struct FsmNode)) - #ifdef HISAX_UINTERFACE static void l1_deact_req_u(struct FsmInst *fi, int event, void *arg) @@ -706,8 +704,6 @@ static struct FsmNode L1UFnList[] __initdata = {ST_L1_RESET, EV_TIMER_DEACT, l1_timer_deact}, }; -#define L1U_FN_COUNT (sizeof(L1UFnList)/sizeof(struct FsmNode)) - #endif static void @@ -754,8 +750,6 @@ static struct FsmNode L1BFnList[] __initdata = {ST_L1_WAIT_DEACT, EV_TIMER_DEACT, l1b_timer_deact}, }; -#define L1B_FN_COUNT (sizeof(L1BFnList)/sizeof(struct FsmNode)) - int __init Isdnl1New(void) { @@ -765,7 +759,7 @@ Isdnl1New(void) l1fsm_s.event_count = L1_EVENT_COUNT; l1fsm_s.strEvent = strL1Event; l1fsm_s.strState = strL1SState; - retval = FsmNew(_s, L1SFnList, L1S_FN_COUNT); + retval = FsmNew(_s, L1SFnList, ARRAY_SIZE(L1SFnList)); if (retval) return retval; @@ -773,7 +767,7 @@ Isdnl1New(void) l1fsm_b.event_count = L1_EVENT_COUNT; l1fsm_b.strEvent = strL1Event; l1fsm_b.strState = strL1BState; - retval = FsmNew(_b, L1BFnList, L1B_FN_COUNT); + retval = FsmNew(_b, L1BFnList, ARRAY_SIZE(L1BFnList)); if (retval) { FsmFree(_s); return retval; @@ -783,7 +777,7 @@ Isdnl1New(void) l1fsm_u.event_count = L1_EVENT_COUNT; l1fsm_u.strEvent = strL1Event; l1fsm_u.strState = strL1UState; - retval = FsmNew(_u, L1UFnList, L1U_FN_COUNT); + retval = FsmNew(_u, L1UFnList, ARRAY_SIZE(L1UFnList)); if (retval) { FsmFree(_s); FsmFree(_b); diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c index 3446f24..7b9496a 100644 --- a/drivers/isdn/hisax/isdnl2.c +++ b/drivers/isdn/hisax/isdnl2.c @@ -1623,8 +1623,6 @@ static struct FsmNode L2FnList[] __initdata = {ST_L2_8, EV_L1_DEACTIVATE, l2_persistent_da}, }; -#define L2_FN_COUNT (sizeof(L2FnList)/sizeof(struct FsmNode)) - static void isdnl2_l1l2(struct PStack *st, int pr, void *arg) { @@ -1836,7 +1834,7 @@ Isdnl2New(void) l2fsm.event_count = L2_EVENT_COUNT; l2fsm.strEvent
Re: [KJ] Re: [PATCH] drivers/isdn/hisax: ARRAY_SIZE instead of sizeof
On Mon, Jun 11, 2007 at 10:25:31PM +1000, Darren Jenkins wrote: G'day Andi, On 6/11/07, Andi Drebes [EMAIL PROTECTED] wrote: I'd suggest to not use another define, but use ARRAY_SIZE(foo) _instead of_ eg. FNCOUNT. I thought of this, too, but I tried to keep things consistent. Let me explain that a little bit more in detail. If you have a look at the files in drivers/isdn/hisax then you will see that a lot of array size definitions are assigned to preprocessor macros. So I thought removing just one of the macros while the other continue to exist would make the code a little bit more inconsistent. However, one might disagree about that. So here's another patch that includes the changes from the original patch and removes the FNCOUNT preprocessor definition. Perhaps the original authors of the files should decide wether they want to keep it or not. I think what was meant here was to remove _all_ the macros that you assigned to the ARRAY_SIZE() macro. ... Agree, here is a new version. This patch replaces various array size calculations in drivers/isdn/hisax done using sizeof with the ARRAY_SIZE macro. Signed-off-by: Karsten Keil [EMAIL PROTECTED] Signed-off-by: Andi Drebes [EMAIL PROTECTED] --- drivers/isdn/hisax/callc.c |4 +-- drivers/isdn/hisax/isdnl1.c | 12 ++- drivers/isdn/hisax/isdnl2.c |4 +-- drivers/isdn/hisax/isdnl3.c |4 +-- drivers/isdn/hisax/l3_1tr6.c | 20 +++ drivers/isdn/hisax/l3dss1.c | 26 -- drivers/isdn/hisax/l3ni1.c | 24 - drivers/isdn/hisax/q931.c| 77 ++--- drivers/isdn/hisax/tei.c |4 +-- 9 files changed, 55 insertions(+), 120 deletions(-) diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c index 7c56c44..0b9ed8e 100644 --- a/drivers/isdn/hisax/callc.c +++ b/drivers/isdn/hisax/callc.c @@ -834,8 +834,6 @@ static struct FsmNode fnlist[] __initdata = }; /* *INDENT-ON* */ -#define FNCOUNT (sizeof(fnlist)/sizeof(struct FsmNode)) - int __init CallcNew(void) { @@ -843,7 +841,7 @@ CallcNew(void) callcfsm.event_count = EVENT_COUNT; callcfsm.strEvent = strEvent; callcfsm.strState = strState; - return FsmNew(callcfsm, fnlist, FNCOUNT); + return FsmNew(callcfsm, fnlist, ARRAY_SIZE(fnlist)); } void diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c index a14204e..80e923e 100644 --- a/drivers/isdn/hisax/isdnl1.c +++ b/drivers/isdn/hisax/isdnl1.c @@ -647,8 +647,6 @@ static struct FsmNode L1SFnList[] __initdata = {ST_L1_F8, EV_TIMER_DEACT, l1_timer_deact}, }; -#define L1S_FN_COUNT (sizeof(L1SFnList)/sizeof(struct FsmNode)) - #ifdef HISAX_UINTERFACE static void l1_deact_req_u(struct FsmInst *fi, int event, void *arg) @@ -706,8 +704,6 @@ static struct FsmNode L1UFnList[] __initdata = {ST_L1_RESET, EV_TIMER_DEACT, l1_timer_deact}, }; -#define L1U_FN_COUNT (sizeof(L1UFnList)/sizeof(struct FsmNode)) - #endif static void @@ -754,8 +750,6 @@ static struct FsmNode L1BFnList[] __initdata = {ST_L1_WAIT_DEACT, EV_TIMER_DEACT, l1b_timer_deact}, }; -#define L1B_FN_COUNT (sizeof(L1BFnList)/sizeof(struct FsmNode)) - int __init Isdnl1New(void) { @@ -765,7 +759,7 @@ Isdnl1New(void) l1fsm_s.event_count = L1_EVENT_COUNT; l1fsm_s.strEvent = strL1Event; l1fsm_s.strState = strL1SState; - retval = FsmNew(l1fsm_s, L1SFnList, L1S_FN_COUNT); + retval = FsmNew(l1fsm_s, L1SFnList, ARRAY_SIZE(L1SFnList)); if (retval) return retval; @@ -773,7 +767,7 @@ Isdnl1New(void) l1fsm_b.event_count = L1_EVENT_COUNT; l1fsm_b.strEvent = strL1Event; l1fsm_b.strState = strL1BState; - retval = FsmNew(l1fsm_b, L1BFnList, L1B_FN_COUNT); + retval = FsmNew(l1fsm_b, L1BFnList, ARRAY_SIZE(L1BFnList)); if (retval) { FsmFree(l1fsm_s); return retval; @@ -783,7 +777,7 @@ Isdnl1New(void) l1fsm_u.event_count = L1_EVENT_COUNT; l1fsm_u.strEvent = strL1Event; l1fsm_u.strState = strL1UState; - retval = FsmNew(l1fsm_u, L1UFnList, L1U_FN_COUNT); + retval = FsmNew(l1fsm_u, L1UFnList, ARRAY_SIZE(L1UFnList)); if (retval) { FsmFree(l1fsm_s); FsmFree(l1fsm_b); diff --git a/drivers/isdn/hisax/isdnl2.c b/drivers/isdn/hisax/isdnl2.c index 3446f24..7b9496a 100644 --- a/drivers/isdn/hisax/isdnl2.c +++ b/drivers/isdn/hisax/isdnl2.c @@ -1623,8 +1623,6 @@ static struct FsmNode L2FnList[] __initdata = {ST_L2_8, EV_L1_DEACTIVATE, l2_persistent_da}, }; -#define L2_FN_COUNT (sizeof(L2FnList)/sizeof(struct FsmNode)) - static void isdnl2_l1l2(struct PStack *st, int pr, void *arg) { @@ -1836,7 +1834,7 @@ Isdnl2New(void) l2fsm.event_count = L2_EVENT_COUNT; l2fsm.strEvent = strL2Event; l2fsm.strState = strL2State; - return FsmNew(l2fsm, L2FnList, L2_FN_COUNT
Re: [PATCH] drivers/isdn/hisax: ARRAY_SIZE instead of sizeof
st_ni1_cs5)/sizeof(struct > InformationElement) > +#define IESIZE_NI1_CS5 ARRAY_SIZE(ielist_ni1_cs5) > > static > struct InformationElement ielist_ni1_cs6[] = { > { 0x7b, "Call appearance", general_ni1 }, > }; > > -#define IESIZE_NI1_CS6 sizeof(ielist_ni1_cs6)/sizeof(struct > InformationElement) > +#define IESIZE_NI1_CS6 ARRAY_SIZE(ielist_ni1_cs6) > > static struct InformationElement we_0[] = > { > @@ -1133,7 +1133,7 @@ static struct InformationElement we_0[] = > {WE0_userInfo, "User Info", general} > }; > > -#define WE_0_LEN (sizeof(we_0) / sizeof(struct InformationElement)) > +#define WE_0_LEN ARRAY_SIZE(we_0) > > static struct InformationElement we_6[] = > { > @@ -1145,7 +1145,7 @@ static struct InformationElement we_6[] = > {WE6_statusCalled, "Status Called", general}, > {WE6_addTransAttr, "Additional Transmission Attributes", general} > }; > -#define WE_6_LEN (sizeof(we_6) / sizeof(struct InformationElement)) > +#define WE_6_LEN ARRAY_SIZE(we_6) > > int > QuickHex(char *txt, u_char * p, int cnt) > diff --git a/drivers/isdn/hisax/tei.c b/drivers/isdn/hisax/tei.c > index ceb0df9..21567af 100644 > --- a/drivers/isdn/hisax/tei.c > +++ b/drivers/isdn/hisax/tei.c > @@ -447,7 +447,7 @@ static struct FsmNode TeiFnList[] __initdata = > {ST_TEI_IDVERIFY, EV_CHKREQ, tei_id_chk_req}, > }; > > -#define TEI_FN_COUNT (sizeof(TeiFnList)/sizeof(struct FsmNode)) > +#define TEI_FN_COUNT ARRAY_SIZE(TeiFnList) > > int __init > TeiNew(void) -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] drivers/isdn/hisax: ARRAY_SIZE instead of sizeof
[] __initdata = {ST_TEI_IDVERIFY, EV_CHKREQ, tei_id_chk_req}, }; -#define TEI_FN_COUNT (sizeof(TeiFnList)/sizeof(struct FsmNode)) +#define TEI_FN_COUNT ARRAY_SIZE(TeiFnList) int __init TeiNew(void) -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 02/06] Use menuconfig objects 4 - ISDN part 2/6 (CONFIG_ISDN_I4L)
On Thu, May 31, 2007 at 06:16:52PM +0200, Tilman Schmidt wrote: > Am 30.05.2007 21:38 schrieb Jan Engelhardt: > > --- linux-2.6.22-rc3-git1.orig/drivers/isdn/Kconfig > > +++ linux-2.6.22-rc3-git1/drivers/isdn/Kconfig > > @@ -21,9 +21,7 @@ menuconfig ISDN > > > > if ISDN > > > > -menu "Old ISDN4Linux" > > - > > -config ISDN_I4L > > +menuconfig ISDN_I4L > > tristate "Old ISDN4Linux (obsolete)" > > ---help--- > > This driver allows you to use an ISDN-card for networking > > @@ -44,8 +42,6 @@ if ISDN_I4L > > source "drivers/isdn/i4l/Kconfig" > > endif > > > > -endmenu > > - > > comment "CAPI subsystem" > > > > This results in a rather strange and inconsistent presentation in > "make xconfig", with ISDN4Linux appearing as a subtree in the left > pane but CAPI only visible in the right pane after selecting ISDN. > IMHO it looks much saner like this: > > --- a/drivers/isdn/Kconfig > +++ b/drivers/isdn/Kconfig > @@ -21,8 +21,6 @@ menuconfig ISDN > > if ISDN > > -menu "Old ISDN4Linux" > - > config ISDN_I4L > tristate "Old ISDN4Linux (deprecated)" > ---help--- > @@ -44,12 +42,8 @@ if ISDN_I4L > source "drivers/isdn/i4l/Kconfig" > endif > > -endmenu > - > -comment "CAPI subsystem" > - > config ISDN_CAPI > - tristate "CAPI2.0 support" > + tristate "CAPI 2.0 subsystem" > help > This provides the CAPI (Common ISDN Application Programming > Interface, a standard making it easy for programs to access ISDN > > This gives you a single entry in the left pane tree for disabling > all of ISDN with a single click, and nicely presents all of its > suboptions in the right pane once you select the tree entry. > I agree. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 02/06] Use menuconfig objects 4 - ISDN part 2/6 (CONFIG_ISDN_I4L)
On Thu, May 31, 2007 at 06:16:52PM +0200, Tilman Schmidt wrote: Am 30.05.2007 21:38 schrieb Jan Engelhardt: --- linux-2.6.22-rc3-git1.orig/drivers/isdn/Kconfig +++ linux-2.6.22-rc3-git1/drivers/isdn/Kconfig @@ -21,9 +21,7 @@ menuconfig ISDN if ISDN -menu Old ISDN4Linux - -config ISDN_I4L +menuconfig ISDN_I4L tristate Old ISDN4Linux (obsolete) ---help--- This driver allows you to use an ISDN-card for networking @@ -44,8 +42,6 @@ if ISDN_I4L source drivers/isdn/i4l/Kconfig endif -endmenu - comment CAPI subsystem This results in a rather strange and inconsistent presentation in make xconfig, with ISDN4Linux appearing as a subtree in the left pane but CAPI only visible in the right pane after selecting ISDN. IMHO it looks much saner like this: --- a/drivers/isdn/Kconfig +++ b/drivers/isdn/Kconfig @@ -21,8 +21,6 @@ menuconfig ISDN if ISDN -menu Old ISDN4Linux - config ISDN_I4L tristate Old ISDN4Linux (deprecated) ---help--- @@ -44,12 +42,8 @@ if ISDN_I4L source drivers/isdn/i4l/Kconfig endif -endmenu - -comment CAPI subsystem - config ISDN_CAPI - tristate CAPI2.0 support + tristate CAPI 2.0 subsystem help This provides the CAPI (Common ISDN Application Programming Interface, a standard making it easy for programs to access ISDN This gives you a single entry in the left pane tree for disabling all of ISDN with a single click, and nicely presents all of its suboptions in the right pane once you select the tree entry. I agree. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Fix broken CLIR in isdn driver
I noticed that CLIR (aka "hide your calling number") in isdn_tty is broken: The at-command parser filters out the required "R" (e.g. ATDR089123456) It's been broken for a *very* long time. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> Signed-off-by: Matthias Goebl <[EMAIL PROTECTED]> --- drivers/isdn/i4l/isdn_tty.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index ea5f30d..4e5f87c 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -2693,8 +2693,9 @@ isdn_tty_getdial(char *p, char *q,int cnt) int limit = ISDN_MSNLEN - 1;/* MUST match the size of interface var to avoid buffer overflow */ - while (strchr(" 0123456789,#.*WPTS-", *p) && *p && --cnt>0) { + while (strchr(" 0123456789,#.*WPTSR-", *p) && *p && --cnt>0) { if ((*p >= '0' && *p <= '9') || ((*p == 'S') && first) || + ((*p == 'R') && first) || (*p == '*') || (*p == '#')) { *q++ = *p; limit--; -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Fix broken CLIR in isdn driver
I noticed that CLIR (aka hide your calling number) in isdn_tty is broken: The at-command parser filters out the required R (e.g. ATDR089123456) It's been broken for a *very* long time. Signed-off-by: Karsten Keil [EMAIL PROTECTED] Signed-off-by: Matthias Goebl [EMAIL PROTECTED] --- drivers/isdn/i4l/isdn_tty.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index ea5f30d..4e5f87c 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -2693,8 +2693,9 @@ isdn_tty_getdial(char *p, char *q,int cnt) int limit = ISDN_MSNLEN - 1;/* MUST match the size of interface var to avoid buffer overflow */ - while (strchr( 0123456789,#.*WPTS-, *p) *p --cnt0) { + while (strchr( 0123456789,#.*WPTSR-, *p) *p --cnt0) { if ((*p = '0' *p = '9') || ((*p == 'S') first) || + ((*p == 'R') first) || (*p == '*') || (*p == '#')) { *q++ = *p; limit--; -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] Update isdn tree to use pci_get_device
Replacing pci_find_device with pci_get_device in the drivers/isdn subtree. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> Signed-off-by: Surya Prabhakar <[EMAIL PROTECTED]> --- drivers/isdn/hisax/avm_pci.c | 19 ++ drivers/isdn/hisax/bkm_a4t.c | 15 +--- drivers/isdn/hisax/bkm_a8.c | 28 +-- drivers/isdn/hisax/diva.c | 69 +++-- drivers/isdn/hisax/elsa.c | 54 - drivers/isdn/hisax/enternow_pci.c | 20 ++- drivers/isdn/hisax/gazel.c| 13 +-- drivers/isdn/hisax/hfc_pci.c | 14 +--- drivers/isdn/hisax/niccy.c| 22 drivers/isdn/hisax/nj_s.c | 17 ++--- drivers/isdn/hisax/nj_u.c | 18 ++ drivers/isdn/hisax/sedlbauer.c| 27 +- drivers/isdn/hisax/telespci.c | 14 +--- drivers/isdn/hisax/w6692.c| 14 +--- drivers/isdn/hysdn/hysdn_init.c |4 ++ 15 files changed, 211 insertions(+), 137 deletions(-) 0ed0d964e9948d56d1e6550b489a6644e7218108 diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index b04a178..29f4802 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -789,19 +789,19 @@ setup_avm_pcipnp(struct IsdnCard *card) } #endif #ifdef CONFIG_PCI - if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM, + if ((dev_avm = pci_get_device(PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, dev_avm))) { if (pci_enable_device(dev_avm)) - return(0); + goto dev_avm_cleanup; cs->irq = dev_avm->irq; if (!cs->irq) { printk(KERN_ERR "FritzPCI: No IRQ for PCI card found\n"); - return(0); + goto dev_avm_cleanup; } cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1); if (!cs->hw.avm.cfg_reg) { printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n"); - return(0); + goto dev_avm_cleanup; } cs->subtyp = AVM_FRITZ_PCI; } else { @@ -822,7 +822,7 @@ ready: CardType[card->typ], cs->hw.avm.cfg_reg, cs->hw.avm.cfg_reg + 31); - return (0); + goto dev_avm_cleanup; } switch (cs->subtyp) { case AVM_FRITZ_PCI: @@ -841,8 +841,8 @@ ready: cs->BC_Write_Reg = break; default: - printk(KERN_WARNING "AVM unknown subtype %d\n", cs->subtyp); - return(0); + printk(KERN_WARNING "AVM unknown subtype %d\n", cs->subtyp); + goto dev_avm_cleanup; } printk(KERN_INFO "HiSax: %s config irq:%d base:0x%X\n", (cs->subtyp == AVM_FRITZ_PCI) ? "AVM Fritz!PCI" : "AVM Fritz!PnP", @@ -858,5 +858,10 @@ ready: cs->irq_func = _pcipnp_interrupt; cs->writeisac(cs, ISAC_MASK, 0xFF); ISACVersion(cs, (cs->subtyp == AVM_FRITZ_PCI) ? "AVM PCI:" : "AVM PnP:"); + pci_dev_put(dev_avm); return (1); + +dev_avm_cleanup: + pci_dev_put(dev_avm); + return 0; } diff --git a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c index 871310d..7b3b849 100644 --- a/drivers/isdn/hisax/bkm_a4t.c +++ b/drivers/isdn/hisax/bkm_a4t.c @@ -275,7 +275,7 @@ setup_bkm_a4t(struct IsdnCard *card) return (0); #ifdef CONFIG_PCI - while ((dev_a4t = pci_find_device(PCI_VENDOR_ID_ZORAN, + while ((dev_a4t = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_a4t))) { u16 sub_sys; u16 sub_vendor; @@ -284,7 +284,7 @@ setup_bkm_a4t(struct IsdnCard *card) sub_sys = dev_a4t->subsystem_device; if ((sub_sys == PCI_DEVICE_ID_BERKOM_A4T) && (sub_vendor == PCI_VENDOR_ID_BERKOM)) { if (pci_enable_device(dev_a4t)) - return(0); + goto dev_a4t_cleanup; found = 1; pci_memaddr = pci_resource_start(dev_a4t, 0); cs->irq = dev_a4t->irq; @@ -297,11 +297,11 @@ setup_bkm_a4t(struct IsdnCard *card) } if (!cs->irq) { /* IRQ range check ?? */ printk(KERN_WARNING "HiSax: %s: No IRQ\n", CardType[card->typ]); - return (0); + goto dev_a4t_cleanup; } if (!pci_memaddr) { printk(KERN_WARNING "HiSax: %s: No Memory b
[PATCH] Update isdn tree to use pci_get_device
Replacing pci_find_device with pci_get_device in the drivers/isdn subtree. Signed-off-by: Karsten Keil [EMAIL PROTECTED] Signed-off-by: Surya Prabhakar [EMAIL PROTECTED] --- drivers/isdn/hisax/avm_pci.c | 19 ++ drivers/isdn/hisax/bkm_a4t.c | 15 +--- drivers/isdn/hisax/bkm_a8.c | 28 +-- drivers/isdn/hisax/diva.c | 69 +++-- drivers/isdn/hisax/elsa.c | 54 - drivers/isdn/hisax/enternow_pci.c | 20 ++- drivers/isdn/hisax/gazel.c| 13 +-- drivers/isdn/hisax/hfc_pci.c | 14 +--- drivers/isdn/hisax/niccy.c| 22 drivers/isdn/hisax/nj_s.c | 17 ++--- drivers/isdn/hisax/nj_u.c | 18 ++ drivers/isdn/hisax/sedlbauer.c| 27 +- drivers/isdn/hisax/telespci.c | 14 +--- drivers/isdn/hisax/w6692.c| 14 +--- drivers/isdn/hysdn/hysdn_init.c |4 ++ 15 files changed, 211 insertions(+), 137 deletions(-) 0ed0d964e9948d56d1e6550b489a6644e7218108 diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index b04a178..29f4802 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -789,19 +789,19 @@ setup_avm_pcipnp(struct IsdnCard *card) } #endif #ifdef CONFIG_PCI - if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM, + if ((dev_avm = pci_get_device(PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, dev_avm))) { if (pci_enable_device(dev_avm)) - return(0); + goto dev_avm_cleanup; cs-irq = dev_avm-irq; if (!cs-irq) { printk(KERN_ERR FritzPCI: No IRQ for PCI card found\n); - return(0); + goto dev_avm_cleanup; } cs-hw.avm.cfg_reg = pci_resource_start(dev_avm, 1); if (!cs-hw.avm.cfg_reg) { printk(KERN_ERR FritzPCI: No IO-Adr for PCI card found\n); - return(0); + goto dev_avm_cleanup; } cs-subtyp = AVM_FRITZ_PCI; } else { @@ -822,7 +822,7 @@ ready: CardType[card-typ], cs-hw.avm.cfg_reg, cs-hw.avm.cfg_reg + 31); - return (0); + goto dev_avm_cleanup; } switch (cs-subtyp) { case AVM_FRITZ_PCI: @@ -841,8 +841,8 @@ ready: cs-BC_Write_Reg = WriteHDLCPnP; break; default: - printk(KERN_WARNING AVM unknown subtype %d\n, cs-subtyp); - return(0); + printk(KERN_WARNING AVM unknown subtype %d\n, cs-subtyp); + goto dev_avm_cleanup; } printk(KERN_INFO HiSax: %s config irq:%d base:0x%X\n, (cs-subtyp == AVM_FRITZ_PCI) ? AVM Fritz!PCI : AVM Fritz!PnP, @@ -858,5 +858,10 @@ ready: cs-irq_func = avm_pcipnp_interrupt; cs-writeisac(cs, ISAC_MASK, 0xFF); ISACVersion(cs, (cs-subtyp == AVM_FRITZ_PCI) ? AVM PCI: : AVM PnP:); + pci_dev_put(dev_avm); return (1); + +dev_avm_cleanup: + pci_dev_put(dev_avm); + return 0; } diff --git a/drivers/isdn/hisax/bkm_a4t.c b/drivers/isdn/hisax/bkm_a4t.c index 871310d..7b3b849 100644 --- a/drivers/isdn/hisax/bkm_a4t.c +++ b/drivers/isdn/hisax/bkm_a4t.c @@ -275,7 +275,7 @@ setup_bkm_a4t(struct IsdnCard *card) return (0); #ifdef CONFIG_PCI - while ((dev_a4t = pci_find_device(PCI_VENDOR_ID_ZORAN, + while ((dev_a4t = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_a4t))) { u16 sub_sys; u16 sub_vendor; @@ -284,7 +284,7 @@ setup_bkm_a4t(struct IsdnCard *card) sub_sys = dev_a4t-subsystem_device; if ((sub_sys == PCI_DEVICE_ID_BERKOM_A4T) (sub_vendor == PCI_VENDOR_ID_BERKOM)) { if (pci_enable_device(dev_a4t)) - return(0); + goto dev_a4t_cleanup; found = 1; pci_memaddr = pci_resource_start(dev_a4t, 0); cs-irq = dev_a4t-irq; @@ -297,11 +297,11 @@ setup_bkm_a4t(struct IsdnCard *card) } if (!cs-irq) { /* IRQ range check ?? */ printk(KERN_WARNING HiSax: %s: No IRQ\n, CardType[card-typ]); - return (0); + goto dev_a4t_cleanup; } if (!pci_memaddr) { printk(KERN_WARNING HiSax: %s: No Memory base address\n, CardType[card-typ]); - return (0); + goto dev_a4t_cleanup; } cs-hw.ax.base = (long) ioremap(pci_memaddr, 4096); /* Check suspecious address */ @@ -311,7 +311,7
Re: [PATCH] ISDN: move card state init to separate function
On Tue, May 22, 2007 at 12:46:16PM -0400, Jeff Garzik wrote: > Karsten Keil wrote: > >So what is the reason to do this now, does this block some changes in > >other places ? I did not change this code for long time because I know > >that this is a nightmare, the code was grown and grown (supporting more and > >more cards/chipsets) and is really nothing which should be used in future. > >So I would say it maybe better, if it doesn't block anything else, to > >replace HiSax completely with a new modular design. I know that here was > >not > >so much effort in the past years, but now I got some time to push mISDN > >forward and it looks not so bad to get the first parts ready for mainline > >in June. > > ISDN is the biggest chunk of code blocking removal of some deprecated > PCI interfaces. > OK then this should be done of course, since I fear that we will not move all supported cards (since they are not longer sold) to the new driver. > If you want to replace the code completely with a newfangled modular > design, I will gladly step out of the way and let that happen :) I only > know what I see right now, which is code that has sat around for a while > not getting updated to the new PCI API. > > Since I do not have any ISDN hardware, my plan was to do equivalent > transformations of the code. Each patch just shuffles code, but > maintains a working state at all time, making it trivial to prove > (mathematically, or with testing, or with git-bisect) that the code > continues to work. So maybe it could be a good start point to do the transition for one card first, maybe nj_s.c is OK to start. > > So, just tell me which you would prefer. If you are going to fix all > this stuff, there is plenty of other stuff on my list to work on. > Otherwise I will create equivalent-transform patches that take the > existing code and modify it just enough to be correct for the new PCI API. > If you do that for one card, I will test it and change the rest. Thanks for your help. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ISDN: move card state init to separate function
Hello Jeff, thank you for this effort. On Tue, May 22, 2007 at 08:44:58AM -0400, Jeff Garzik wrote: > > The follow is the first baby step towards moving the HiSax drivers to > the new PCI API. The HiSax PCI initialization code is ass-backwards and > an incredible pain, so this will take many steps. If anybody is > motivated to assist, help is more than welcome! > So what is the reason to do this now, does this block some changes in other places ? I did not change this code for long time because I know that this is a nightmare, the code was grown and grown (supporting more and more cards/chipsets) and is really nothing which should be used in future. So I would say it maybe better, if it doesn't block anything else, to replace HiSax completely with a new modular design. I know that here was not so much effort in the past years, but now I got some time to push mISDN forward and it looks not so bad to get the first parts ready for mainline in June. Neverless, if you still think that we should get rid of the old HiSax code, I'll help as much as I can, I still have most of the cards available in my lab, so I can also test all changes. > The first step just moves some code into a separate function, with the > general direction being the isolation of card-generic code away from all > the heavily #ifdef'd card-specific code. > > This patch should not change any behavior at all. It only includes very > trivial code modifications, like s/kmalloc/kzalloc/, use of gfp_mask, > and the allocation of cs->rcvbuf was moved up to be with the rest of the > memory allocations. > > Further changes will be checked into this git branch: > > The 'isdn-pci' branch of > git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6.git > ... -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ISDN: move card state init to separate function
On Tue, May 22, 2007 at 12:46:16PM -0400, Jeff Garzik wrote: Karsten Keil wrote: So what is the reason to do this now, does this block some changes in other places ? I did not change this code for long time because I know that this is a nightmare, the code was grown and grown (supporting more and more cards/chipsets) and is really nothing which should be used in future. So I would say it maybe better, if it doesn't block anything else, to replace HiSax completely with a new modular design. I know that here was not so much effort in the past years, but now I got some time to push mISDN forward and it looks not so bad to get the first parts ready for mainline in June. ISDN is the biggest chunk of code blocking removal of some deprecated PCI interfaces. OK then this should be done of course, since I fear that we will not move all supported cards (since they are not longer sold) to the new driver. If you want to replace the code completely with a newfangled modular design, I will gladly step out of the way and let that happen :) I only know what I see right now, which is code that has sat around for a while not getting updated to the new PCI API. Since I do not have any ISDN hardware, my plan was to do equivalent transformations of the code. Each patch just shuffles code, but maintains a working state at all time, making it trivial to prove (mathematically, or with testing, or with git-bisect) that the code continues to work. So maybe it could be a good start point to do the transition for one card first, maybe nj_s.c is OK to start. So, just tell me which you would prefer. If you are going to fix all this stuff, there is plenty of other stuff on my list to work on. Otherwise I will create equivalent-transform patches that take the existing code and modify it just enough to be correct for the new PCI API. If you do that for one card, I will test it and change the rest. Thanks for your help. -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ISDN: move card state init to separate function
Hello Jeff, thank you for this effort. On Tue, May 22, 2007 at 08:44:58AM -0400, Jeff Garzik wrote: The follow is the first baby step towards moving the HiSax drivers to the new PCI API. The HiSax PCI initialization code is ass-backwards and an incredible pain, so this will take many steps. If anybody is motivated to assist, help is more than welcome! So what is the reason to do this now, does this block some changes in other places ? I did not change this code for long time because I know that this is a nightmare, the code was grown and grown (supporting more and more cards/chipsets) and is really nothing which should be used in future. So I would say it maybe better, if it doesn't block anything else, to replace HiSax completely with a new modular design. I know that here was not so much effort in the past years, but now I got some time to push mISDN forward and it looks not so bad to get the first parts ready for mainline in June. Neverless, if you still think that we should get rid of the old HiSax code, I'll help as much as I can, I still have most of the cards available in my lab, so I can also test all changes. The first step just moves some code into a separate function, with the general direction being the isolation of card-generic code away from all the heavily #ifdef'd card-specific code. This patch should not change any behavior at all. It only includes very trivial code modifications, like s/kmalloc/kzalloc/, use of gfp_mask, and the allocation of cs-rcvbuf was moved up to be with the rest of the memory allocations. Further changes will be checked into this git branch: The 'isdn-pci' branch of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6.git ... -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 7/15] Make ISDN CAPI use seq_list_xxx helpers
The similar code exists here and is called capi_driver_get_idx(). Use generic helpers now and remember to convert list_head to struct capi_driver in .show callback. Acked-by: Karsten Keil <[EMAIL PROTECTED]> Signed-off-by: Pavel Emelianov <[EMAIL PROTECTED]> --- diff --git a/drivers/isdn/capi/kcapi_proc.c b/drivers/isdn/capi/kcapi_proc.c index 31f4fd8..845a797 100644 --- a/drivers/isdn/capi/kcapi_proc.c +++ b/drivers/isdn/capi/kcapi_proc.c @@ -243,36 +243,15 @@ create_seq_entry(char *name, mode_t mode // --- - -static __inline__ struct capi_driver *capi_driver_get_idx(loff_t pos) -{ - struct capi_driver *drv = NULL; - struct list_head *l; - loff_t i; - - i = 0; - list_for_each(l, _drivers) { - drv = list_entry(l, struct capi_driver, list); - if (i++ == pos) - return drv; - } - return NULL; -} - static void *capi_driver_start(struct seq_file *seq, loff_t *pos) { - struct capi_driver *drv; read_lock(_drivers_list_lock); - drv = capi_driver_get_idx(*pos); - return drv; + return seq_list_start(_drivers, *pos); } static void *capi_driver_next(struct seq_file *seq, void *v, loff_t *pos) { - struct capi_driver *drv = (struct capi_driver *)v; - ++*pos; - if (drv->list.next == _drivers) return NULL; - return list_entry(drv->list.next, struct capi_driver, list); + return seq_list_next(v, _drivers, pos); } static void capi_driver_stop(struct seq_file *seq, void *v) @@ -282,7 +261,8 @@ static void capi_driver_stop(struct seq_ static int capi_driver_show(struct seq_file *seq, void *v) { - struct capi_driver *drv = (struct capi_driver *)v; + struct capi_driver *drv = list_entry(v, struct capi_driver, list); + seq_printf(seq, "%-32s %s\n", drv->name, drv->revision); return 0; } -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 7/15] Make ISDN CAPI use seq_list_xxx helpers
The similar code exists here and is called capi_driver_get_idx(). Use generic helpers now and remember to convert list_head to struct capi_driver in .show callback. Acked-by: Karsten Keil [EMAIL PROTECTED] Signed-off-by: Pavel Emelianov [EMAIL PROTECTED] --- diff --git a/drivers/isdn/capi/kcapi_proc.c b/drivers/isdn/capi/kcapi_proc.c index 31f4fd8..845a797 100644 --- a/drivers/isdn/capi/kcapi_proc.c +++ b/drivers/isdn/capi/kcapi_proc.c @@ -243,36 +243,15 @@ create_seq_entry(char *name, mode_t mode // --- - -static __inline__ struct capi_driver *capi_driver_get_idx(loff_t pos) -{ - struct capi_driver *drv = NULL; - struct list_head *l; - loff_t i; - - i = 0; - list_for_each(l, capi_drivers) { - drv = list_entry(l, struct capi_driver, list); - if (i++ == pos) - return drv; - } - return NULL; -} - static void *capi_driver_start(struct seq_file *seq, loff_t *pos) { - struct capi_driver *drv; read_lock(capi_drivers_list_lock); - drv = capi_driver_get_idx(*pos); - return drv; + return seq_list_start(capi_drivers, *pos); } static void *capi_driver_next(struct seq_file *seq, void *v, loff_t *pos) { - struct capi_driver *drv = (struct capi_driver *)v; - ++*pos; - if (drv-list.next == capi_drivers) return NULL; - return list_entry(drv-list.next, struct capi_driver, list); + return seq_list_next(v, capi_drivers, pos); } static void capi_driver_stop(struct seq_file *seq, void *v) @@ -282,7 +261,8 @@ static void capi_driver_stop(struct seq_ static int capi_driver_show(struct seq_file *seq, void *v) { - struct capi_driver *drv = (struct capi_driver *)v; + struct capi_driver *drv = list_entry(v, struct capi_driver, list); + seq_printf(seq, %-32s %s\n, drv-name, drv-revision); return 0; } -- Karsten Keil SuSE Labs ISDN and VOIP development SUSE LINUX Products GmbH, Maxfeldstr.5 90409 Nuernberg, GF: Markus Rex, HRB 16746 (AG Nuernberg) - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2.6.20-rc5] isdn/capi: use ARRAY_SIZE when appropriate
On Tue, Jan 16, 2007 at 11:53:19AM +0200, Ahmed S. Darwish wrote: > Hi all, > > A trivial patch to use ARRAY_SIZE macro defined in kernel.h instead > of reimplementing it. > > Signed-off-by: Ahmed S. Darwish <[EMAIL PROTECTED]> Acked-by: Karsten Keil <[EMAIL PROTECTED]> > --- > > capi.c|4 ++-- > capidrv.c |4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c > index d22c022..3804591 100644 > --- a/drivers/isdn/capi/capi.c > +++ b/drivers/isdn/capi/capi.c > @@ -1456,7 +1456,7 @@ static struct procfsentries { > > static void __init proc_init(void) > { > -int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); > +int nelem = ARRAY_SIZE(procfsentries); > int i; > > for (i=0; i < nelem; i++) { > @@ -1468,7 +1468,7 @@ static void __init proc_init(void) > > static void __exit proc_exit(void) > { > -int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); > +int nelem = ARRAY_SIZE(procfsentries); > int i; > > for (i=nelem-1; i >= 0; i--) { > diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c > index c4d438c..8cec9c3 100644 > --- a/drivers/isdn/capi/capidrv.c > +++ b/drivers/isdn/capi/capidrv.c > @@ -2218,7 +2218,7 @@ static struct procfsentries { > > static void __init proc_init(void) > { > -int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); > +int nelem = ARRAY_SIZE(procfsentries); > int i; > > for (i=0; i < nelem; i++) { > @@ -2230,7 +2230,7 @@ static void __init proc_init(void) > > static void __exit proc_exit(void) > { > -int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); > +int nelem = ARRAY_SIZE(procfsentries); > int i; > > for (i=nelem-1; i >= 0; i--) { > > -- > Ahmed S. Darwish > http://darwish-07.blogspot.com -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 2.6.20-rc5] isdn/capi: use ARRAY_SIZE when appropriate
On Tue, Jan 16, 2007 at 11:53:19AM +0200, Ahmed S. Darwish wrote: Hi all, A trivial patch to use ARRAY_SIZE macro defined in kernel.h instead of reimplementing it. Signed-off-by: Ahmed S. Darwish [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] --- capi.c|4 ++-- capidrv.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index d22c022..3804591 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -1456,7 +1456,7 @@ static struct procfsentries { static void __init proc_init(void) { -int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); +int nelem = ARRAY_SIZE(procfsentries); int i; for (i=0; i nelem; i++) { @@ -1468,7 +1468,7 @@ static void __init proc_init(void) static void __exit proc_exit(void) { -int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); +int nelem = ARRAY_SIZE(procfsentries); int i; for (i=nelem-1; i = 0; i--) { diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index c4d438c..8cec9c3 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c @@ -2218,7 +2218,7 @@ static struct procfsentries { static void __init proc_init(void) { -int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); +int nelem = ARRAY_SIZE(procfsentries); int i; for (i=0; i nelem; i++) { @@ -2230,7 +2230,7 @@ static void __init proc_init(void) static void __exit proc_exit(void) { -int nelem = sizeof(procfsentries)/sizeof(procfsentries[0]); +int nelem = ARRAY_SIZE(procfsentries); int i; for (i=nelem-1; i = 0; i--) { -- Ahmed S. Darwish http://darwish-07.blogspot.com -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: any value to fixing apparent bugs in old ISDN4Linux?
On Mon, Jan 15, 2007 at 12:17:37PM -0500, Robert P. J. Day wrote: > On Mon, 15 Jan 2007, Tilman Schmidt wrote: > > > Robert P. J. Day schrieb: > > > OTOH, since that code *is* in the allegedly obsolete old ISDN4Linux > > > code, perhaps that entire part of the tree can just be junked. but if > > > it's sticking around, it should probably be fixed. > > > > Please do not remove isdn4linux just yet. It's true that it has been > > marked as obsolete for quite some time, but it's still needed > > anyway. Its designated successor, the CAPI subsystem, so far only > > supports a very limited range of hardware. Dropping isdn4linux now > > would leave the owners of some very popular ISDN cards out in the > > cold. > > that wouldn't be my decision, i just made a note of an oddity. but if > it's still in actual use, then it really should be re-labelled from > "obsolete" to "deprecated," no? > Good point. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: any value to fixing apparent bugs in old ISDN4Linux?
On Mon, Jan 15, 2007 at 06:43:30AM -0500, Robert P. J. Day wrote: > > $ grep -r DE_AOC . > ./.config:CONFIG_DE_AOC=y > ./drivers/isdn/hisax/l3dss1.c:#ifdef HISAX_DE_AOC > ./drivers/isdn/hisax/l3dss1.c:#else /* not HISAX_DE_AOC */ > ./drivers/isdn/hisax/l3dss1.c:#endif /* not HISAX_DE_AOC */ > ./drivers/isdn/hisax/Kconfig:config DE_AOC > > it seems like there's a name mismatch between the config variable > and the one that's being tested, no? > > OTOH, since that code *is* in the allegedly obsolete old ISDN4Linux > code, perhaps that entire part of the tree can just be junked. but if > it's sticking around, it should probably be fixed. > Yes thanks for discover this. Since the code only affect the analyse of the AOC info which is pure information only without real function it was not detected before. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: any value to fixing apparent bugs in old ISDN4Linux?
On Mon, Jan 15, 2007 at 06:43:30AM -0500, Robert P. J. Day wrote: $ grep -r DE_AOC . ./.config:CONFIG_DE_AOC=y ./drivers/isdn/hisax/l3dss1.c:#ifdef HISAX_DE_AOC ./drivers/isdn/hisax/l3dss1.c:#else /* not HISAX_DE_AOC */ ./drivers/isdn/hisax/l3dss1.c:#endif /* not HISAX_DE_AOC */ ./drivers/isdn/hisax/Kconfig:config DE_AOC it seems like there's a name mismatch between the config variable and the one that's being tested, no? OTOH, since that code *is* in the allegedly obsolete old ISDN4Linux code, perhaps that entire part of the tree can just be junked. but if it's sticking around, it should probably be fixed. Yes thanks for discover this. Since the code only affect the analyse of the AOC info which is pure information only without real function it was not detected before. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: any value to fixing apparent bugs in old ISDN4Linux?
On Mon, Jan 15, 2007 at 12:17:37PM -0500, Robert P. J. Day wrote: On Mon, 15 Jan 2007, Tilman Schmidt wrote: Robert P. J. Day schrieb: OTOH, since that code *is* in the allegedly obsolete old ISDN4Linux code, perhaps that entire part of the tree can just be junked. but if it's sticking around, it should probably be fixed. Please do not remove isdn4linux just yet. It's true that it has been marked as obsolete for quite some time, but it's still needed anyway. Its designated successor, the CAPI subsystem, so far only supports a very limited range of hardware. Dropping isdn4linux now would leave the owners of some very popular ISDN cards out in the cold. that wouldn't be my decision, i just made a note of an oddity. but if it's still in actual use, then it really should be re-labelled from obsolete to deprecated, no? Good point. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ISDN: fix warnings
On Sun, Dec 03, 2006 at 08:42:03PM -0500, Jeff Garzik wrote: > > * diva, sedlbauer: the 'ready' label is only used in certain configurations > * hfc_pci: > - cast 'arg' to proper size for testing and printing > - print out 'void __iomem *' variables with %p, > rather than using incorrect casts that throw warnings > > Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> > Acked-by: Karsten keil <[EMAIL PROTECTED]> > diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c > index 3dacfff..6eebeb4 100644 > --- a/drivers/isdn/hisax/diva.c > +++ b/drivers/isdn/hisax/diva.c > @@ -1121,7 +1121,11 @@ #endif /* CONFIG_PCI */ > bytecnt = 32; > } > } > + > +#ifdef __ISAPNP__ > ready: > +#endif > + > printk(KERN_INFO > "Diva: %s card configured at %#lx IRQ %d\n", > (cs->subtyp == DIVA_PCI) ? "PCI" : > diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c > index 93f60b5..463b8ac 100644 > --- a/drivers/isdn/hisax/hfc_pci.c > +++ b/drivers/isdn/hisax/hfc_pci.c > @@ -1211,7 +1211,7 @@ #endif > break; > case (HW_TESTLOOP | REQUEST): > spin_lock_irqsave(>lock, flags); > - switch ((int) arg) { > + switch ((long) arg) { > case (1): > Write_hfc(cs, HFCPCI_B1_SSL, 0x80); > /* tx slot */ > Write_hfc(cs, HFCPCI_B1_RSL, 0x80); > /* rx slot */ > @@ -1229,7 +1229,7 @@ #endif > default: > spin_unlock_irqrestore(>lock, > flags); > if (cs->debug & L1_DEB_WARN) > - debugl1(cs, "hfcpci_l1hw loop > invalid %4x", (int) arg); > + debugl1(cs, "hfcpci_l1hw loop > invalid %4lx", (long) arg); > return; > } > cs->hw.hfcpci.trm |= 0x80; /* enable IOM-loop */ > @@ -1709,9 +1709,9 @@ #ifdef CONFIG_PCI > pci_write_config_dword(cs->hw.hfcpci.dev, 0x80, (u_int) > virt_to_bus(cs->hw.hfcpci.fifos)); > cs->hw.hfcpci.pci_io = ioremap((ulong) cs->hw.hfcpci.pci_io, > 256); > printk(KERN_INFO > -"HFC-PCI: defined at mem %#x fifo %#x(%#x) IRQ %d HZ > %d\n", > -(u_int) cs->hw.hfcpci.pci_io, > -(u_int) cs->hw.hfcpci.fifos, > +"HFC-PCI: defined at mem %p fifo %p(%#x) IRQ %d HZ %d\n", > +cs->hw.hfcpci.pci_io, > +cs->hw.hfcpci.fifos, > (u_int) virt_to_bus(cs->hw.hfcpci.fifos), > cs->irq, HZ); > spin_lock_irqsave(>lock, flags); > diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c > index 9522141..030d162 100644 > --- a/drivers/isdn/hisax/sedlbauer.c > +++ b/drivers/isdn/hisax/sedlbauer.c > @@ -677,7 +677,11 @@ #else > return (0); > #endif /* CONFIG_PCI */ > } > + > +#ifdef __ISAPNP__ > ready: > +#endif > + > /* In case of the sedlbauer pcmcia card, this region is in use, >* reserved for us by the card manager. So we do not check it >* here, it would fail. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] ISDN: fix warnings
On Sun, Dec 03, 2006 at 08:42:03PM -0500, Jeff Garzik wrote: * diva, sedlbauer: the 'ready' label is only used in certain configurations * hfc_pci: - cast 'arg' to proper size for testing and printing - print out 'void __iomem *' variables with %p, rather than using incorrect casts that throw warnings Signed-off-by: Jeff Garzik [EMAIL PROTECTED] Acked-by: Karsten keil [EMAIL PROTECTED] diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index 3dacfff..6eebeb4 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c @@ -1121,7 +1121,11 @@ #endif /* CONFIG_PCI */ bytecnt = 32; } } + +#ifdef __ISAPNP__ ready: +#endif + printk(KERN_INFO Diva: %s card configured at %#lx IRQ %d\n, (cs-subtyp == DIVA_PCI) ? PCI : diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index 93f60b5..463b8ac 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c @@ -1211,7 +1211,7 @@ #endif break; case (HW_TESTLOOP | REQUEST): spin_lock_irqsave(cs-lock, flags); - switch ((int) arg) { + switch ((long) arg) { case (1): Write_hfc(cs, HFCPCI_B1_SSL, 0x80); /* tx slot */ Write_hfc(cs, HFCPCI_B1_RSL, 0x80); /* rx slot */ @@ -1229,7 +1229,7 @@ #endif default: spin_unlock_irqrestore(cs-lock, flags); if (cs-debug L1_DEB_WARN) - debugl1(cs, hfcpci_l1hw loop invalid %4x, (int) arg); + debugl1(cs, hfcpci_l1hw loop invalid %4lx, (long) arg); return; } cs-hw.hfcpci.trm |= 0x80; /* enable IOM-loop */ @@ -1709,9 +1709,9 @@ #ifdef CONFIG_PCI pci_write_config_dword(cs-hw.hfcpci.dev, 0x80, (u_int) virt_to_bus(cs-hw.hfcpci.fifos)); cs-hw.hfcpci.pci_io = ioremap((ulong) cs-hw.hfcpci.pci_io, 256); printk(KERN_INFO -HFC-PCI: defined at mem %#x fifo %#x(%#x) IRQ %d HZ %d\n, -(u_int) cs-hw.hfcpci.pci_io, -(u_int) cs-hw.hfcpci.fifos, +HFC-PCI: defined at mem %p fifo %p(%#x) IRQ %d HZ %d\n, +cs-hw.hfcpci.pci_io, +cs-hw.hfcpci.fifos, (u_int) virt_to_bus(cs-hw.hfcpci.fifos), cs-irq, HZ); spin_lock_irqsave(cs-lock, flags); diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c index 9522141..030d162 100644 --- a/drivers/isdn/hisax/sedlbauer.c +++ b/drivers/isdn/hisax/sedlbauer.c @@ -677,7 +677,11 @@ #else return (0); #endif /* CONFIG_PCI */ } + +#ifdef __ISAPNP__ ready: +#endif + /* In case of the sedlbauer pcmcia card, this region is in use, * reserved for us by the card manager. So we do not check it * here, it would fail. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC: 2.6 patch] remove the broken HISAX_AMD7930 option
On Sat, Nov 25, 2006 at 08:15:04PM +0100, Adrian Bunk wrote: > HISAX_AMD7930 was never anywhere near to being working, and this doesn't > seem to change in the forseeable future. > > Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> > Acked-by: Karsten Keil <[EMAIL PROTECTED]> > --- > > Thgis patch was already sent on: > - 18 Nov 2006 > > drivers/isdn/hisax/Kconfig |7 --- > drivers/isdn/hisax/config.c | 18 -- > drivers/isdn/hisax/hisax.h |6 -- > 3 files changed, 31 deletions(-) > > --- linux-2.6.19-rc5-mm2/drivers/isdn/hisax/Kconfig.old 2006-11-17 > 19:41:07.0 +0100 > +++ linux-2.6.19-rc5-mm2/drivers/isdn/hisax/Kconfig 2006-11-17 > 19:41:15.0 +0100 > @@ -349,13 +349,6 @@ config HISAX_ENTERNOW_PCI > This enables HiSax support for the Formula-n enter:now PCI > ISDN card. > > -config HISAX_AMD7930 > - bool "Am7930 (EXPERIMENTAL)" > - depends on EXPERIMENTAL && SPARC && BROKEN > - help > - This enables HiSax support for the AMD7930 chips on some SPARCs. > - This code is not finished yet. > - > endif > > if ISDN_DRV_HISAX > --- linux-2.6.19-rc5-mm2/drivers/isdn/hisax/hisax.h.old 2006-11-17 > 19:41:33.0 +0100 > +++ linux-2.6.19-rc5-mm2/drivers/isdn/hisax/hisax.h 2006-11-17 > 19:41:44.0 +0100 > @@ -1139,12 +1139,6 @@ struct IsdnCardState { > #define CARD_HFC_SX 0 > #endif > > -#ifdef CONFIG_HISAX_AMD7930 > -#define CARD_AMD7930 1 > -#else > -#define CARD_AMD7930 0 > -#endif > - > #ifdef CONFIG_HISAX_NICCY > #define CARD_NICCY 1 > #ifndef ISDN_CHIP_ISAC > --- linux-2.6.19-rc5-mm2/drivers/isdn/hisax/config.c.old 2006-11-17 > 19:41:57.0 +0100 > +++ linux-2.6.19-rc5-mm2/drivers/isdn/hisax/config.c 2006-11-17 > 19:43:03.0 +0100 > @@ -227,14 +227,6 @@ const char *CardType[] = { > #define DEFAULT_CFG {5,0x2E0,0,0} > #endif > > - > -#ifdef CONFIG_HISAX_AMD7930 > -#undef DEFAULT_CARD > -#undef DEFAULT_CFG > -#define DEFAULT_CARD ISDN_CTYPE_AMD7930 > -#define DEFAULT_CFG {12,0x3e0,0,0} > -#endif > - > #ifdef CONFIG_HISAX_NICCY > #undef DEFAULT_CARD > #undef DEFAULT_CFG > @@ -545,10 +537,6 @@ extern int setup_hfcpci(struct IsdnCard > extern int setup_hfcsx(struct IsdnCard *card); > #endif > > -#if CARD_AMD7930 > -extern int setup_amd7930(struct IsdnCard *card); > -#endif > - > #if CARD_NICCY > extern int setup_niccy(struct IsdnCard *card); > #endif > @@ -1064,11 +1052,6 @@ static int checkcard(int cardnr, char *i > ret = setup_niccy(card); > break; > #endif > -#if CARD_AMD7930 > - case ISDN_CTYPE_AMD7930: > - ret = setup_amd7930(card); > - break; > -#endif > #if CARD_ISURF > case ISDN_CTYPE_ISURF: > ret = setup_isurf(card); > @@ -1438,7 +1421,6 @@ static int __init HiSax_init(void) > break; > case ISDN_CTYPE_ELSA_PCI: > case ISDN_CTYPE_NETJET_S: > - case ISDN_CTYPE_AMD7930: > case ISDN_CTYPE_TELESPCI: > case ISDN_CTYPE_W6692: > case ISDN_CTYPE_NETJET_U: -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [RFC: 2.6 patch] remove the broken HISAX_AMD7930 option
On Sat, Nov 25, 2006 at 08:15:04PM +0100, Adrian Bunk wrote: HISAX_AMD7930 was never anywhere near to being working, and this doesn't seem to change in the forseeable future. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Acked-by: Karsten Keil [EMAIL PROTECTED] --- Thgis patch was already sent on: - 18 Nov 2006 drivers/isdn/hisax/Kconfig |7 --- drivers/isdn/hisax/config.c | 18 -- drivers/isdn/hisax/hisax.h |6 -- 3 files changed, 31 deletions(-) --- linux-2.6.19-rc5-mm2/drivers/isdn/hisax/Kconfig.old 2006-11-17 19:41:07.0 +0100 +++ linux-2.6.19-rc5-mm2/drivers/isdn/hisax/Kconfig 2006-11-17 19:41:15.0 +0100 @@ -349,13 +349,6 @@ config HISAX_ENTERNOW_PCI This enables HiSax support for the Formula-n enter:now PCI ISDN card. -config HISAX_AMD7930 - bool Am7930 (EXPERIMENTAL) - depends on EXPERIMENTAL SPARC BROKEN - help - This enables HiSax support for the AMD7930 chips on some SPARCs. - This code is not finished yet. - endif if ISDN_DRV_HISAX --- linux-2.6.19-rc5-mm2/drivers/isdn/hisax/hisax.h.old 2006-11-17 19:41:33.0 +0100 +++ linux-2.6.19-rc5-mm2/drivers/isdn/hisax/hisax.h 2006-11-17 19:41:44.0 +0100 @@ -1139,12 +1139,6 @@ struct IsdnCardState { #define CARD_HFC_SX 0 #endif -#ifdef CONFIG_HISAX_AMD7930 -#define CARD_AMD7930 1 -#else -#define CARD_AMD7930 0 -#endif - #ifdef CONFIG_HISAX_NICCY #define CARD_NICCY 1 #ifndef ISDN_CHIP_ISAC --- linux-2.6.19-rc5-mm2/drivers/isdn/hisax/config.c.old 2006-11-17 19:41:57.0 +0100 +++ linux-2.6.19-rc5-mm2/drivers/isdn/hisax/config.c 2006-11-17 19:43:03.0 +0100 @@ -227,14 +227,6 @@ const char *CardType[] = { #define DEFAULT_CFG {5,0x2E0,0,0} #endif - -#ifdef CONFIG_HISAX_AMD7930 -#undef DEFAULT_CARD -#undef DEFAULT_CFG -#define DEFAULT_CARD ISDN_CTYPE_AMD7930 -#define DEFAULT_CFG {12,0x3e0,0,0} -#endif - #ifdef CONFIG_HISAX_NICCY #undef DEFAULT_CARD #undef DEFAULT_CFG @@ -545,10 +537,6 @@ extern int setup_hfcpci(struct IsdnCard extern int setup_hfcsx(struct IsdnCard *card); #endif -#if CARD_AMD7930 -extern int setup_amd7930(struct IsdnCard *card); -#endif - #if CARD_NICCY extern int setup_niccy(struct IsdnCard *card); #endif @@ -1064,11 +1052,6 @@ static int checkcard(int cardnr, char *i ret = setup_niccy(card); break; #endif -#if CARD_AMD7930 - case ISDN_CTYPE_AMD7930: - ret = setup_amd7930(card); - break; -#endif #if CARD_ISURF case ISDN_CTYPE_ISURF: ret = setup_isurf(card); @@ -1438,7 +1421,6 @@ static int __init HiSax_init(void) break; case ISDN_CTYPE_ELSA_PCI: case ISDN_CTYPE_NETJET_S: - case ISDN_CTYPE_AMD7930: case ISDN_CTYPE_TELESPCI: case ISDN_CTYPE_W6692: case ISDN_CTYPE_NETJET_U: -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] isdn_v110 warning fix
On Tue, Aug 30, 2005 at 01:05:43AM +0200, Jesper Juhl wrote: > This is OK. Even if the codepath is never executed in a way that ret might be used uninitialized it does not harm to set ret = 0. Warning fix : drivers/isdn/i4l/isdn_v110.c:523: warning: `ret' might be used uninitialized in this function Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]> Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> --- drivers/isdn/i4l/isdn_v110.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) --- linux-2.6.13-orig/drivers/isdn/i4l/isdn_v110.c 2005-08-29 01:41:01.0 +0200 +++ linux-2.6.13/drivers/isdn/i4l/isdn_v110.c 2005-08-30 00:59:34.0 +0200 @@ -516,11 +516,11 @@ } int -isdn_v110_stat_callback(int idx, isdn_ctrl * c) +isdn_v110_stat_callback(int idx, isdn_ctrl *c) { isdn_v110_stream *v = NULL; int i; - int ret; + int ret = 0; if (idx < 0) return 0; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] isdn_v110 warning fix
On Tue, Aug 30, 2005 at 01:05:43AM +0200, Jesper Juhl wrote: This is OK. Even if the codepath is never executed in a way that ret might be used uninitialized it does not harm to set ret = 0. Warning fix : drivers/isdn/i4l/isdn_v110.c:523: warning: `ret' might be used uninitialized in this function Signed-off-by: Jesper Juhl [EMAIL PROTECTED] Signed-off-by: Karsten Keil [EMAIL PROTECTED] --- drivers/isdn/i4l/isdn_v110.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) --- linux-2.6.13-orig/drivers/isdn/i4l/isdn_v110.c 2005-08-29 01:41:01.0 +0200 +++ linux-2.6.13/drivers/isdn/i4l/isdn_v110.c 2005-08-30 00:59:34.0 +0200 @@ -516,11 +516,11 @@ } int -isdn_v110_stat_callback(int idx, isdn_ctrl * c) +isdn_v110_stat_callback(int idx, isdn_ctrl *c) { isdn_v110_stream *v = NULL; int i; - int ret; + int ret = 0; if (idx 0) return 0; - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH ISDN] Fix capifs bug in initialization error path.
On Fri, Aug 26, 2005 at 11:56:56PM -0400, James Morris wrote: > This patch fixes a bug in the capifs initialization code, where the > filesystem is not unregistered if kern_mount() fails. > > Please apply. looks OK for me. Signed-off-by: James Morris <[EMAIL PROTECTED]> Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> --- capifs.c |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -purN -X dontdiff linux-2.6.13-mm2.o/drivers/isdn/capi/capifs.c linux-2.6.13-mm2.x/drivers/isdn/capi/capifs.c --- linux-2.6.13-mm2.o/drivers/isdn/capi/capifs.c 2005-03-02 02:37:50.0 -0500 +++ linux-2.6.13-mm2.x/drivers/isdn/capi/capifs.c 2005-08-26 23:35:50.0 -0400 @@ -191,8 +191,10 @@ static int __init capifs_init(void) err = register_filesystem(_fs_type); if (!err) { capifs_mnt = kern_mount(_fs_type); - if (IS_ERR(capifs_mnt)) + if (IS_ERR(capifs_mnt)) { err = PTR_ERR(capifs_mnt); + unregister_filesystem(_fs_type); + } } if (!err) printk(KERN_NOTICE "capifs: Rev %s\n", rev); -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH ISDN] Fix capifs bug in initialization error path.
On Fri, Aug 26, 2005 at 11:56:56PM -0400, James Morris wrote: This patch fixes a bug in the capifs initialization code, where the filesystem is not unregistered if kern_mount() fails. Please apply. looks OK for me. Signed-off-by: James Morris [EMAIL PROTECTED] Signed-off-by: Karsten Keil [EMAIL PROTECTED] --- capifs.c |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -purN -X dontdiff linux-2.6.13-mm2.o/drivers/isdn/capi/capifs.c linux-2.6.13-mm2.x/drivers/isdn/capi/capifs.c --- linux-2.6.13-mm2.o/drivers/isdn/capi/capifs.c 2005-03-02 02:37:50.0 -0500 +++ linux-2.6.13-mm2.x/drivers/isdn/capi/capifs.c 2005-08-26 23:35:50.0 -0400 @@ -191,8 +191,10 @@ static int __init capifs_init(void) err = register_filesystem(capifs_fs_type); if (!err) { capifs_mnt = kern_mount(capifs_fs_type); - if (IS_ERR(capifs_mnt)) + if (IS_ERR(capifs_mnt)) { err = PTR_ERR(capifs_mnt); + unregister_filesystem(capifs_fs_type); + } } if (!err) printk(KERN_NOTICE capifs: Rev %s\n, rev); -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: fix for ISDN ippp filtering
On Thu, Apr 21, 2005 at 03:17:21PM +0200, Patrick McHardy wrote: > Karsten Keil wrote: > >Hi, > > > >We do not longer use DLT_LINUX_SLL for activ/pass filters but > >DLT_PPP_WITHDIRECTION > >witch need 1 as outbound flag. > >Please apply. > > Won't this break compatibility with old ipppd binaries? > Not really, since such a version was never in our I4L CVS and never released by isdn4linux. It was my fault that this wrong temporary attempt to solve the filtering problem was pushed into the kernel. The new version is still compatible to the old filtering using DLT_PPP (with libpcap 0.7x version) with was the previous version. The DLT_LINUX_SLL solution did break compatibility and was rejected because of this for PPP, but I did miss to revert the ISDN kernel part in time, so it simple do not work today. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
fix for ISDN ippp filtering
Hi, We do not longer use DLT_LINUX_SLL for activ/pass filters but DLT_PPP_WITHDIRECTION witch need 1 as outbound flag. Please apply. Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> diff -urN linux-2.6.12-rc2.org/drivers/isdn/i4l/isdn_ppp.c linux-2.6.12-rc2/drivers/isdn/i4l/isdn_ppp.c --- linux-2.6.12-rc2.org/drivers/isdn/i4l/isdn_ppp.c2005-04-20 16:01:07.070809128 +0200 +++ linux-2.6.12-rc2/drivers/isdn/i4l/isdn_ppp.c2005-04-20 18:31:28.533367073 +0200 @@ -1151,7 +1151,7 @@ { u_int16_t *p = (u_int16_t *) skb->data; - *p = 0; /* indicate inbound in DLT_LINUX_SLL */ + *p = 0; /* indicate inbound */ } if (is->pass_filter @@ -1293,12 +1293,12 @@ /* check if we should pass this packet * the filter instructions are constructed assuming * a four-byte PPP header on each packet */ - skb_push(skb, 4); + *skb_push(skb, 4) = 1; /* indicate outbound */ { u_int16_t *p = (u_int16_t *) skb->data; - *p++ = htons(4); /* indicate outbound in DLT_LINUX_SLL */ + p++; *p = htons(proto); } @@ -1491,12 +1491,12 @@ * temporarily remove part of the fake header stuck on * earlier. */ - skb_pull(skb, IPPP_MAX_HEADER - 4); + *skb_pull(skb, IPPP_MAX_HEADER - 4) = 1; /* indicate outbound */ { u_int16_t *p = (u_int16_t *) skb->data; - *p++ = htons(4);/* indicate outbound in DLT_LINUX_SLL */ + p++; *p = htons(proto); } -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
fix for ISDN ippp filtering
Hi, We do not longer use DLT_LINUX_SLL for activ/pass filters but DLT_PPP_WITHDIRECTION witch need 1 as outbound flag. Please apply. Signed-off-by: Karsten Keil [EMAIL PROTECTED] diff -urN linux-2.6.12-rc2.org/drivers/isdn/i4l/isdn_ppp.c linux-2.6.12-rc2/drivers/isdn/i4l/isdn_ppp.c --- linux-2.6.12-rc2.org/drivers/isdn/i4l/isdn_ppp.c2005-04-20 16:01:07.070809128 +0200 +++ linux-2.6.12-rc2/drivers/isdn/i4l/isdn_ppp.c2005-04-20 18:31:28.533367073 +0200 @@ -1151,7 +1151,7 @@ { u_int16_t *p = (u_int16_t *) skb-data; - *p = 0; /* indicate inbound in DLT_LINUX_SLL */ + *p = 0; /* indicate inbound */ } if (is-pass_filter @@ -1293,12 +1293,12 @@ /* check if we should pass this packet * the filter instructions are constructed assuming * a four-byte PPP header on each packet */ - skb_push(skb, 4); + *skb_push(skb, 4) = 1; /* indicate outbound */ { u_int16_t *p = (u_int16_t *) skb-data; - *p++ = htons(4); /* indicate outbound in DLT_LINUX_SLL */ + p++; *p = htons(proto); } @@ -1491,12 +1491,12 @@ * temporarily remove part of the fake header stuck on * earlier. */ - skb_pull(skb, IPPP_MAX_HEADER - 4); + *skb_pull(skb, IPPP_MAX_HEADER - 4) = 1; /* indicate outbound */ { u_int16_t *p = (u_int16_t *) skb-data; - *p++ = htons(4);/* indicate outbound in DLT_LINUX_SLL */ + p++; *p = htons(proto); } -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: fix for ISDN ippp filtering
On Thu, Apr 21, 2005 at 03:17:21PM +0200, Patrick McHardy wrote: Karsten Keil wrote: Hi, We do not longer use DLT_LINUX_SLL for activ/pass filters but DLT_PPP_WITHDIRECTION witch need 1 as outbound flag. Please apply. Won't this break compatibility with old ipppd binaries? Not really, since such a version was never in our I4L CVS and never released by isdn4linux. It was my fault that this wrong temporary attempt to solve the filtering problem was pushed into the kernel. The new version is still compatible to the old filtering using DLT_PPP (with libpcap 0.7x version) with was the previous version. The DLT_LINUX_SLL solution did break compatibility and was rejected because of this for PPP, but I did miss to revert the ISDN kernel part in time, so it simple do not work today. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [2.6 patch] drivers/isdn/: make some code static
On Tue, Apr 19, 2005 at 02:46:58AM +0200, Adrian Bunk wrote: > This patch makes some needlessly global code static. > Yes, OK. Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> Signed-off-by: Karsten Keil <[EMAIL PROTECTED]> drivers/isdn/hardware/eicon/dadapter.c |2 +- drivers/isdn/hisax/hfc4s8s_l1.c|4 ++-- drivers/isdn/hysdn/hycapi.c| 20 +++- drivers/isdn/hysdn/hysdn_boot.c|4 ++-- drivers/isdn/hysdn/hysdn_defs.h| 12 drivers/isdn/hysdn/hysdn_init.c|2 +- drivers/isdn/hysdn/hysdn_proclog.c |4 +++- 7 files changed, 20 insertions(+), 28 deletions(-) --- linux-2.6.12-rc2-mm3-full/drivers/isdn/hisax/hfc4s8s_l1.c.old 2005-04-19 00:32:31.0 +0200 +++ linux-2.6.12-rc2-mm3-full/drivers/isdn/hisax/hfc4s8s_l1.c 2005-04-19 00:32:46.0 +0200 @@ -1464,7 +1464,7 @@ /**/ /* disable memory mapped ports / io ports */ /**/ -void +static void release_pci_ports(hfc4s8s_hw * hw) { pci_write_config_word(hw->pdev, PCI_COMMAND, 0); @@ -1480,7 +1480,7 @@ /*/ /* enable memory mapped ports / io ports */ /*/ -void +static void enable_pci_ports(hfc4s8s_hw * hw) { #ifdef CONFIG_HISAX_HFC4S8S_PCIMEM --- linux-2.6.12-rc2-mm3-full/drivers/isdn/hysdn/hysdn_defs.h.old 2005-04-19 00:33:51.0 +0200 +++ linux-2.6.12-rc2-mm3-full/drivers/isdn/hysdn/hysdn_defs.h 2005-04-19 00:38:25.0 +0200 @@ -227,7 +227,6 @@ /*/ /* exported vars */ /*/ -extern int cardmax;/* number of found cards */ extern hysdn_card *card_root; /* pointer to first card */ @@ -244,7 +243,6 @@ /* hysdn_proclog.c */ extern int hysdn_proclog_init(hysdn_card *); /* init proc log entry */ extern void hysdn_proclog_release(hysdn_card *); /* deinit proc log entry */ -extern void put_log_buffer(hysdn_card *, char *); /* output log data */ extern void hysdn_addlog(hysdn_card *, char *,...);/* output data to log */ extern void hysdn_card_errlog(hysdn_card *, tErrLogEntry *, int); /* output card log */ @@ -278,16 +276,6 @@ extern int hycapi_capi_create(hysdn_card *); /* create a new capi device */ extern int hycapi_capi_release(hysdn_card *); /* delete the device */ extern int hycapi_capi_stop(hysdn_card *card); /* suspend */ -extern int hycapi_load_firmware(struct capi_ctr *, capiloaddata *); -extern void hycapi_reset_ctr(struct capi_ctr *); -extern void hycapi_remove_ctr(struct capi_ctr *); -extern void hycapi_register_appl(struct capi_ctr *, __u16 appl, -capi_register_params *); -extern void hycapi_release_appl(struct capi_ctr *, __u16 appl); -extern u16 hycapi_send_message(struct capi_ctr *, struct sk_buff *skb); -extern char *hycapi_procinfo(struct capi_ctr *); -extern int hycapi_read_proc(char *page, char **start, off_t off, - int count, int *eof, struct capi_ctr *card); extern void hycapi_rx_capipkt(hysdn_card * card, uchar * buf, word len); extern void hycapi_tx_capiack(hysdn_card * card); extern struct sk_buff *hycapi_tx_capiget(hysdn_card *card); --- linux-2.6.12-rc2-mm3-full/drivers/isdn/hysdn/hycapi.c.old 2005-04-19 00:34:05.0 +0200 +++ linux-2.6.12-rc2-mm3-full/drivers/isdn/hysdn/hycapi.c 2005-04-19 00:36:34.0 +0200 @@ -42,6 +42,8 @@ static hycapi_appl hycapi_applications[CAPI_MAXAPPL]; +static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb); + static inline int _hycapi_appCheck(int app_id, int ctrl_no) { if((ctrl_no <= 0) || (ctrl_no > CAPI_MAXCONTR) || (app_id <= 0) || @@ -57,7 +59,7 @@ Kernel-Capi callback reset_ctr **/ -void +static void hycapi_reset_ctr(struct capi_ctr *ctrl) { hycapictrl_info *cinfo = ctrl->driverdata; @@ -73,7 +75,7 @@ Kernel-Capi callback remove_ctr **/ -void +static void hycapi_remove_ctr(struct capi_ctr *ctrl) { int i; @@ -215,7 +217,7 @@ The application is recorded in the internal list. */ -void +static void hycapi_register_appl(struct capi_ctr *ctrl, __u16 appl, capi_register_params *rp) { @@ -291,7 +293,7 @@ registration at controller-level **/ -void +static void hycapi_release_appl(struct capi_ctr *ctrl, __u16 appl) { int chk; @@ -364,7 +366,7 @@ ***/ -u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) +static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) { __u16 appl_id;
Re: [2.6 patch] drivers/isdn/: make some code static
On Tue, Apr 19, 2005 at 02:46:58AM +0200, Adrian Bunk wrote: This patch makes some needlessly global code static. Yes, OK. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Signed-off-by: Karsten Keil [EMAIL PROTECTED] drivers/isdn/hardware/eicon/dadapter.c |2 +- drivers/isdn/hisax/hfc4s8s_l1.c|4 ++-- drivers/isdn/hysdn/hycapi.c| 20 +++- drivers/isdn/hysdn/hysdn_boot.c|4 ++-- drivers/isdn/hysdn/hysdn_defs.h| 12 drivers/isdn/hysdn/hysdn_init.c|2 +- drivers/isdn/hysdn/hysdn_proclog.c |4 +++- 7 files changed, 20 insertions(+), 28 deletions(-) --- linux-2.6.12-rc2-mm3-full/drivers/isdn/hisax/hfc4s8s_l1.c.old 2005-04-19 00:32:31.0 +0200 +++ linux-2.6.12-rc2-mm3-full/drivers/isdn/hisax/hfc4s8s_l1.c 2005-04-19 00:32:46.0 +0200 @@ -1464,7 +1464,7 @@ /**/ /* disable memory mapped ports / io ports */ /**/ -void +static void release_pci_ports(hfc4s8s_hw * hw) { pci_write_config_word(hw-pdev, PCI_COMMAND, 0); @@ -1480,7 +1480,7 @@ /*/ /* enable memory mapped ports / io ports */ /*/ -void +static void enable_pci_ports(hfc4s8s_hw * hw) { #ifdef CONFIG_HISAX_HFC4S8S_PCIMEM --- linux-2.6.12-rc2-mm3-full/drivers/isdn/hysdn/hysdn_defs.h.old 2005-04-19 00:33:51.0 +0200 +++ linux-2.6.12-rc2-mm3-full/drivers/isdn/hysdn/hysdn_defs.h 2005-04-19 00:38:25.0 +0200 @@ -227,7 +227,6 @@ /*/ /* exported vars */ /*/ -extern int cardmax;/* number of found cards */ extern hysdn_card *card_root; /* pointer to first card */ @@ -244,7 +243,6 @@ /* hysdn_proclog.c */ extern int hysdn_proclog_init(hysdn_card *); /* init proc log entry */ extern void hysdn_proclog_release(hysdn_card *); /* deinit proc log entry */ -extern void put_log_buffer(hysdn_card *, char *); /* output log data */ extern void hysdn_addlog(hysdn_card *, char *,...);/* output data to log */ extern void hysdn_card_errlog(hysdn_card *, tErrLogEntry *, int); /* output card log */ @@ -278,16 +276,6 @@ extern int hycapi_capi_create(hysdn_card *); /* create a new capi device */ extern int hycapi_capi_release(hysdn_card *); /* delete the device */ extern int hycapi_capi_stop(hysdn_card *card); /* suspend */ -extern int hycapi_load_firmware(struct capi_ctr *, capiloaddata *); -extern void hycapi_reset_ctr(struct capi_ctr *); -extern void hycapi_remove_ctr(struct capi_ctr *); -extern void hycapi_register_appl(struct capi_ctr *, __u16 appl, -capi_register_params *); -extern void hycapi_release_appl(struct capi_ctr *, __u16 appl); -extern u16 hycapi_send_message(struct capi_ctr *, struct sk_buff *skb); -extern char *hycapi_procinfo(struct capi_ctr *); -extern int hycapi_read_proc(char *page, char **start, off_t off, - int count, int *eof, struct capi_ctr *card); extern void hycapi_rx_capipkt(hysdn_card * card, uchar * buf, word len); extern void hycapi_tx_capiack(hysdn_card * card); extern struct sk_buff *hycapi_tx_capiget(hysdn_card *card); --- linux-2.6.12-rc2-mm3-full/drivers/isdn/hysdn/hycapi.c.old 2005-04-19 00:34:05.0 +0200 +++ linux-2.6.12-rc2-mm3-full/drivers/isdn/hysdn/hycapi.c 2005-04-19 00:36:34.0 +0200 @@ -42,6 +42,8 @@ static hycapi_appl hycapi_applications[CAPI_MAXAPPL]; +static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb); + static inline int _hycapi_appCheck(int app_id, int ctrl_no) { if((ctrl_no = 0) || (ctrl_no CAPI_MAXCONTR) || (app_id = 0) || @@ -57,7 +59,7 @@ Kernel-Capi callback reset_ctr **/ -void +static void hycapi_reset_ctr(struct capi_ctr *ctrl) { hycapictrl_info *cinfo = ctrl-driverdata; @@ -73,7 +75,7 @@ Kernel-Capi callback remove_ctr **/ -void +static void hycapi_remove_ctr(struct capi_ctr *ctrl) { int i; @@ -215,7 +217,7 @@ The application is recorded in the internal list. */ -void +static void hycapi_register_appl(struct capi_ctr *ctrl, __u16 appl, capi_register_params *rp) { @@ -291,7 +293,7 @@ registration at controller-level **/ -void +static void hycapi_release_appl(struct capi_ctr *ctrl, __u16 appl) { int chk; @@ -364,7 +366,7 @@ ***/ -u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) +static u16 hycapi_send_message(struct capi_ctr *ctrl, struct sk_buff *skb) { __u16 appl_id; int _len, _len2; @@ -437,8 +439,8
Re: Problem with w6692 & kernel >=2.6.10
On Mon, Mar 21, 2005 at 02:28:23PM -0800, Andrew Morton wrote: > Marko Rebrina <[EMAIL PROTECTED]> wrote: > > > > I have problem with w6692 (mISDN-2005-02-25) & kernel >=2.6.10 (with > > 2.6.9 is OK!) > > There haven't been any changes in the w6692 driver for ages, so I'd be > suspecting PCI changes or something like that. Are you able to test > 2.6.12-rc1? > Marko do not point to the in kernel w6692 driver, but to the (still ALPHA) mISDN driver from cvs.isdn4linux.de. This driver had a problem with the pci_register_driver return code changes in 2.6.10, it now always returns 0 (if no error), but < 2.6.10 did return the number of detected devices, which was tested in this driver. This is fixed since last week in our CVS. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: Problem with w6692 kernel =2.6.10
On Mon, Mar 21, 2005 at 02:28:23PM -0800, Andrew Morton wrote: Marko Rebrina [EMAIL PROTECTED] wrote: I have problem with w6692 (mISDN-2005-02-25) kernel =2.6.10 (with 2.6.9 is OK!) There haven't been any changes in the w6692 driver for ages, so I'd be suspecting PCI changes or something like that. Are you able to test 2.6.12-rc1? Marko do not point to the in kernel w6692 driver, but to the (still ALPHA) mISDN driver from cvs.isdn4linux.de. This driver had a problem with the pci_register_driver return code changes in 2.6.10, it now always returns 0 (if no error), but 2.6.10 did return the number of detected devices, which was tested in this driver. This is fixed since last week in our CVS. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: 2.6.11-mm2
On Wed, Mar 09, 2005 at 01:20:46AM +0100, Adrian Bunk wrote: > On Tue, Mar 08, 2005 at 03:38:46AM -0800, Andrew Morton wrote: > >... > > Changes since 2.6.11-mm1: > >... > > +drivers-isdn-tpam-convert-to-pci_register_driver.patch > >... > > Little code tweaks. > >... > > Please drop this patch. > > Karsten has a patch ready to remove this driver (because the hardware it > was supposed to drive never went into production), and such patches only > cause needless rediffs. > > @Karsten: > Could you submit your patch to remove tpam to Andrew? > :-) already done few houres ago (against -mm2) -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: 2.6.11-mm2
On Wed, Mar 09, 2005 at 01:20:46AM +0100, Adrian Bunk wrote: On Tue, Mar 08, 2005 at 03:38:46AM -0800, Andrew Morton wrote: ... Changes since 2.6.11-mm1: ... +drivers-isdn-tpam-convert-to-pci_register_driver.patch ... Little code tweaks. ... Please drop this patch. Karsten has a patch ready to remove this driver (because the hardware it was supposed to drive never went into production), and such patches only cause needless rediffs. @Karsten: Could you submit your patch to remove tpam to Andrew? :-) already done few houres ago (against -mm2) -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 5/8] drivers/isdn/tpam/*: convert to pci_register_driver
On Sun, Mar 06, 2005 at 11:38:12PM +0100, [EMAIL PROTECTED] wrote: > > convert from pci_module_init to pci_register_driver > > Signed-off-by: Christophe Lucas <[EMAIL PROTECTED]> > Signed-off-by: Domen Puncer <[EMAIL PROTECTED]> > --- > > > kj-domen/drivers/isdn/tpam/tpam_main.c |2 +- > 1 files changed, 1 insertion(+), 1 deletion(-) > > diff -puN drivers/isdn/tpam/tpam_main.c~pci_register_driver-drivers_isdn_tpam > drivers/isdn/tpam/tpam_main.c > --- kj/drivers/isdn/tpam/tpam_main.c~pci_register_driver-drivers_isdn_tpam > 2005-03-05 16:12:25.0 +0100 > +++ kj-domen/drivers/isdn/tpam/tpam_main.c2005-03-05 16:12:25.0 > +0100 > @@ -278,7 +278,7 @@ static struct pci_driver tpam_driver = { > static int __init tpam_init(void) { > int ret; > > - ret = pci_module_init(_driver); > + ret = pci_register_driver(_driver); > if (ret) > return ret; > printk(KERN_INFO "TurboPAM: %d card%s found, driver loaded.\n", Note: All changes to code drivers/isdn/tpam are obsolate, since the code is obsolate and I already sent a complete remove patch. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [patch 1/8] isdn_bsdcomp.c - vfree() checking cleanups
On Mon, Mar 07, 2005 at 01:21:33AM +0100, Domen Puncer wrote: > On 07/03/05 00:07 +, Ralph Corderoy wrote: > > > > Hi Domen, > > > > > - if (db->dict) { > > > - vfree (db->dict); > > > - db->dict = NULL; > > > - } > > > + vfree (db->dict); > > > + db->dict = NULL; > > > > Is it really worth always calling vfree() which calls __vunmap() before > > db->dict is determined to be NULL in order to turn three lines into two? > > Four lines into two :-) > > > Plus the write to db->dict which might otherwise not be needed. The old > > code was clear, clean, and fast, no? > > Shorter and more readable code is always better, right? And speed really > doesn't seem to be an issue here. > I also prefer the old code, since it make clear, that you must be careful here, since the function can be called with already freed db->dict, and for me this version is not better readable as the old one. -- Karsten Keil SuSE Labs ISDN development - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/