lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5a753f4c-5e30-ccf9-ab26-a3a1a1d7ff4c@linux.com>
Date:   Sat, 29 Feb 2020 19:38:56 +0300
From:   Denis Efremov <efremov@...ux.com>
To:     Willy Tarreau <w@....eu>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 12/16] floppy: remove incomplete support for second FDC
 from ARM code

Hi,

On 2/26/20 11:07 AM, Willy Tarreau wrote:
> The ARM code was written with the apparent hope to one day support
> a second FDC except that the code was incomplete and only touches
> the first one, which is also reflected by N_FDC==1. However this
> made its fd_outb() macro artificially depend on the global or local
> "fdc" variable.
> 
> Let's get rid of this and make it explicit it doesn't rely on this
> variable anymore.
> 
> Signed-off-by: Willy Tarreau <w@....eu>
> ---
>  arch/arm/include/asm/floppy.h | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/include/asm/floppy.h b/arch/arm/include/asm/floppy.h
> index 4655652..f683953 100644
> --- a/arch/arm/include/asm/floppy.h
> +++ b/arch/arm/include/asm/floppy.h
> @@ -50,17 +50,16 @@ static inline int fd_dma_setup(void *data, unsigned int length,
>   * to a non-zero track, and then restoring it to track 0.  If an error occurs,
>   * then there is no floppy drive present.       [to be put back in again]
>   */
> -static unsigned char floppy_selects[2][4] =
> +static unsigned char floppy_selects[4] =
>  {
>  	{ 0x10, 0x21, 0x23, 0x33 },
> -	{ 0x10, 0x21, 0x23, 0x33 }
>  };
>  

You need remove curly braces here, e.g.
static unsigned char floppy_selects[4] =
{
	0x10, 0x21, 0x23, 0x33
};

>  #define fd_setdor(dor)								\
>  do {										\
>  	int new_dor = (dor);							\
>  	if (new_dor & 0xf0)							\
> -		new_dor = (new_dor & 0x0c) | floppy_selects[fdc][new_dor & 3];	\
> +		new_dor = (new_dor & 0x0c) | floppy_selects[new_dor & 3];	\
>  	else									\
>  		new_dor &= 0x0c;						\
>  	outb(new_dor, FD_DOR);							\
> @@ -84,9 +83,9 @@ do {										\
>   */
>  static void driveswap(int *ints, int dummy, int dummy2)
>  {
> -	floppy_selects[0][0] ^= floppy_selects[0][1];
> -	floppy_selects[0][1] ^= floppy_selects[0][0];
> -	floppy_selects[0][0] ^= floppy_selects[0][1];
> +	floppy_selects[0] ^= floppy_selects[1];
> +	floppy_selects[1] ^= floppy_selects[0];
> +	floppy_selects[0] ^= floppy_selects[1];

What do you think about using swap macro (kernel.h) here?

>  }
>  
>  #define EXTRA_FLOPPY_PARAMS ,{ "driveswap", &driveswap, NULL, 0, 0 }
> 

Denis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ