diff options
author | des <des@FreeBSD.org> | 2003-03-03 09:14:26 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2003-03-03 09:14:26 +0000 |
commit | 021faa11ac3e8868e33ee981995319d77cba1b58 (patch) | |
tree | 328039d4f363f2179be4fe277b395b7f3e9d2d3f /sys/compat | |
parent | 0968a2b9642c2cbd0a4a82a8fcd1e16cd8f356de (diff) | |
download | FreeBSD-src-021faa11ac3e8868e33ee981995319d77cba1b58.zip FreeBSD-src-021faa11ac3e8868e33ee981995319d77cba1b58.tar.gz |
More caddr_t removal, in conjunction with copy{in,out}(9) this time.
Also clean up some egregious casts and incorrect use of sizeof.
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_file.c | 20 | ||||
-rw-r--r-- | sys/compat/linux/linux_ioctl.c | 81 | ||||
-rw-r--r-- | sys/compat/linux/linux_ipc.c | 6 | ||||
-rw-r--r-- | sys/compat/linux/linux_misc.c | 43 | ||||
-rw-r--r-- | sys/compat/linux/linux_socket.c | 8 | ||||
-rw-r--r-- | sys/compat/linux/linux_stats.c | 6 | ||||
-rw-r--r-- | sys/compat/linux/linux_sysctl.c | 2 | ||||
-rw-r--r-- | sys/compat/linux/linux_uid16.c | 6 |
8 files changed, 78 insertions, 94 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 2b37dcd..56b1fc8 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -191,7 +191,7 @@ linux_llseek(struct thread *td, struct linux_llseek_args *args) if ((error = lseek(td, &bsd_args))) return error; - if ((error = copyout(td->td_retval, (caddr_t)args->res, sizeof (off_t)))) + if ((error = copyout(td->td_retval, args->res, sizeof (off_t)))) return error; td->td_retval[0] = 0; @@ -980,7 +980,7 @@ fcntl_common(struct thread *td, struct linux_fcntl64_args *args) return (kern_fcntl(td, args->fd, F_SETFL, arg)); case LINUX_F_GETLK: - error = copyin((caddr_t)args->arg, &linux_flock, + error = copyin((void *)args->arg, &linux_flock, sizeof(linux_flock)); if (error) return (error); @@ -989,11 +989,11 @@ fcntl_common(struct thread *td, struct linux_fcntl64_args *args) if (error) return (error); bsd_to_linux_flock(&bsd_flock, &linux_flock); - return (copyout(&linux_flock, (caddr_t)args->arg, + return (copyout(&linux_flock, (void *)args->arg, sizeof(linux_flock))); case LINUX_F_SETLK: - error = copyin((caddr_t)args->arg, &linux_flock, + error = copyin((void *)args->arg, &linux_flock, sizeof(linux_flock)); if (error) return (error); @@ -1002,7 +1002,7 @@ fcntl_common(struct thread *td, struct linux_fcntl64_args *args) (intptr_t)&bsd_flock)); case LINUX_F_SETLKW: - error = copyin((caddr_t)args->arg, &linux_flock, + error = copyin((void *)args->arg, &linux_flock, sizeof(linux_flock)); if (error) return (error); @@ -1065,7 +1065,7 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_args *args) switch (args->cmd) { case LINUX_F_GETLK64: - error = copyin((caddr_t)args->arg, &linux_flock, + error = copyin((void *)args->arg, &linux_flock, sizeof(linux_flock)); if (error) return (error); @@ -1074,11 +1074,11 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_args *args) if (error) return (error); bsd_to_linux_flock64(&bsd_flock, &linux_flock); - return (copyout(&linux_flock, (caddr_t)args->arg, - sizeof(linux_flock))); + return (copyout(&linux_flock, (void *)args->arg, + sizeof(linux_flock))); case LINUX_F_SETLK64: - error = copyin((caddr_t)args->arg, &linux_flock, + error = copyin((void *)args->arg, &linux_flock, sizeof(linux_flock)); if (error) return (error); @@ -1087,7 +1087,7 @@ linux_fcntl64(struct thread *td, struct linux_fcntl64_args *args) (intptr_t)&bsd_flock)); case LINUX_F_SETLKW64: - error = copyin((caddr_t)args->arg, &linux_flock, + error = copyin((void *)args->arg, &linux_flock, sizeof(linux_flock)); if (error) return (error); diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index 1bcd729..2121845 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -123,7 +123,7 @@ linux_ioctl_disk(struct thread *td, struct linux_ioctl_args *args) fdrop(fp, td); if (error) return (error); - return (copyout(&(dl.d_secperunit), (caddr_t)args->arg, + return (copyout(&(dl.d_secperunit), (void *)args->arg, sizeof(dl.d_secperunit))); } fdrop(fp, td); @@ -571,11 +571,11 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) if (error) break; bsd_to_linux_termios(&bios, &lios); - error = copyout(&lios, (caddr_t)args->arg, sizeof(lios)); + error = copyout(&lios, (void *)args->arg, sizeof(lios)); break; case LINUX_TCSETS: - error = copyin((caddr_t)args->arg, &lios, sizeof(lios)); + error = copyin((void *)args->arg, &lios, sizeof(lios)); if (error) break; linux_to_bsd_termios(&lios, &bios); @@ -584,7 +584,7 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) break; case LINUX_TCSETSW: - error = copyin((caddr_t)args->arg, &lios, sizeof(lios)); + error = copyin((void *)args->arg, &lios, sizeof(lios)); if (error) break; linux_to_bsd_termios(&lios, &bios); @@ -593,7 +593,7 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) break; case LINUX_TCSETSF: - error = copyin((caddr_t)args->arg, &lios, sizeof(lios)); + error = copyin((void *)args->arg, &lios, sizeof(lios)); if (error) break; linux_to_bsd_termios(&lios, &bios); @@ -607,11 +607,11 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) if (error) break; bsd_to_linux_termio(&bios, &lio); - error = (copyout(&lio, (caddr_t)args->arg, sizeof(lio))); + error = (copyout(&lio, (void *)args->arg, sizeof(lio))); break; case LINUX_TCSETA: - error = copyin((caddr_t)args->arg, &lio, sizeof(lio)); + error = copyin((void *)args->arg, &lio, sizeof(lio)); if (error) break; linux_to_bsd_termio(&lio, &bios); @@ -620,7 +620,7 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) break; case LINUX_TCSETAW: - error = copyin((caddr_t)args->arg, &lio, sizeof(lio)); + error = copyin((void *)args->arg, &lio, sizeof(lio)); if (error) break; linux_to_bsd_termio(&lio, &bios); @@ -629,7 +629,7 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) break; case LINUX_TCSETAF: - error = copyin((caddr_t)args->arg, &lio, sizeof(lio)); + error = copyin((void *)args->arg, &lio, sizeof(lio)); if (error) break; linux_to_bsd_termio(&lio, &bios); @@ -773,13 +773,13 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) lss.type = LINUX_PORT_16550A; lss.flags = 0; lss.close_delay = 0; - error = copyout(&lss, (caddr_t)args->arg, sizeof(lss)); + error = copyout(&lss, (void *)args->arg, sizeof(lss)); break; } case LINUX_TIOCSSERIAL: { struct linux_serial_struct lss; - error = copyin((caddr_t)args->arg, &lss, sizeof(lss)); + error = copyin((void *)args->arg, &lss, sizeof(lss)); if (error) break; /* XXX - It really helps to have an implementation that @@ -843,7 +843,7 @@ linux_ioctl_termio(struct thread *td, struct linux_ioctl_args *args) fdrop(fp, td); return (EINVAL); } - error = (copyout(&linux_line, (caddr_t)args->arg, sizeof(int))); + error = (copyout(&linux_line, (void *)args->arg, sizeof(int))); break; } @@ -1319,7 +1319,7 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) if (!error) { lth.cdth_trk0 = th.starting_track; lth.cdth_trk1 = th.ending_track; - copyout(<h, (caddr_t)args->arg, sizeof(lth)); + copyout(<h, (void *)args->arg, sizeof(lth)); } break; } @@ -1338,7 +1338,7 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) lte.cdte_adr = irtse.entry.addr_type; bsd_to_linux_msf_lba(irtse.address_format, &irtse.entry.addr, <e.cdte_addr); - copyout(<e, (caddr_t)args->arg, sizeof(lte)); + copyout(<e, (void *)args->arg, sizeof(lte)); } break; } @@ -1365,19 +1365,17 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) struct ioc_read_subchannel bsdsc; struct cd_sub_channel_info *bsdinfo; caddr_t sg = stackgap_init(); - bsdinfo = (struct cd_sub_channel_info*)stackgap_alloc(&sg, - sizeof(struct cd_sub_channel_info)); + bsdinfo = stackgap_alloc(&sg, sizeof(*bsdinfo)); bsdsc.address_format = CD_LBA_FORMAT; bsdsc.data_format = CD_CURRENT_POSITION; bsdsc.track = 0; - bsdsc.data_len = sizeof(struct cd_sub_channel_info); + bsdsc.data_len = sizeof(*bsdinfo); bsdsc.data = bsdinfo; error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc, td->td_ucred, td); if (error) break; - error = copyin((caddr_t)args->arg, &sc, - sizeof(struct linux_cdrom_subchnl)); + error = copyin((void *)args->arg, &sc, sizeof(sc)); if (error) break; sc.cdsc_audiostatus = bsdinfo->header.audio_status; @@ -1389,8 +1387,7 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) bsdinfo->what.position.absaddr.lba); set_linux_cdrom_addr(&sc.cdsc_reladdr, sc.cdsc_format, bsdinfo->what.position.reladdr.lba); - error = copyout(&sc, (caddr_t)args->arg, - sizeof(struct linux_cdrom_subchnl)); + error = copyout(&sc, (void *)args->arg, sizeof(sc)); break; } @@ -1401,7 +1398,7 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) struct l_cdrom_read_audio lra; struct ioc_read_audio bra; - error = copyin((caddr_t)args->arg, &lra, sizeof(lra)); + error = copyin((void *)args->arg, &lra, sizeof(lra)); if (error) break; bra.address_format = lra.addr_format; @@ -1450,7 +1447,7 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) l_dvd_struct lds; struct dvd_struct bds; - error = copyin((caddr_t)args->arg, &lds, sizeof(l_dvd_struct)); + error = copyin((void *)args->arg, &lds, sizeof(lds)); if (error) break; error = linux_to_bsd_dvd_struct(&lds, &bds); @@ -1463,8 +1460,7 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) error = bsd_to_linux_dvd_struct(&bds, &lds); if (error) break; - error = copyout(&lds, (caddr_t)args->arg, - sizeof(l_dvd_struct)); + error = copyout(&lds, (void *)args->arg, sizeof(lds)); break; } @@ -1475,8 +1471,7 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) struct dvd_authinfo bda; int bcode; - error = copyin((caddr_t)args->arg, &lda, - sizeof(l_dvd_authinfo)); + error = copyin((void *)args->arg, &lda, sizeof(lda)); if (error) break; error = linux_to_bsd_dvd_authinfo(&lda, &bcode, &bda); @@ -1487,16 +1482,14 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioctl_args *args) if (error) { if (lda.type == LINUX_DVD_HOST_SEND_KEY2) { lda.type = LINUX_DVD_AUTH_FAILURE; - copyout(&lda, (caddr_t)args->arg, - sizeof(l_dvd_authinfo)); + copyout(&lda, (void *)args->arg, sizeof(lda)); } break; } error = bsd_to_linux_dvd_authinfo(&bda, &lda); if (error) break; - error = copyout(&lda, (caddr_t)args->arg, - sizeof(l_dvd_authinfo)); + error = copyout(&lda, (void *)args->arg, sizeof(lda)); break; } @@ -1604,7 +1597,7 @@ linux_ioctl_sound(struct thread *td, struct linux_ioctl_args *args) case LINUX_OSS_GETVERSION: { int version = linux_get_oss_version(td->td_proc); - return (copyout(&version, (caddr_t)args->arg, sizeof(int))); + return (copyout(&version, (void *)args->arg, sizeof(int))); } case LINUX_SOUND_MIXER_READ_STEREODEVS: @@ -1980,7 +1973,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) struct uio uio; int error, ethno; - error = copyin(uifc, &ifc, sizeof ifc); + error = copyin(uifc, &ifc, sizeof(ifc)); if (error != 0) return (error); @@ -2004,7 +1997,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) if (uio.uio_resid <= 0) break; - bzero(&ifr, sizeof ifr); + bzero(&ifr, sizeof(ifr)); if (IFP_IS_ETH(ifp)) snprintf(ifr.ifr_name, LINUX_IFNAMSIZ, "eth%d", ethno++); @@ -2024,7 +2017,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) memcpy(ifr.ifr_addr.sa_data, sa->sa_data, sizeof(ifr.ifr_addr.sa_data)); - error = uiomove(&ifr, sizeof ifr, &uio); + error = uiomove(&ifr, sizeof(ifr), &uio); if (error != 0) { IFNET_RUNLOCK(); return (error); @@ -2035,7 +2028,7 @@ linux_ifconf(struct thread *td, struct ifconf *uifc) IFNET_RUNLOCK(); ifc.ifc_len -= uio.uio_resid; - error = copyout(&ifc, uifc, sizeof ifc); + error = copyout(&ifc, uifc, sizeof(ifc)); return (error); } @@ -2055,7 +2048,7 @@ linux_gifflags(struct thread *td, struct ifnet *ifp, struct l_ifreq *ifr) flags |= 0x1000; } - return (copyout(&flags, &ifr->ifr_flags, sizeof flags)); + return (copyout(&flags, &ifr->ifr_flags, sizeof(flags))); } #define ARPHRD_ETHER 1 @@ -2069,9 +2062,9 @@ linux_gifhwaddr(struct ifnet *ifp, struct l_ifreq *ifr) struct l_sockaddr lsa; if (ifp->if_type == IFT_LOOP) { - bzero(&lsa, sizeof lsa); + bzero(&lsa, sizeof(lsa)); lsa.sa_family = ARPHRD_LOOPBACK; - return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof lsa)); + return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); } if (ifp->if_type != IFT_ETHER) @@ -2081,10 +2074,10 @@ linux_gifhwaddr(struct ifnet *ifp, struct l_ifreq *ifr) sdl = (struct sockaddr_dl*)ifa->ifa_addr; if (sdl != NULL && (sdl->sdl_family == AF_LINK) && (sdl->sdl_type == IFT_ETHER)) { - bzero(&lsa, sizeof lsa); + bzero(&lsa, sizeof(lsa)); lsa.sa_family = ARPHRD_ETHER; bcopy(LLADDR(sdl), lsa.sa_data, LINUX_IFHWADDRLEN); - return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof lsa)); + return (copyout(&lsa, &ifr->ifr_hwaddr, sizeof(lsa))); } } @@ -2157,7 +2150,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) case LINUX_SIOCDEVPRIVATE: case LINUX_SIOCDEVPRIVATE+1: /* copy in the interface name and translate it. */ - error = copyin((char *)args->arg, lifname, LINUX_IFNAMSIZ); + error = copyin((void *)args->arg, lifname, LINUX_IFNAMSIZ); if (error != 0) return (error); #ifdef DEBUG @@ -2173,7 +2166,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) * the ifreq to be in user space and have the correct * interface name. */ - error = copyout(ifname, (char *)args->arg, IFNAMSIZ); + error = copyout(ifname, (void *)args->arg, IFNAMSIZ); if (error != 0) return (error); #ifdef DEBUG @@ -2303,7 +2296,7 @@ linux_ioctl_socket(struct thread *td, struct linux_ioctl_args *args) if (ifp != NULL) /* restore the original interface name */ - copyout(lifname, (char *)args->arg, LINUX_IFNAMSIZ); + copyout(lifname, (void *)args->arg, LINUX_IFNAMSIZ); #ifdef DEBUG printf("%s(): returning %d\n", __func__, error); diff --git a/sys/compat/linux/linux_ipc.c b/sys/compat/linux/linux_ipc.c index 6dd21eb..1a6d3d7 100644 --- a/sys/compat/linux/linux_ipc.c +++ b/sys/compat/linux/linux_ipc.c @@ -545,8 +545,8 @@ linux_semctl(struct thread *td, struct linux_semctl_args *args) linux_seminfo.semusz = used_semids; linux_seminfo.semaem = used_sems; */ - error = copyout((caddr_t)&linux_seminfo, (caddr_t)args->arg.buf, - sizeof(linux_seminfo) ); + error = copyout(&linux_seminfo, args->arg.buf, + sizeof(linux_seminfo)); if (error) return error; td->td_retval[0] = seminfo.semmni; @@ -665,7 +665,7 @@ linux_shmat(struct thread *td, struct linux_shmat_args *args) if ((error = shmat(td, &bsd_args))) return error; #ifdef __i386__ - if ((error = copyout(td->td_retval, (caddr_t)args->raddr, sizeof(l_ulong)))) + if ((error = copyout(td->td_retval, args->raddr, sizeof(l_ulong)))) return error; td->td_retval[0] = 0; #endif diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index b5057ec..c2130db 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -154,7 +154,7 @@ linux_sysinfo(struct thread *td, struct linux_sysinfo_args *args) sysinfo.procs = 20; /* Hack */ - return copyout(&sysinfo, (caddr_t)args->info, sizeof(sysinfo)); + return copyout(&sysinfo, args->info, sizeof(sysinfo)); } #endif /*!__alpha__*/ @@ -414,8 +414,8 @@ linux_uselib(struct thread *td, struct linux_uselib_args *args) goto cleanup; /* copy from kernel VM space to user space */ - error = copyout((caddr_t)(uintptr_t)(buffer + file_offset), - (caddr_t)vmaddr, a_out->a_text + a_out->a_data); + error = copyout((void *)(buffer + file_offset), + (void *)vmaddr, a_out->a_text + a_out->a_data); /* release temporary kernel space */ vm_map_remove(kernel_map, buffer, buffer + @@ -490,8 +490,7 @@ linux_select(struct thread *td, struct linux_select_args *args) * time left. */ if (args->timeout) { - if ((error = copyin((caddr_t)args->timeout, &utv, - sizeof(utv)))) + if ((error = copyin(args->timeout, &utv, sizeof(utv)))) goto select_out; #ifdef DEBUG if (ldebug(select)) @@ -555,8 +554,7 @@ linux_select(struct thread *td, struct linux_select_args *args) printf(LMSG("outgoing timeout (%ld/%ld)"), utv.tv_sec, utv.tv_usec); #endif - if ((error = copyout(&utv, (caddr_t)args->timeout, - sizeof(utv)))) + if ((error = copyout(&utv, args->timeout, sizeof(utv)))) goto select_out; } @@ -634,7 +632,7 @@ linux_time(struct thread *td, struct linux_time_args *args) microtime(&tv); tm = tv.tv_sec; - if (args->tm && (error = copyout(&tm, (caddr_t)args->tm, sizeof(tm)))) + if (args->tm && (error = copyout(&tm, args->tm, sizeof(tm)))) return error; td->td_retval[0] = tm; return 0; @@ -679,7 +677,7 @@ linux_times(struct thread *td, struct linux_times_args *args) tms.tms_cutime = CONVTCK(td->td_proc->p_stats->p_cru.ru_utime); tms.tms_cstime = CONVTCK(td->td_proc->p_stats->p_cru.ru_stime); - if ((error = copyout(&tms, (caddr_t)args->buf, sizeof(tms)))) + if ((error = copyout(&tms, args->buf, sizeof(tms)))) return error; microuptime(&tv); @@ -710,7 +708,7 @@ linux_newuname(struct thread *td, struct linux_newuname_args *args) strlcpy(utsname.machine, machine, LINUX_MAX_UTSNAME); strlcpy(utsname.domainname, domainname, LINUX_MAX_UTSNAME); - return (copyout(&utsname, (caddr_t)args->buf, sizeof(utsname))); + return (copyout(&utsname, args->buf, sizeof(utsname))); } #if defined(__i386__) @@ -735,7 +733,7 @@ linux_utime(struct thread *td, struct linux_utime_args *args) #endif if (args->times) { - if ((error = copyin((caddr_t)args->times, &lut, sizeof lut))) { + if ((error = copyin(args->times, &lut, sizeof lut))) { LFREEPATH(fname); return error; } @@ -785,8 +783,7 @@ linux_waitpid(struct thread *td, struct linux_waitpid_args *args) return error; if (args->status) { - if ((error = copyin((caddr_t)args->status, &tmpstat, - sizeof(int))) != 0) + if ((error = copyin(args->status, &tmpstat, sizeof(int))) != 0) return error; tmpstat &= 0xffff; if (WIFSIGNALED(tmpstat)) @@ -795,7 +792,7 @@ linux_waitpid(struct thread *td, struct linux_waitpid_args *args) else if (WIFSTOPPED(tmpstat)) tmpstat = (tmpstat & 0xffff00ff) | (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8); - return copyout(&tmpstat, (caddr_t)args->status, sizeof(int)); + return copyout(&tmpstat, args->status, sizeof(int)); } return 0; @@ -836,8 +833,7 @@ linux_wait4(struct thread *td, struct linux_wait4_args *args) PROC_UNLOCK(td->td_proc); if (args->status) { - if ((error = copyin((caddr_t)args->status, &tmpstat, - sizeof(int))) != 0) + if ((error = copyin(args->status, &tmpstat, sizeof(int))) != 0) return error; tmpstat &= 0xffff; if (WIFSIGNALED(tmpstat)) @@ -846,7 +842,7 @@ linux_wait4(struct thread *td, struct linux_wait4_args *args) else if (WIFSTOPPED(tmpstat)) tmpstat = (tmpstat & 0xffff00ff) | (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8); - return copyout(&tmpstat, (caddr_t)args->status, sizeof(int)); + return copyout(&tmpstat, args->status, sizeof(int)); } return 0; @@ -913,7 +909,7 @@ linux_setitimer(struct thread *td, struct linux_setitimer_args *args) bsa.itv = (struct itimerval *)args->itv; bsa.oitv = (struct itimerval *)args->oitv; if (args->itv) { - if ((error = copyin((caddr_t)args->itv, &foo, sizeof(foo)))) + if ((error = copyin(args->itv, &foo, sizeof(foo)))) return error; #ifdef DEBUG if (ldebug(setitimer)) { @@ -965,8 +961,7 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args) ngrp = args->gidsetsize; if (ngrp >= NGROUPS) return (EINVAL); - error = copyin((caddr_t)args->grouplist, linux_gidset, - ngrp * sizeof(l_gid_t)); + error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); if (error) return (error); newcred = crget(); @@ -1039,7 +1034,7 @@ linux_getgroups(struct thread *td, struct linux_getgroups_args *args) ngrp++; } - if ((error = copyout(linux_gidset, (caddr_t)args->grouplist, + if ((error = copyout(linux_gidset, args->grouplist, ngrp * sizeof(l_gid_t)))) return (error); @@ -1069,7 +1064,7 @@ linux_setrlimit(struct thread *td, struct linux_setrlimit_args *args) if (which == -1) return (EINVAL); - error = copyin((caddr_t)args->rlim, &rlim, sizeof(rlim)); + error = copyin(args->rlim, &rlim, sizeof(rlim)); if (error) return (error); @@ -1106,7 +1101,7 @@ linux_old_getrlimit(struct thread *td, struct linux_old_getrlimit_args *args) rlim.rlim_max = (unsigned long)bsd_rlp->rlim_max; if (rlim.rlim_max == ULONG_MAX) rlim.rlim_max = LONG_MAX; - return (copyout(&rlim, (caddr_t)args->rlim, sizeof(rlim))); + return (copyout(&rlim, args->rlim, sizeof(rlim))); } int @@ -1133,7 +1128,7 @@ linux_getrlimit(struct thread *td, struct linux_getrlimit_args *args) rlim.rlim_cur = (l_ulong)bsd_rlp->rlim_cur; rlim.rlim_max = (l_ulong)bsd_rlp->rlim_max; - return (copyout(&rlim, (caddr_t)args->rlim, sizeof(rlim))); + return (copyout(&rlim, args->rlim, sizeof(rlim))); } #endif /*!__alpha__*/ diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 63dfb97..7e7d3fc 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -116,7 +116,7 @@ do_sa_get(struct sockaddr **sap, const struct osockaddr *osa, int *osalen, MALLOC(kosa, struct osockaddr *, alloclen, mtype, M_WAITOK); - if ((error = copyin(osa, (caddr_t) kosa, *osalen))) + if ((error = copyin(osa, kosa, *osalen))) goto out; bdom = linux_to_bsd_domain(kosa->sa_family); @@ -365,7 +365,7 @@ linux_sa_put(struct osockaddr *osa) * Only read/write the osockaddr family part, the rest is * not changed. */ - error = copyin((caddr_t) osa, (caddr_t) &sa, sizeof(sa.sa_family)); + error = copyin(osa, &sa, sizeof(sa.sa_family)); if (error) return (error); @@ -1002,7 +1002,7 @@ linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args) if ((error = copyin(args, &linux_args, sizeof(linux_args)))) return (error); - error = copyin(linux_args.msg, (caddr_t) &msg, sizeof(msg)); + error = copyin(linux_args.msg, &msg, sizeof(msg)); if (error) return (error); @@ -1085,7 +1085,7 @@ linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args) if (error) return (error); - error = copyin((caddr_t)linux_args.msg, (caddr_t)&msg, sizeof(msg)); + error = copyin(linux_args.msg, &msg, sizeof(msg)); if (error) return (error); if (msg.msg_name && msg.msg_namelen > 2) diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index d02186f..dcb15cf 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -269,8 +269,7 @@ linux_statfs(struct thread *td, struct linux_statfs_args *args) linux_statfs.f_fsid.val[0] = bsd_statfs->f_fsid.val[0]; linux_statfs.f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs.f_namelen = MAXNAMLEN; - return copyout((caddr_t)&linux_statfs, (caddr_t)args->buf, - sizeof(linux_statfs)); + return copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); } int @@ -314,8 +313,7 @@ linux_fstatfs(struct thread *td, struct linux_fstatfs_args *args) linux_statfs.f_fsid.val[0] = bsd_statfs->f_fsid.val[0]; linux_statfs.f_fsid.val[1] = bsd_statfs->f_fsid.val[1]; linux_statfs.f_namelen = MAXNAMLEN; - error = copyout((caddr_t)&linux_statfs, (caddr_t)args->buf, - sizeof(linux_statfs)); + error = copyout(&linux_statfs, args->buf, sizeof(linux_statfs)); fdrop(fp, td); return error; } diff --git a/sys/compat/linux/linux_sysctl.c b/sys/compat/linux/linux_sysctl.c index 699b5d6..4e08402 100644 --- a/sys/compat/linux/linux_sysctl.c +++ b/sys/compat/linux/linux_sysctl.c @@ -85,7 +85,7 @@ linux_sysctl(struct thread *td, struct linux_sysctl_args *args) l_int *mib; int error, i; - error = copyin((caddr_t)args->args, &la, sizeof(la)); + error = copyin(args->args, &la, sizeof(la)); if (error) return (error); diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c index 4c8793d..3059e89 100644 --- a/sys/compat/linux/linux_uid16.c +++ b/sys/compat/linux/linux_uid16.c @@ -101,8 +101,7 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args) ngrp = args->gidsetsize; if (ngrp >= NGROUPS) return (EINVAL); - error = copyin((caddr_t)args->gidset, linux_gidset, - ngrp * sizeof(l_gid16_t)); + error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); if (error) return (error); newcred = crget(); @@ -180,8 +179,7 @@ linux_getgroups16(struct thread *td, struct linux_getgroups16_args *args) ngrp++; } - error = copyout(linux_gidset, (caddr_t)args->gidset, - ngrp * sizeof(l_gid16_t)); + error = copyout(linux_gidset, args->gidset, ngrp * sizeof(l_gid16_t)); if (error) return (error); |