]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
floppy: Remove unused CROSS_64KB() macro from arch/ code
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 25 Aug 2025 16:32:55 +0000 (18:32 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Aug 2025 20:46:42 +0000 (14:46 -0600)
Since the commit 3d86739c6343 ("floppy: always use the track buffer")
the CROSS_64KB() is not used by the driver, remove the leftovers.

Acked-by: Helge Deller <deller@gmx.de> #parisc
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> # m68k
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250825163545.39303-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/alpha/include/asm/floppy.h
arch/arm/include/asm/floppy.h
arch/m68k/include/asm/floppy.h
arch/mips/include/asm/floppy.h
arch/parisc/include/asm/floppy.h
arch/powerpc/include/asm/floppy.h
arch/sparc/include/asm/floppy_32.h
arch/sparc/include/asm/floppy_64.h
arch/x86/include/asm/floppy.h

index 64b42d9591fcd2aa486a3fa42abc6d56161163ea..5a6239e65097043c73c7e32104f25e3b5d7485cf 100644 (file)
@@ -90,25 +90,6 @@ static int FDC2 = -1;
 #define N_FDC 2
 #define N_DRIVE 8
 
-/*
- * Most Alphas have no problems with floppy DMA crossing 64k borders,
- * except for certain ones, like XL and RUFFIAN.
- *
- * However, the test is simple and fast, and this *is* floppy, after all,
- * so we do it for all platforms, just to make sure.
- *
- * This is advantageous in other circumstances as well, as in moving
- * about the PCI DMA windows and forcing the floppy to start doing
- * scatter-gather when it never had before, and there *is* a problem
- * on that platform... ;-}
- */
-
-static inline unsigned long CROSS_64KB(void *a, unsigned long s)
-{
-       unsigned long p = (unsigned long)a;
-       return ((p + s - 1) ^ p) & ~0xffffUL;
-}
-
 #define EXTRA_FLOPPY_PARAMS
 
 #endif /* __ASM_ALPHA_FLOPPY_H */
index e1cb04ed50081e8abca140134ab1f173038ca56c..e579f77162e9ebb2460be4a2ca03f58c1d49b6d7 100644 (file)
@@ -65,8 +65,6 @@ static unsigned char floppy_selects[4] = { 0x10, 0x21, 0x23, 0x33 };
 #define N_FDC 1
 #define N_DRIVE 4
 
-#define CROSS_64KB(a,s) (0)
-
 /*
  * This allows people to reverse the order of
  * fd0 and fd1, in case their hardware is
index a4d0fea47c6ba3abc6a8b372f3c03934ed0599ae..dea98bbc0932d5f6e73226fa452a94a0cb68552d 100644 (file)
@@ -107,13 +107,9 @@ static void fd_free_irq(void)
 
 #define fd_free_dma()             /* nothing */
 
-/* No 64k boundary crossing problems on Q40 - no DMA at all */
-#define CROSS_64KB(a,s) (0)
-
 #define DMA_MODE_READ  0x44    /* i386 look-alike */
 #define DMA_MODE_WRITE 0x48
 
-
 static int m68k_floppy_init(void)
 {
   use_virtual_dma =1;
index 021d09ae5670a1649f3766927826e342ec35deb3..44da2ff91f65218d1e79cd3eb36496097c179685 100644 (file)
@@ -34,21 +34,6 @@ static inline void fd_cacheflush(char * addr, long size)
 #define N_FDC 1                        /* do you *really* want a second controller? */
 #define N_DRIVE 8
 
-/*
- * The DMA channel used by the floppy controller cannot access data at
- * addresses >= 16MB
- *
- * Went back to the 1MB limit, as some people had problems with the floppy
- * driver otherwise. It doesn't matter much for performance anyway, as most
- * floppy accesses go through the track buffer.
- *
- * On MIPSes using vdma, this actually means that *all* transfers go thru
- * the * track buffer since 0x1000000 is always smaller than KSEG0/1.
- * Actually this needs to be a bit more complicated since the so much different
- * hardware available with MIPS CPUs ...
- */
-#define CROSS_64KB(a, s) ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)
-
 #define EXTRA_FLOPPY_PARAMS
 
 #include <floppy.h>
index b318a7df52f6793f36ebdc627f93516802b121fa..df20dbef3ada074d6a55371d49543e315f3ff1a5 100644 (file)
 #define _CROSS_64KB(a,s,vdma) \
 (!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
 
-#define CROSS_64KB(a,s) _CROSS_64KB(a,s,use_virtual_dma & 1)
-
-
 #define SW fd_routine[use_virtual_dma&1]
 #define CSW fd_routine[can_use_virtual_dma & 1]
 
-
 #define fd_inb(base, reg)              readb((base) + (reg))
 #define fd_outb(value, base, reg)      writeb(value, (base) + (reg))
 
@@ -206,7 +202,7 @@ static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
 static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
 {
 #ifdef FLOPPY_SANITY_CHECK
-       if (CROSS_64KB(addr, size)) {
+       if (_CROSS_64KB(addr, size, use_virtual_dma & 1)) {
                printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size);
                return -1;
        }
index 34abf8bea2ccd6d712f7c13839f626e3ee829f47..f4dc657638b365337d76cbeafba450ce01e89609 100644 (file)
@@ -206,11 +206,6 @@ static int FDC2 = -1;
 #define N_FDC 2                        /* Don't change this! */
 #define N_DRIVE 8
 
-/*
- * The PowerPC has no problems with floppy DMA crossing 64k borders.
- */
-#define CROSS_64KB(a,s)        (0)
-
 #define EXTRA_FLOPPY_PARAMS
 
 #endif /* __KERNEL__ */
index 836f6575aa1d71b1d2c118264e82979ea3cf1830..7251d1fed7a47fd669bbeb2cffd08cccde27221d 100644 (file)
@@ -96,9 +96,6 @@ static struct sun_floppy_ops sun_fdops;
 #define N_FDC    1
 #define N_DRIVE  8
 
-/* No 64k boundary crossing problems on the Sparc. */
-#define CROSS_64KB(a,s) (0)
-
 /* Routines unique to each controller type on a Sun. */
 static void sun_set_dor(unsigned char value, int fdc_82077)
 {
index b0f633ce35188b920762e8137f971fededd36cb0..135f9a49b6ba3b4dbc7528fa2f08813f85738f5a 100644 (file)
@@ -95,9 +95,6 @@ static int sun_floppy_types[2] = { 0, 0 };
 #define N_FDC    1
 #define N_DRIVE  8
 
-/* No 64k boundary crossing problems on the Sparc. */
-#define CROSS_64KB(a,s) (0)
-
 static unsigned char sun_82077_fd_inb(unsigned long base, unsigned int reg)
 {
        udelay(5);
index 6ec3fc969ad55c2e2286f7041f358151ff365f3c..e76cb74bbed223beb097068e37c9ebe43c3ff0ae 100644 (file)
@@ -24,9 +24,6 @@
        (!(vdma) &&                                                     \
         ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
 
-#define CROSS_64KB(a, s) _CROSS_64KB(a, s, use_virtual_dma & 1)
-
-
 #define SW fd_routine[use_virtual_dma & 1]
 #define CSW fd_routine[can_use_virtual_dma & 1]
 
@@ -206,7 +203,7 @@ static int vdma_dma_setup(char *addr, unsigned long size, int mode, int io)
 static int hard_dma_setup(char *addr, unsigned long size, int mode, int io)
 {
 #ifdef FLOPPY_SANITY_CHECK
-       if (CROSS_64KB(addr, size)) {
+       if (_CROSS_64KB(addr, size, use_virtual_dma & 1)) {
                printk("DMA crossing 64-K boundary %p-%p\n", addr, addr+size);
                return -1;
        }