]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
floppy: Replace custom SZ_64K constant
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 25 Aug 2025 16:32:56 +0000 (18:32 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Aug 2025 20:46:42 +0000 (14:46 -0600)
There are only two headers using the K_64 custom constant. Moreover,
its usage tangles a code because the constant is defined in the C
file, while users are in the headers. Replace it with well defined
SZ_64K from sizes.h.

Acked-by: Helge Deller <deller@gmx.de>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250825163545.39303-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/parisc/include/asm/floppy.h
arch/x86/include/asm/floppy.h
drivers/block/floppy.c

index df20dbef3ada074d6a55371d49543e315f3ff1a5..f15b69fea901d0725586f0c9391d1eaf5eb54984 100644 (file)
@@ -8,9 +8,9 @@
 #ifndef __ASM_PARISC_FLOPPY_H
 #define __ASM_PARISC_FLOPPY_H
 
+#include <linux/sizes.h>
 #include <linux/vmalloc.h>
 
-
 /*
  * The DMA channel used by the floppy controller cannot access data at
  * addresses >= 16MB
@@ -20,7 +20,8 @@
  * floppy accesses go through the track buffer.
  */
 #define _CROSS_64KB(a,s,vdma) \
-(!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
+       (!(vdma) && \
+        ((unsigned long)(a) / SZ_64K != ((unsigned long)(a) + (s) - 1) / SZ_64K))
 
 #define SW fd_routine[use_virtual_dma&1]
 #define CSW fd_routine[can_use_virtual_dma & 1]
index e76cb74bbed223beb097068e37c9ebe43c3ff0ae..e7a244051c622799cbb1a9b1b2da5b504e743297 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef _ASM_X86_FLOPPY_H
 #define _ASM_X86_FLOPPY_H
 
+#include <linux/sizes.h>
 #include <linux/vmalloc.h>
 
 /*
@@ -22,7 +23,7 @@
  */
 #define _CROSS_64KB(a, s, vdma)                                                \
        (!(vdma) &&                                                     \
-        ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64))
+        ((unsigned long)(a) / SZ_64K != ((unsigned long)(a) + (s) - 1) / SZ_64K))
 
 #define SW fd_routine[use_virtual_dma & 1]
 #define CSW fd_routine[can_use_virtual_dma & 1]
index 24be0c2c4075c5c61e2ce976421e26edeeed3f69..d769a223fcc8b06dbde6526392106f04eacd29b5 100644 (file)
@@ -233,8 +233,6 @@ static unsigned short virtual_dma_port = 0x3f0;
 irqreturn_t floppy_interrupt(int irq, void *dev_id);
 static int set_dor(int fdc, char mask, char data);
 
-#define K_64   0x10000         /* 64KB */
-
 /* the following is the mask of allowed drives. By default units 2 and
  * 3 of both floppy controllers are disabled, because switching on the
  * motor of these drives causes system hangs on some PCI computers. drive