Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp3646440pja; Tue, 31 Mar 2020 02:43:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvoVwPaluqcBFsaDABhUAvMYVgBriHDvC4mAquP6XEE2rV4MYe02qcdQnybA3dLgtpL7zLz X-Received: by 2002:a9d:8e4:: with SMTP id 91mr13129004otf.130.1585647835503; Tue, 31 Mar 2020 02:43:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585647835; cv=none; d=google.com; s=arc-20160816; b=aZ09JgyjxfmrXJJ9s/2wXFyVbcx+90O/sPS08X7SHu5ebcEAcfZPXQriLs69qqJXiT OAoVXLMnkSAddX7bOQ15lNqLctchPv8rcE7UpnfFyyD3n3LJfxNi3HGND1WX0ZK0F189 P/p1sws4wv/oKjTmZGzlb0SR5U4JHdq/SQJwR25NdiOnAS+nJy9V/cKug99GjdXEmEUW 8E8IU6EvCvNrzsoJsJkd2RWxLV9n7p4ZmDxwkzExmEeuRPX1vmBNY0t6d0sbnhoyPOSh XHdBMts7veKwbTJEAX4MCDVCk5Yksph9CHSGdNQeazSbGFBV5kRHmd99za+WU9IDtbjs +n8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=QeUo84wihzUqAGW2UKsrGCfyzCZin7oMCCqbJ4KFdWk=; b=oI8I9FYFkbK6GEW0an6DSocD0/rDHIruF/Zfh+eC15VLuH0MKJVXT6qkSpJAFRHGwF 2tHfh4w7R3QP3lXjU4zahzYJjP9fb3VyKyghqpGu35hnO01RtwFkHU9LMC1/3YGodRli T9HGf3ClTNE5EQ50XiPyQGQ73zimOPy+ffgbemSGf0TGq03pmEYy+xs8zWxJ4WxsYHxD +OESJ9wrD1AYUsHjXUdUFYrkDBBdagcSR75IPJIGb1ip7q7/yNFHgPbJW24joFvXJAfa q2NVPrWoZyE5P2/U0eANv7HAMvzCAO5iS7qHpU+lCK9nGckG704QcK+tx1zX2rR3Z52y 151w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si7060840otd.64.2020.03.31.02.43.43; Tue, 31 Mar 2020 02:43:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730446AbgCaJmX (ORCPT + 99 others); Tue, 31 Mar 2020 05:42:23 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:34154 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730217AbgCaJmX (ORCPT ); Tue, 31 Mar 2020 05:42:23 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 02V9f2nl024507; Tue, 31 Mar 2020 11:41:02 +0200 From: Willy Tarreau To: Denis Efremov Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Willy Tarreau , "David S. Miller" , Benjamin Herrenschmidt , Geert Uytterhoeven , Helge Deller , Ian Molton , Ivan Kokshaysky , Matt Turner , Richard Henderson , Russell King , Thomas Bogendoerfer , x86@kernel.org Subject: [PATCH 00/23] Floppy driver cleanups Date: Tue, 31 Mar 2020 11:40:31 +0200 Message-Id: <20200331094054.24441-1-w@1wt.eu> X-Mailer: git-send-email 2.9.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series applies a second batch of cleanups to the floppy driver and its multiple arch-specific parts. Here the focus was on getting rid of hard-coded registers and flags values to switch to their symbolic definitions instead, and on making use of the global current_fdc variable much more explicit throughout the code to reduce the risk of accidental misuse as was the case with the most recently fixed bug. Note that this code base is very old and the purpose is not to rewrite nor reorganize the driver at all, but instead to make certain things more obvious while keeping changes reviewable. It does not even address style issues that make checkpatch continue to complain a little bit (15 total warnings which were already there and don't seem worth addressing without more careful testing). Some comments were added to document a few non-obvious assumptions though. This series was rediffed against today's master (458ef2a25e0c) which contains the first series. The changes were tested on x86 with real hardware, and was build-tested on ARM. Willy Tarreau (23): floppy: split the base port from the register in I/O accesses floppy: add references to 82077's extra registers floppy: use symbolic register names in the m68k port floppy: use symbolic register names in the parisc port floppy: use symbolic register names in the powerpc port floppy: use symbolic register names in the sparc32 port floppy: use symbolic register names in the sparc64 port floppy: use symbolic register names in the x86 port floppy: cleanup: make twaddle() not rely on current_{fdc,drive} anymore floppy: cleanup: make reset_fdc_info() not rely on current_fdc anymore floppy: cleanup: make show_floppy() not rely on current_fdc anymore floppy: cleanup: make wait_til_ready() not rely on current_fdc anymore floppy: cleanup: make output_byte() not rely on current_fdc anymore floppy: cleanup: make result() not rely on current_fdc anymore floppy: cleanup: make need_more_output() not rely on current_fdc anymore floppy: cleanup: make perpendicular_mode() not rely on current_fdc anymore floppy: cleanup: make fdc_configure() not rely on current_fdc anymore floppy: cleanup: make fdc_specify() not rely on current_{fdc,drive} anymore floppy: cleanup: make check_wp() not rely on current_{fdc,drive} anymore floppy: cleanup: make next_valid_format() not rely on current_drive anymore floppy: cleanup: make get_fdc_version() not rely on current_fdc anymore floppy: cleanup: do not iterate on current_fdc in DMA grab/release functions floppy: cleanup: add a few comments about expectations in certain functions arch/alpha/include/asm/floppy.h | 4 +- arch/arm/include/asm/floppy.h | 8 +- arch/m68k/include/asm/floppy.h | 27 +- arch/mips/include/asm/mach-generic/floppy.h | 8 +- arch/mips/include/asm/mach-jazz/floppy.h | 8 +- arch/parisc/include/asm/floppy.h | 19 +- arch/powerpc/include/asm/floppy.h | 19 +- arch/sparc/include/asm/floppy_32.h | 50 +-- arch/sparc/include/asm/floppy_64.h | 59 ++-- arch/x86/include/asm/floppy.h | 19 +- drivers/block/floppy.c | 330 ++++++++++---------- include/uapi/linux/fdreg.h | 16 +- 12 files changed, 299 insertions(+), 268 deletions(-) Cc: "David S. Miller" Cc: Benjamin Herrenschmidt Cc: Geert Uytterhoeven Cc: Helge Deller Cc: Ian Molton Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Richard Henderson Cc: Russell King Cc: Thomas Bogendoerfer Cc: x86@kernel.org -- 2.20.1