git: f44a8039fe39 - stable/13 - imgact_elf.c: style, remove unnecessary casts
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 12 May 2022 22:56:28 UTC
The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f44a8039fe391390d945c0baa4d3c4b8c34dd308 commit f44a8039fe391390d945c0baa4d3c4b8c34dd308 Author: Edward Tomasz Napierala <trasz@FreeBSD.org> AuthorDate: 2021-06-22 12:18:49 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2022-05-12 22:12: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 (cherry picked from commit 61b4c62718093fc3a30041bb7fa4d31c7b6c31b2) --- 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 1732b0dbe23d..c68cf17fc795 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1846,7 +1846,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); @@ -2118,7 +2118,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); @@ -2175,7 +2175,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); @@ -2203,7 +2203,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); @@ -2224,7 +2224,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)); @@ -2246,7 +2246,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")); @@ -2310,7 +2310,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); @@ -2343,7 +2343,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; @@ -2394,7 +2394,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; @@ -2421,7 +2421,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")); @@ -2440,7 +2440,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")); @@ -2459,7 +2459,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")); @@ -2481,7 +2481,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")); @@ -2500,7 +2500,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")); @@ -2523,7 +2523,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),