From owner-svn-src-all@freebsd.org Fri Apr 12 14:18:18 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E280E157DC1E; Fri, 12 Apr 2019 14:18:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 565067532A; Fri, 12 Apr 2019 14:18:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D01F22845; Fri, 12 Apr 2019 14:18:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x3CEIGJi075038; Fri, 12 Apr 2019 14:18:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x3CEIGRa075037; Fri, 12 Apr 2019 14:18:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201904121418.x3CEIGRa075037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 12 Apr 2019 14:18:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r346151 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 346151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 565067532A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Apr 2019 14:18:18 -0000 Author: trasz Date: Fri Apr 12 14:18:16 2019 New Revision: 346151 URL: https://svnweb.freebsd.org/changeset/base/346151 Log: Remove unneeded conditionals for sv_ functions - all the ABIs (apart from null_sysvec) define them, so the 'else' branch is never taken. Reviewed by: kib MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D19889 Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Apr 12 12:46:25 2019 (r346150) +++ head/sys/kern/kern_exec.c Fri Apr 12 14:18:16 2019 (r346151) @@ -679,23 +679,14 @@ interpret: sys_cap_enter(td, NULL); /* - * Copy out strings (args and env) and initialize stack base + * Copy out strings (args and env) and initialize stack base. */ - if (p->p_sysent->sv_copyout_strings) - stack_base = (*p->p_sysent->sv_copyout_strings)(imgp); - else - stack_base = exec_copyout_strings(imgp); + stack_base = (*p->p_sysent->sv_copyout_strings)(imgp); /* - * If custom stack fixup routine present for this process - * let it do the stack setup. - * Else stuff argument count as first item on stack + * Stack setup. */ - if (p->p_sysent->sv_fixup != NULL) - error = (*p->p_sysent->sv_fixup)(&stack_base, imgp); - else - error = suword(--stack_base, imgp->args->argc) == 0 ? - 0 : EFAULT; + error = (*p->p_sysent->sv_fixup)(&stack_base, imgp); if (error != 0) { vn_lock(imgp->vp, LK_SHARED | LK_RETRY); goto exec_fail_dealloc; @@ -880,11 +871,7 @@ interpret: #endif /* Set values passed into the program in registers. */ - if (p->p_sysent->sv_setregs) - (*p->p_sysent->sv_setregs)(td, imgp, - (u_long)(uintptr_t)stack_base); - else - exec_setregs(td, imgp, (u_long)(uintptr_t)stack_base); + (*p->p_sysent->sv_setregs)(td, imgp, (u_long)(uintptr_t)stack_base); vfs_mark_atime(imgp->vp, td->td_ucred);