Skip to contentSkip to conversation

2.6.13 - 1/3 - Remove the deprecated function __check_region

PATCH In review Stephane Wirtel 3 participants 9 messages Aug 30, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.6.13 - 1/3 - Remove the deprecated function __check_region

Hi all,

Here is the first patch for kernel 2.6.13 from Linus tree.

Signature · 2 lines
Stephane Wirtel <[email protected]>
                <[email protected]>
kernel/resource.c +0 -15
@@ -465,21 +465,6 @@ struct resource * __request_region(struc
 
 EXPORT_SYMBOL(__request_region);
 
-int __deprecated __check_region(struct resource *parent, unsigned long start, unsigned long n)
-{
-	struct resource * res;
-
-	res = __request_region(parent, start, n, "check-region");
-	if (!res)
-		return -EBUSY;
-
-	release_resource(res);
-	kfree(res);
-	return 0;
-}
-
-EXPORT_SYMBOL(__check_region);
-
 void __release_region(struct resource *parent, unsigned long start, unsigned long n)
 {
 	struct resource **p;
#2 lore raw
In reply to Stephane Wirtel
Quoted 4 lines · Stephane Wirtel

Hi all,

Here is the first patch for kernel 2.6.13 from Linus tree.

Take it easy. Don't kill __check_region() unless you first convert all users of it.
And by removing __check_region() you've just broken check_region() - There are still some drivers left that use check_region() and there's no reason to break them.

The right approach is to identify all users of check_region()/__check_region(), then submit patches to convert them to use request_region instead. *Then*, when there are no more in-kernel users left, submit patches to remove the deprecated functions.

Signature · 3 lines
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
#3 lore raw

Le Tuesday 30 August 2005 a 19:08, Jesper Juhl ecrivait:

Quoted 12 lines · Stephane Wirtel
Quoted 4 lines

Hi all,

Here is the first patch for kernel 2.6.13 from Linus tree.

Take it easy. Don't kill __check_region() unless you first convert all users of it.
And by removing __check_region() you've just broken check_region() - There are still some drivers left that use check_region() and there's no reason to break them.

Quoted 5 lines

The right approach is to identify all users of check_region()/__check_region(), then submit patches to convert them to use request_region instead. *Then*, when there are no more in-kernel users left, submit patches to remove the deprecated functions.

I know, I did not check with check_region, I will check all users of check_region and I hope to send a new patch in few days.

Thanks Jesper,

Signature · 2 lines
Stephane Wirtel <[email protected]>
                <[email protected]>
#4 lore raw
Quoted 13 lines · Stephane Wirtel

Le Tuesday 30 August 2005 a 19:08, Jesper Juhl ecrivait:

Quoted 12 lines · Stephane Wirtel
Quoted 4 lines

Hi all,

Here is the first patch for kernel 2.6.13 from Linus tree.

Take it easy. Don't kill __check_region() unless you first convert all users of it.
And by removing __check_region() you've just broken check_region() - There are still some drivers left that use check_region() and there's no reason to break them.

Quoted 9 lines
Quoted 5 lines

The right approach is to identify all users of check_region()/__check_region(), then submit patches to convert them to use request_region instead. *Then*, when there are no more in-kernel users left, submit patches to remove the deprecated functions.

I know, I did not check with check_region, I will check all users of check_region and I hope to send a new patch in few days.

Here's a quick list of suspects for you :

$ find ./ -name *.[ch] | xargs -i grep -H check_region {} | awk -F: {'print $1'} | sort | uniq
./arch/ppc/platforms/hdpu.c
./arch/sparc/kernel/pcic.c
./drivers/block/floppy.c
./drivers/cdrom/isp16.c
./drivers/cdrom/sbpcd.c
./drivers/char/amiserial.c
./drivers/char/riscom8.c
./drivers/char/specialix.c
./drivers/char/watchdog/pcwd.c
./drivers/ide/pci/trm290.c
./drivers/isdn/sc/init.c
./drivers/md/dm-raid1.c
./drivers/media/radio/radio-aimslab.c
./drivers/media/radio/radio-aztech.c
./drivers/media/radio/radio-cadet.c
./drivers/media/radio/radio-gemtek.c
./drivers/media/radio/radio-rtrack2.c
./drivers/media/radio/radio-sf16fmi.c
./drivers/media/radio/radio-sf16fmr2.c
./drivers/media/radio/radio-terratec.c
./drivers/media/radio/radio-typhoon.c
./drivers/media/radio/radio-zoltrix.c
./drivers/net/arcnet/com90io.c
./drivers/net/depca.c
./drivers/net/eepro.c
./drivers/net/lance.c
./drivers/net/lne390.c
./drivers/net/tlan.c
./drivers/pnp/resource.c
./drivers/sbus/char/display7seg.c
./drivers/scsi/BusLogic.c
./drivers/scsi/advansys.c
./drivers/scsi/eata.c
./drivers/scsi/u14-34f.c
./drivers/tc/zs.c
./include/asm-m68k/sun3xflop.h
./include/asm-m68knommu/ide.h
./include/asm-parisc/ide.h
./include/asm-sparc/floppy.h
./include/linux/ioport.h
./kernel/resource.c
./sound/oss/aci.c
./sound/oss/ad1816.c
./sound/oss/aedsp16.c
./sound/oss/opl3.c
./sound/oss/pss.c
./sound/oss/trident.c
./sound/oss/uart401.c
./sound/oss/wavefront.mod.c
./sound/oss/wavfront.c

And please test your patches before submitting them.

As a minimum compile test any code you change and any code impacted by your changes.
Also boot a kernel with the changes applied to make sure nothing blows up at runtime.
And if possible (if you have the hardware), test that the drivers still work properly. If you don't have hardware to test with then you can at least still try loading the drivers and see if they fail in a sane manner (no hardware detected) or if they blow up.

When submitting a patch, please always provide a description of what change the patch makes and why it makes sense to make that change. Also tell what level of testing the patch has seen - and remember to Cc: maintainers/authors of the code you change in addition to sending to the list.

And patches are generally preffered inline as opposed to attachments, as should be clear from the documents I pointed you at yesterday.

Signature · 1 line
 Jesper Juhl
#5 lore raw
Quoted 1 line · Jesper Juhl

Here's a quick list of suspects for you :

[snip]

Quoted 1 line

./sound/oss/trident.c

I'll take care of this one.

Cheers,
Muli

Signature · 2 lines
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/
#6 lore raw
Quoted 8 lines · Muli Ben-Yehuda
Quoted 1 line · Jesper Juhl

Here's a quick list of suspects for you :

[snip]

Quoted 1 line

./sound/oss/trident.c

I'll take care of this one.

... or maybe I won't. We've been using request_region()/release_region() since 2001 or so - your grep hit a comment to that effect.

Cheers,
Muli

Signature · 2 lines
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/
#7 lore raw
Quoted 6 lines · Muli Ben-Yehuda
Quoted 5 lines · Muli Ben-Yehuda
Quoted 1 line · Jesper Juhl

Here's a quick list of suspects for you :

[snip]

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

./sound/oss/trident.c

I'll take care of this one.

... or maybe I won't. We've been using request_region()/release_region() since 2001 or so - your grep hit a comment to that effect.

Heh, yeah, I guess it probably hit a few. It was just a quick list of suspects after all.

Signature · 3 lines
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
#8 lore raw
In reply to Jesper Juhl

On 8/30/05, Jesper Juhl <[email protected]> wrote:
[snip]

Quoted 2 lines

Here's a quick list of suspects for you :

Just a quick note: don't forget that regions reserved with request_region() have to be freed by release_region() when no longer needed.

Signature · 3 lines
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html