git: 61b4c6271809 - main - imgact_elf.c: style, remove unnecessary casts
Edward Tomasz Napierala
trasz at FreeBSD.org
Sun Jun 27 16:41:25 UTC 2021
The branch main has been updated by trasz:
URL: https://cgit.FreeBSD.org/src/commit/?id=61b4c62718093fc3a30041bb7fa4d31c7b6c31b2
commit 61b4c62718093fc3a30041bb7fa4d31c7b6c31b2
Author: Edward Tomasz Napierala <trasz at FreeBSD.org>
AuthorDate: 2021-06-22 12:18:49 +0000
Commit: Edward Tomasz Napierala <trasz at FreeBSD.org>
CommitDate: 2021-06-27 16:05:59 +0000
imgact_elf.c: style, remove unnecessary casts
Remove unnecessary type casts and redundant brackets.
No functional changes.
Suggested By: kib
Reviewed By: kib
Sponsored By: EPSRC
Differential Revision: https://reviews.freebsd.org/D30841
---
sys/kern/imgact_elf.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
index d114070fc903..4a649664c917 100644
--- a/sys/kern/imgact_elf.c
+++ b/sys/kern/imgact_elf.c
@@ -1776,7 +1776,7 @@ __elfN(prepare_notes)(struct thread *td, struct note_info_list *list,
size += register_note(list, -1,
__elfN(note_threadmd), thr);
- thr = (thr == td) ? TAILQ_FIRST(&p->p_threads) :
+ thr = thr == td ? TAILQ_FIRST(&p->p_threads) :
TAILQ_NEXT(thr, td_plist);
if (thr == td)
thr = TAILQ_NEXT(thr, td_plist);
@@ -2048,7 +2048,7 @@ __elfN(note_prpsinfo)(void *arg, struct sbuf *sb, size_t *sizep)
elf_prpsinfo_t *psinfo;
int error;
- p = (struct proc *)arg;
+ p = arg;
if (sb != NULL) {
KASSERT(*sizep == sizeof(*psinfo), ("invalid size"));
psinfo = malloc(sizeof(*psinfo), M_TEMP, M_ZERO | M_WAITOK);
@@ -2105,7 +2105,7 @@ __elfN(note_prstatus)(void *arg, struct sbuf *sb, size_t *sizep)
struct thread *td;
elf_prstatus_t *status;
- td = (struct thread *)arg;
+ td = arg;
if (sb != NULL) {
KASSERT(*sizep == sizeof(*status), ("invalid size"));
status = malloc(sizeof(*status), M_TEMP, M_ZERO | M_WAITOK);
@@ -2133,7 +2133,7 @@ __elfN(note_fpregset)(void *arg, struct sbuf *sb, size_t *sizep)
struct thread *td;
elf_prfpregset_t *fpregset;
- td = (struct thread *)arg;
+ td = arg;
if (sb != NULL) {
KASSERT(*sizep == sizeof(*fpregset), ("invalid size"));
fpregset = malloc(sizeof(*fpregset), M_TEMP, M_ZERO | M_WAITOK);
@@ -2154,7 +2154,7 @@ __elfN(note_thrmisc)(void *arg, struct sbuf *sb, size_t *sizep)
struct thread *td;
elf_thrmisc_t thrmisc;
- td = (struct thread *)arg;
+ td = arg;
if (sb != NULL) {
KASSERT(*sizep == sizeof(thrmisc), ("invalid size"));
bzero(&thrmisc, sizeof(thrmisc));
@@ -2176,7 +2176,7 @@ __elfN(note_ptlwpinfo)(void *arg, struct sbuf *sb, size_t *sizep)
struct ptrace_lwpinfo pl;
#endif
- td = (struct thread *)arg;
+ td = arg;
size = sizeof(structsize) + sizeof(pl);
if (sb != NULL) {
KASSERT(*sizep == size, ("invalid size"));
@@ -2240,7 +2240,7 @@ __elfN(note_procstat_proc)(void *arg, struct sbuf *sb, size_t *sizep)
size_t size;
int structsize;
- p = (struct proc *)arg;
+ p = arg;
size = sizeof(structsize) + p->p_numthreads *
sizeof(elf_kinfo_proc_t);
@@ -2273,7 +2273,7 @@ note_procstat_files(void *arg, struct sbuf *sb, size_t *sizep)
else
filedesc_flags = 0;
- p = (struct proc *)arg;
+ p = arg;
structsize = sizeof(struct kinfo_file);
if (sb == NULL) {
size = 0;
@@ -2324,7 +2324,7 @@ note_procstat_vmmap(void *arg, struct sbuf *sb, size_t *sizep)
else
vmmap_flags = 0;
- p = (struct proc *)arg;
+ p = arg;
structsize = sizeof(struct kinfo_vmentry);
if (sb == NULL) {
size = 0;
@@ -2351,7 +2351,7 @@ note_procstat_groups(void *arg, struct sbuf *sb, size_t *sizep)
size_t size;
int structsize;
- p = (struct proc *)arg;
+ p = arg;
size = sizeof(structsize) + p->p_ucred->cr_ngroups * sizeof(gid_t);
if (sb != NULL) {
KASSERT(*sizep == size, ("invalid size"));
@@ -2370,7 +2370,7 @@ note_procstat_umask(void *arg, struct sbuf *sb, size_t *sizep)
size_t size;
int structsize;
- p = (struct proc *)arg;
+ p = arg;
size = sizeof(structsize) + sizeof(p->p_pd->pd_cmask);
if (sb != NULL) {
KASSERT(*sizep == size, ("invalid size"));
@@ -2389,7 +2389,7 @@ note_procstat_rlimit(void *arg, struct sbuf *sb, size_t *sizep)
size_t size;
int structsize, i;
- p = (struct proc *)arg;
+ p = arg;
size = sizeof(structsize) + sizeof(rlim);
if (sb != NULL) {
KASSERT(*sizep == size, ("invalid size"));
@@ -2411,7 +2411,7 @@ note_procstat_osrel(void *arg, struct sbuf *sb, size_t *sizep)
size_t size;
int structsize;
- p = (struct proc *)arg;
+ p = arg;
size = sizeof(structsize) + sizeof(p->p_osrel);
if (sb != NULL) {
KASSERT(*sizep == size, ("invalid size"));
@@ -2430,7 +2430,7 @@ __elfN(note_procstat_psstrings)(void *arg, struct sbuf *sb, size_t *sizep)
size_t size;
int structsize;
- p = (struct proc *)arg;
+ p = arg;
size = sizeof(structsize) + sizeof(ps_strings);
if (sb != NULL) {
KASSERT(*sizep == size, ("invalid size"));
@@ -2453,7 +2453,7 @@ __elfN(note_procstat_auxv)(void *arg, struct sbuf *sb, size_t *sizep)
size_t size;
int structsize;
- p = (struct proc *)arg;
+ p = arg;
if (sb == NULL) {
size = 0;
sb = sbuf_new(NULL, NULL, AT_COUNT * sizeof(Elf_Auxinfo),
More information about the dev-commits-src-main
mailing list