Re: [patch] RFC: Namespace-collision between SIM710 and 53C7,8XX

Richard Hirst (richard@sleepie.demon.co.uk)
Tue, 19 Oct 1999 01:11:39 +0100


On Sun, Oct 17, 1999 at 04:25:35PM +0200, Arjan van de Ven wrote:
> Hi,
>
> The SIM710 and 53C7,8XX scsi-drivers have a very bad case of
> namespace-collision. The following patch at least lets the drivers
> compile, but the change is rather big to do without someone testing it.
> Could you (anyone?) give feedback on the patch below?
> (patch against 2.3.22)

Thanks to Alan for the __attribute((unused)) pointer, here is a patch
to cleanly resolve this problem. It should apply cleanly to 2.2.x also.

Richard

--- linux-2.3.22clean/drivers/scsi/script_asm.pl Mon Oct 18 22:52:21 1999
+++ linux-2.3.22/drivers/scsi/script_asm.pl Tue Oct 19 00:51:34 1999
@@ -896,7 +896,7 @@
open (OUTPUT, ">$output") || die "$0 : can't open $output for writing\n";
open (OUTPUTU, ">$outputu") || die "$0 : can't open $outputu for writing\n";

-print OUTPUT "u32 ".$prefix."SCRIPT[] = {\n";
+print OUTPUT "static u32 ".$prefix."SCRIPT[] = {\n";
$instructions = 0;
for ($i = 0; $i < $#code; ) {
if ($list_in_array) {
@@ -935,7 +935,7 @@
}
printf OUTPUTU "#undef A_$i\n";

- printf OUTPUT "u32 A_".$i."_used\[\] = {\n";
+ printf OUTPUT "static u32 A_".$i."_used\[\] __attribute((unused)) = {\n";
printf STDERR "$i is used $symbol_references{$i}\n" if ($debug);
foreach $j (split (/\s+/,$symbol_references{$i})) {
$j =~ /(ABS|REL),(.*),(.*)/;
@@ -957,15 +957,15 @@
# NCR assembler outputs label patches in the form of indices into
# the code.
#
-printf OUTPUT "u32 ".$prefix."LABELPATCHES[] = {\n";
+printf OUTPUT "static u32 ".$prefix."LABELPATCHES[] __attribute((unused)) = {\n";
for $patch (sort {$a <=> $b} @label_patches) {
printf OUTPUT "\t0x%08x,\n", $patch;
}
printf OUTPUT "};\n\n";

$num_external_patches = 0;
-printf OUTPUT "struct {\n\tu32\toffset;\n\tvoid\t\t*address;\n".
- "} ".$prefix."EXTERNAL_PATCHES[] = {\n";
+printf OUTPUT "static struct {\n\tu32\toffset;\n\tvoid\t\t*address;\n".
+ "} ".$prefix."EXTERNAL_PATCHES[] __attribute((unused)) = {\n";
while ($ident = pop(@external_patches)) {
$off = pop(@external_patches);
printf OUTPUT "\t{0x%08x, &%s},\n", $off, $ident;
@@ -973,11 +973,11 @@
}
printf OUTPUT "};\n\n";

-printf OUTPUT "u32 ".$prefix."INSTRUCTIONS\t= %d;\n",
+printf OUTPUT "static u32 ".$prefix."INSTRUCTIONS __attribute((unused))\t= %d;\n",
$instructions;
-printf OUTPUT "u32 ".$prefix."PATCHES\t= %d;\n",
+printf OUTPUT "static u32 ".$prefix."PATCHES __attribute((unused))\t= %d;\n",
$#label_patches+1;
-printf OUTPUT "u32 ".$prefix."EXTERNAL_PATCHES_LEN\t= %d;\n",
+printf OUTPUT "static u32 ".$prefix."EXTERNAL_PATCHES_LEN __attribute((unused))\t= %d;\n",
$num_external_patches;
close OUTPUT;
close OUTPUTU;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/