Source-Changes-HG archive

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

[src/trunk]: src/sys/kern remove casts to the same type.



details:   https://anonhg.NetBSD.org/src/rev/8ae956d180be
branches:  trunk
changeset: 332459:8ae956d180be
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Sep 21 17:17:15 2014 +0000

description:
remove casts to the same type.

diffstat:

 sys/kern/kern_ctf.c     |   4 ++--
 sys/kern/kern_descrip.c |   6 +++---
 sys/kern/kern_ktrace.c  |   6 +++---
 sys/kern/kgdb_stub.c    |  12 ++++++------
 sys/kern/sys_process.c  |   6 +++---
 5 files changed, 17 insertions(+), 17 deletions(-)

diffs (139 lines):

diff -r e34a5f005bb7 -r 8ae956d180be sys/kern/kern_ctf.c
--- a/sys/kern/kern_ctf.c       Sun Sep 21 17:11:07 2014 +0000
+++ b/sys/kern/kern_ctf.c       Sun Sep 21 17:17:15 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_ctf.c,v 1.3 2010/05/03 09:51:36 darran Exp $      */
+/*     $NetBSD: kern_ctf.c,v 1.4 2014/09/21 17:17:15 christos Exp $    */
 /*-
  * Copyright (c) 2008 John Birrell <jb%freebsd.org@localhost>
  * All rights reserved.
@@ -204,7 +204,7 @@
                }
 
                zs.avail_in = ctfsize - CTF_HDR_SIZE;
-               zs.next_in = ((uint8_t *) ctfaddr) + CTF_HDR_SIZE;
+               zs.next_in = ctfaddr + CTF_HDR_SIZE;
                zs.avail_out = sz - CTF_HDR_SIZE;
                zs.next_out = ((uint8_t *) ctftab) + CTF_HDR_SIZE;
                inflateReset(&zs);
diff -r e34a5f005bb7 -r 8ae956d180be sys/kern/kern_descrip.c
--- a/sys/kern/kern_descrip.c   Sun Sep 21 17:11:07 2014 +0000
+++ b/sys/kern/kern_descrip.c   Sun Sep 21 17:17:15 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_descrip.c,v 1.227 2014/09/05 09:20:59 matt Exp $  */
+/*     $NetBSD: kern_descrip.c,v 1.228 2014/09/21 17:17:15 christos Exp $      */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.227 2014/09/05 09:20:59 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_descrip.c,v 1.228 2014/09/21 17:17:15 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1457,7 +1457,7 @@
        ffp = fdp->fd_dt->dt_ff;
        nffp = newdt->dt_ff;
        newlast = -1;
-       for (i = 0; i <= (int)lastfile; i++, ffp++, nffp++) {
+       for (i = 0; i <= lastfile; i++, ffp++, nffp++) {
                KASSERT(i >= NDFDFILE ||
                    *nffp == (fdfile_t *)newfdp->fd_dfdfile[i]);
                ff = *ffp;
diff -r e34a5f005bb7 -r 8ae956d180be sys/kern/kern_ktrace.c
--- a/sys/kern/kern_ktrace.c    Sun Sep 21 17:11:07 2014 +0000
+++ b/sys/kern/kern_ktrace.c    Sun Sep 21 17:17:15 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_ktrace.c,v 1.164 2013/12/09 16:45:23 pooka Exp $  */
+/*     $NetBSD: kern_ktrace.c,v 1.165 2014/09/21 17:17:15 christos Exp $       */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.164 2013/12/09 16:45:23 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.165 2014/09/21 17:17:15 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -930,7 +930,7 @@
        ktp->ktr_id[KTR_USER_MAXIDLEN-1] = '\0';
 
        user_dta = (void *)(ktp + 1);
-       if ((error = copyin(addr, (void *)user_dta, len)) != 0)
+       if ((error = copyin(addr, user_dta, len)) != 0)
                len = 0;
 
        ktraddentry(l, kte, KTA_WAITOK);
diff -r e34a5f005bb7 -r 8ae956d180be sys/kern/kgdb_stub.c
--- a/sys/kern/kgdb_stub.c      Sun Sep 21 17:11:07 2014 +0000
+++ b/sys/kern/kgdb_stub.c      Sun Sep 21 17:17:15 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kgdb_stub.c,v 1.27 2014/03/23 02:56:33 christos Exp $  */
+/*     $NetBSD: kgdb_stub.c,v 1.28 2014/09/21 17:17:15 christos Exp $  */
 
 /*
  * Copyright (c) 1990, 1993
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.27 2014/03/23 02:56:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.28 2014/09/21 17:17:15 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -465,9 +465,9 @@
                                kgdb_send("E05");
                                continue;
                        }
-                       db_read_bytes(addr, (size_t)len,
-                                       (char *)buffer + sizeof(buffer) / 2);
-                       mem2hex(buffer, buffer + sizeof(buffer) / 2, len);
+                       char *ptr = (char *)buffer + sizeof(buffer) / 2;
+                       db_read_bytes(addr, len, ptr);
+                       mem2hex(buffer, ptr, len);
                        kgdb_send(buffer);
                        continue;
 
@@ -496,7 +496,7 @@
                                kgdb_send("E0A");
                                continue;
                        }
-                       db_write_bytes(addr, (size_t)len, (char *)buffer);
+                       db_write_bytes(addr, len, (char *)buffer);
                        kgdb_send("OK");
                        continue;
 
diff -r e34a5f005bb7 -r 8ae956d180be sys/kern/sys_process.c
--- a/sys/kern/sys_process.c    Sun Sep 21 17:11:07 2014 +0000
+++ b/sys/kern/sys_process.c    Sun Sep 21 17:17:15 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_process.c,v 1.163 2014/01/04 00:10:03 dsl Exp $    */
+/*     $NetBSD: sys_process.c,v 1.164 2014/09/21 17:17:15 christos Exp $       */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.163 2014/01/04 00:10:03 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.164 2014/09/21 17:17:15 christos Exp $");
 
 #include "opt_ptrace.h"
 #include "opt_ktrace.h"
@@ -1011,7 +1011,7 @@
 
        kv += uio->uio_offset;
        kl -= uio->uio_offset;
-       if ((size_t)kl > uio->uio_resid)
+       if (kl > uio->uio_resid)
                kl = uio->uio_resid;
 
        error = process_read_fpregs(l, &r, &kl);



Home | Main Index | Thread Index | Old Index