or other sanity checks, code reshuffling, or fixing broken behavior.
if (!(sub_dev_ptr->ExtraBuf = malloc(sub_dev_ptr->NrOfExtraBuffers *
sub_dev_ptr->DmaSize /
sub_dev_ptr->NrOfDmaFragments))) {
- error("%s failed to allocate extra buffer for channel %d\n",
- drv.DriverName,i);
+ error("%s failed to allocate extra buffer for a channel\n",
+ drv.DriverName);
return EIO;
}
if (*up != NO_OFFSET) break;
fp->fl_sector++;
}
- }
- if (r == OK && opcode == DEV_SCATTER_S) {
- /* Copy the user bytes to the DMA buffer. */
- if(proc_nr != SELF) {
- s=sys_safecopyfrom(proc_nr, *ug, *up,
- (vir_bytes) floppy_buf,
- (phys_bytes) SECTOR_SIZE, D);
- if(s != OK)
- panic("FLOPPY", "sys_safecopyfrom failed", s);
- } else {
- memcpy(floppy_buf, (void *) (*ug + *up), SECTOR_SIZE);
+ if (opcode == DEV_SCATTER_S) {
+ /* Copy the user bytes to the DMA buffer. */
+ if(proc_nr != SELF) {
+ s=sys_safecopyfrom(proc_nr, *ug, *up,
+ (vir_bytes) floppy_buf,
+ (phys_bytes) SECTOR_SIZE, D);
+ if(s != OK)
+ panic("FLOPPY", "sys_safecopyfrom failed", s);
+ } else {
+ memcpy(floppy_buf, (void *) (*ug + *up), SECTOR_SIZE);
+ }
}
}
case 'x':
case 'X':
case 'p': base = 16; break;
+ default: base = 10; break;
}
s = _i_compute(unsigned_val, base, s, precision);
case 'u': base = 10; break;
case 'o': base = 8; break;
case 'b': base = 2; break;
+ default: base = 10; break;
}
if (c == '-' || c == '+') {
if(!GRANT_VALID(gid))
return -1;
m_ptr->DS_VAL = gid;
- m_ptr->DS_VAL_LEN = length;
+ m_ptr->DS_VAL_LEN = dsp->u.map.length;
}
/* The caller requested a copy of a mapped mem range or a snapshot. */
/* Resolve a path string to an inode.
*/
ino_t dir_ino_nr, root_ino_nr;
- struct inode *cur_ino, *next_ino, *root_ino;
+ struct inode *cur_ino, *root_ino;
+ struct inode *next_ino = NIL_INODE;
struct hgfs_attr attr;
char buf[PATH_MAX], path[PATH_MAX];
char name[NAME_MAX+1];
tcp_conn_t *tcp_conn;
{
acc_t *pack2write, *tmp_pack, *tcp_pack;
- tcp_hdr_t *tcp_hdr;
- ip_hdr_t *ip_hdr;
+ tcp_hdr_t *tcp_hdr = NULL;
+ ip_hdr_t *ip_hdr = NULL;
int tot_hdr_size, ip_hdr_len, no_push, head, more2write;
u32_t seg_seq, seg_lo_data, queue_lo_data, seg_hi, seg_hi_data;
u16_t seg_up, mss;
return NULL;
}
+ assert( tcp_hdr != NULL );
+ assert( ip_hdr != NULL );
tcp_hdr->th_seq_nr= htonl(seg_seq);
tcp_hdr->th_ack_nr= htonl(tcp_conn->tc_RCV_NXT);
tcp_hdr->th_flags= seg_flags;
break;
case DEV_STATUS:
sr_status(&m->mq_mess);
+ result= OK; /* Satisfy lint. */
send_reply= 0;
free_mess= 1;
break;
struct sembuf *sops;
unsigned int nsops;
struct sem_struct *sem;
- int no_reply;
+ int no_reply = 0;
id = m->SEMOP_ID;
nsops = (unsigned int) m->SEMOP_SIZE;
}
/* there will be no errors left, so we can go ahead */
- no_reply = 0;
for (i = 0; i < nsops; i++) {
struct semaphore *s;
int op_n;
case TTY_PROC_NR:
result = do_fkey_pressed(&m_in);
break;
+ default:
+ /* FIXME: error message. */
+ result = EDONTREPLY;
+ break;
}
}
else {
if(old_ip != NIL_INODE)
odir = ((old_ip->i_mode & I_TYPE) == I_DIRECTORY); /* TRUE iff dir */
+ else
+ odir = FALSE; /* FIXME: is this a safe default? */
/* If it is ok, check for a variety of possible errors. */
if(r == OK) {
r = OK;
break;
+
+ default:
+ panic(__FILE__, "invalid timer type", m_in.which_timer);
}
/* If requested, copy the old interval timer to user space. */
PUBLIC int main(int argc, char **argv)
{
message m;
- int result;
+ int result = EXIT_SUCCESS;
int request;
int i;
char *label, *progname = NULL;
break;
default:
caught = 0;
+ error = 0; /* To satisfy lints. */
break;
}
if(caught) {