Re: [PATCH v2 1/3] floppy: add FD_AUTODETECT_SIZE define for struct floppy_drive_params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2020-04-26 at 16:07 +0300, Denis Efremov wrote:
> Use FD_AUTODETECT_SIZE for autodetect buffer size in struct
> floppy_drive_params instead of a magic number.

trivia:

> diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
[]
> @@ -2076,7 +2076,8 @@ static int next_valid_format(int drive)
>  
>  	probed_format = drive_state[drive].probed_format;
>  	while (1) {
> -		if (probed_format >= 8 || !drive_params[drive].autodetect[probed_format]) {
> +		if (probed_format >= FD_AUTODETECT_SIZE ||
> +			!drive_params[drive].autodetect[probed_format]) {

floppy.c almost exclusively uses multi-line statement
alignment to open parenthesis.  It'd be nicer to keep
using that style.


>  			drive_state[drive].probed_format = 0;
>  			return 1;
>  		}
> @@ -3445,13 +3446,13 @@ static int fd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
>  	return 0;
>  }
>  
> -static bool valid_floppy_drive_params(const short autodetect[8],
> +static bool valid_floppy_drive_params(const short autodetect[FD_AUTODETECT_SIZE],
>  		int native_format)
> 




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux