linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denis Efremov <efremov@linux.com>
To: Willy Tarreau <w@1wt.eu>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
	Ian Molton <spyro@f2s.com>, Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH v2 0/6] floppy: make use of the local/global fdc explicit
Date: Sun, 8 Mar 2020 16:12:22 +0300	[thread overview]
Message-ID: <e925dc3d-53d3-b656-8c17-470ada66f3f7@linux.com> (raw)
In-Reply-To: <20200301195555.11154-1-w@1wt.eu>

Hi,

On 3/1/20 10:55 PM, Willy Tarreau wrote:
> This is an update to the first minimal cleanup of the floppy driver in
> order to make use of the FDC number explicit so as to avoid bugs like
> the one fixed by 2e90ca68 ("floppy: check FDC index for errors before
> assigning it").
> 
> The purpose of this patchset is to rename the "fdc" global variable to
> "current_fdc" as Linus suggested and adjust the macros which rely on it
> depending on their context.
> 
> The most problematic part at this step are the FD_* macros derived
> from FD_IOPORT, itself referencing the fdc to get its base address.
> These are exclusively used by fd_outb() and fd_inb(). However on ARM
> FD_DOR is also used to compare the register based on the port, hence
> a small change in the ARM specific code to only check the register
> without relying on this hidden memory access.
> 
> In order to avoid touching the fd_outb() and fd_inb() macros/functions
> on all supported architectures, a new set of fdc_outb()/fdc_inb()
> functions was added to the driver to call the former after adding
> the register to the FDC's base address.
> 
> There are still opportunities for more cleanup, though it's uncertain
> they're welcome in this old driver :
>   - the base address and register can be passed separately to fd_outb()
>     and fd_inb() in order to simplify register retrieval in some archs;
> 
>   - a dozen of functions in the driver implicitly depend on current_fdc
>     while passing it as an argument makes the driver a bit more readable
>     but that represents less than half of the code and doesn't address
>     all the readability concerns;
> 
>   - a test was done to limit support to a single FDC, but after these
>     cleanups it doesn't provide any significant benefit in terms of code
>     readability.
> 
> These patches are to be applied on top of Denis' floppy-next branch.
> 
> v2:
>   - CC arch maintainers in ARM patches
>   - fixed issues after Denis' review:
>       - extra braces in floppy.h in declaration of floppy_selects[]
>       - missing parenthesis in fd_outb() macro to silence a warning
>       - used the swap() macro in driveswap()
> Willy Tarreau (6):

Applied, thanks!
https://github.com/evdenis/linux-floppy/commits/floppy-next

Ian, Russell, I hope you don't mind if these patches will go through
the single tree. If you have any comments, please, write.

Tested:
[x] Eye-checked the changes
[x] Checked that kernel builds after every commit on x86, arm (rpc_defconfig)
[x] Checked that there is no binary difference on x86
 
>   floppy: remove dead code for drives scanning on ARM
[x] Checked that there is no dead code left unnoticed

>   floppy: remove incomplete support for second FDC from ARM code
>   floppy: prepare ARM code to simplify base address separation
>   floppy: introduce new functions fdc_inb() and fdc_outb()
>   floppy: separate the FDC's base address from its registers
>   floppy: rename the global "fdc" variable to "current_fdc"
> 
>  arch/arm/include/asm/floppy.h |  88 ++-----------
>  drivers/block/floppy.c        | 284 ++++++++++++++++++++++--------------------
>  include/uapi/linux/fdreg.h    |  18 +--
>  3 files changed, 168 insertions(+), 222 deletions(-)
> 

Denis

      parent reply	other threads:[~2020-03-08 13:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 19:55 [PATCH v2 0/6] floppy: make use of the local/global fdc explicit Willy Tarreau
2020-03-01 19:55 ` [PATCH v2 1/6] floppy: remove dead code for drives scanning on ARM Willy Tarreau
2020-03-01 19:55 ` [PATCH v2 2/6] floppy: remove incomplete support for second FDC from ARM code Willy Tarreau
2020-03-01 19:55 ` [PATCH v2 3/6] floppy: prepare ARM code to simplify base address separation Willy Tarreau
2020-03-01 19:55 ` [PATCH v2 4/6] floppy: introduce new functions fdc_inb() and fdc_outb() Willy Tarreau
2020-03-01 19:55 ` [PATCH v2 5/6] floppy: separate the FDC's base address from its registers Willy Tarreau
2020-03-01 19:55 ` [PATCH v2 6/6] floppy: rename the global "fdc" variable to "current_fdc" Willy Tarreau
2020-03-01 20:33 ` [PATCH v2 0/6] floppy: make use of the local/global fdc explicit Joe Perches
2020-03-01 21:20   ` Willy Tarreau
2020-03-08 13:12 ` Denis Efremov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e925dc3d-53d3-b656-8c17-470ada66f3f7@linux.com \
    --to=efremov@linux.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=spyro@f2s.com \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).