Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

floppy: Replace custom SZ_64K constant

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>

authored by

Andy Shevchenko and committed by
Jens Axboe
8e7ee0f6 d7496878

+5 -5
+3 -2
arch/parisc/include/asm/floppy.h
··· 8 8 #ifndef __ASM_PARISC_FLOPPY_H 9 9 #define __ASM_PARISC_FLOPPY_H 10 10 11 + #include <linux/sizes.h> 11 12 #include <linux/vmalloc.h> 12 - 13 13 14 14 /* 15 15 * The DMA channel used by the floppy controller cannot access data at ··· 20 20 * floppy accesses go through the track buffer. 21 21 */ 22 22 #define _CROSS_64KB(a,s,vdma) \ 23 - (!(vdma) && ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)) 23 + (!(vdma) && \ 24 + ((unsigned long)(a) / SZ_64K != ((unsigned long)(a) + (s) - 1) / SZ_64K)) 24 25 25 26 #define SW fd_routine[use_virtual_dma&1] 26 27 #define CSW fd_routine[can_use_virtual_dma & 1]
+2 -1
arch/x86/include/asm/floppy.h
··· 10 10 #ifndef _ASM_X86_FLOPPY_H 11 11 #define _ASM_X86_FLOPPY_H 12 12 13 + #include <linux/sizes.h> 13 14 #include <linux/vmalloc.h> 14 15 15 16 /* ··· 23 22 */ 24 23 #define _CROSS_64KB(a, s, vdma) \ 25 24 (!(vdma) && \ 26 - ((unsigned long)(a)/K_64 != ((unsigned long)(a) + (s) - 1) / K_64)) 25 + ((unsigned long)(a) / SZ_64K != ((unsigned long)(a) + (s) - 1) / SZ_64K)) 27 26 28 27 #define SW fd_routine[use_virtual_dma & 1] 29 28 #define CSW fd_routine[can_use_virtual_dma & 1]
-2
drivers/block/floppy.c
··· 233 233 irqreturn_t floppy_interrupt(int irq, void *dev_id); 234 234 static int set_dor(int fdc, char mask, char data); 235 235 236 - #define K_64 0x10000 /* 64KB */ 237 - 238 236 /* the following is the mask of allowed drives. By default units 2 and 239 237 * 3 of both floppy controllers are disabled, because switching on the 240 238 * motor of these drives causes system hangs on some PCI computers. drive