} else
fd_timeout.expires = jiffies + UDP->timeout;
add_timer(&fd_timeout);
- if (UDP->flags & FD_DEBUG) {
+ if (UDP->flags & FD_DEBUG)
DPRINT("reschedule timeout %s %d\n", message, marg);
- }
timeout_message = message;
}
if (is_selected(olddor, unit) && !is_selected(newdor, unit)) {
drive = REVDRIVE(fdc, unit);
#ifdef DCL_DEBUG
- if (UDP->flags & FD_DEBUG) {
+ if (UDP->flags & FD_DEBUG)
DPRINT("calling disk change from set_dor\n");
- }
#endif
disk_change(drive);
}
static void fd_watchdog(void)
{
#ifdef DCL_DEBUG
- if (DP->flags & FD_DEBUG) {
+ if (DP->flags & FD_DEBUG)
DPRINT("calling disk change from watchdog\n");
- }
#endif
if (disk_change(current_drive)) {
/* Convert step rate from microseconds to milliseconds and 4 bits */
srt = 16 - DIV_ROUND_UP(DP->srt * scale_dtr / 1000, NOMINAL_DTR);
- if (slow_floppy) {
+ if (slow_floppy)
srt = srt / 4;
- }
+
SUPBOUND(srt, 0xf);
INFBOUND(srt, 0);
blind_seek = 0;
#ifdef DCL_DEBUG
- if (DP->flags & FD_DEBUG) {
+ if (DP->flags & FD_DEBUG)
DPRINT("calling disk change from seek\n");
- }
#endif
if (!TESTF(FD_DISK_NEWCHANGE) &&
return;
#ifdef DCL_DEBUG
- if (DP->flags & FD_DEBUG) {
+ if (DP->flags & FD_DEBUG)
DPRINT("calling disk change from floppy_ready\n");
- }
#endif
if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) &&
disk_change(current_drive) && !DP->select_delay)
scandrives();
#ifdef DCL_DEBUG
- if (DP->flags & FD_DEBUG) {
+ if (DP->flags & FD_DEBUG)
DPRINT("setting NEWCHANGE in floppy_start\n");
- }
#endif
SETF(FD_DISK_NEWCHANGE);
floppy_ready();
dma_limit =
(MAX_DMA_ADDRESS -
((unsigned long)current_req->buffer)) >> 9;
- if ((unsigned long)max_size > dma_limit) {
+ if ((unsigned long)max_size > dma_limit)
max_size = dma_limit;
- }
/* 64 kb boundaries */
if (CROSS_64KB(current_req->buffer, max_size << 9))
max_size = (K_64 -
raw_cmd->cmd_count = 0;
cont = &poll_cont;
#ifdef DCL_DEBUG
- if (DP->flags & FD_DEBUG) {
+ if (DP->flags & FD_DEBUG)
DPRINT("setting NEWCHANGE in poll_drive\n");
- }
#endif
SETF(FD_DISK_NEWCHANGE);
WAIT(floppy_ready);
cont = &raw_cmd_cont;
ret = wait_til_done(floppy_start, 1);
#ifdef DCL_DEBUG
- if (DP->flags & FD_DEBUG) {
+ if (DP->flags & FD_DEBUG)
DPRINT("calling disk change from raw_cmd ioctl\n");
- }
#endif
if (ret != -EINTR && FDCS->reset)
* We do this in order to provide a means to eject floppy disks before
* installing the new fdutils package */
if (cmd == CDROMEJECT || /* CD-ROM eject */
- cmd == 0x6470 /* SunOS floppy eject */ ) {
+ cmd == 0x6470) { /* SunOS floppy eject */
DPRINT("obsolete eject ioctl\n");
DPRINT("please use floppycontrol --eject\n");
cmd = FDEJECT;
}
- /* convert the old style command into a new style command */
- if ((cmd & 0xff00) == 0x0200) {
- ECALL(normalize_ioctl(&cmd, &size));
- } else
+ if (!((cmd & 0xff00) == 0x0200))
return -EINVAL;
+ /* convert the old style command into a new style command */
+ ECALL(normalize_ioctl(&cmd, &size));
+
/* permission checks */
if (((cmd & 0x40) && !FD_IOCTL_ALLOWED) ||
((cmd & 0x80) && !capable(CAP_SYS_ADMIN)))
INFBOUND(try, 16);
tmp = (char *)fd_dma_mem_alloc(1024 * try);
}
- if (!tmp && !floppy_track_buffer) {
+ if (!tmp && !floppy_track_buffer)
fallback_on_nodma_alloc(&tmp, 2048 * try);
- }
if (!tmp && !floppy_track_buffer) {
DPRINT("Unable to allocate DMA memory\n");
goto out;