Skip to content

Commit 6c94284

Browse files
tobluxandreas-gaisler
authored andcommitted
sparc: Use swap() to fix Coccinelle warning
Fixes the following Coccinelle/coccicheck warning reported by swap.cocci: WARNING opportunity for swap() Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Reviewed-by: Andreas Larsson <andreas@gaisler.com> Link: https://lore.kernel.org/r/20240404112313.11898-2-thorsten.blum@toblux.com Signed-off-by: Andreas Larsson <andreas@gaisler.com>
1 parent 839c4de commit 6c94284

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

arch/sparc/include/asm/floppy_64.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,7 @@ static unsigned long __init sun_floppy_init(void)
704704
ns87303_modify(config, ASC, ASC_DRV2_SEL, 0);
705705
ns87303_modify(config, FCR, 0, FCR_LDE);
706706

707-
config = sun_floppy_types[0];
708-
sun_floppy_types[0] = sun_floppy_types[1];
709-
sun_floppy_types[1] = config;
707+
swap(sun_floppy_types[0], sun_floppy_types[1]);
710708

711709
if (sun_pci_broken_drive != -1) {
712710
sun_pci_broken_drive = 1 - sun_pci_broken_drive;

0 commit comments

Comments
 (0)