From owner-svn-src-all@freebsd.org Wed Jul 31 18:25:53 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E0F4A5756; Wed, 31 Jul 2019 18:25:53 +0000 (UTC) (envelope-from brooks@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 45zMLT1NQTz49Tk; Wed, 31 Jul 2019 18:25:53 +0000 (UTC) (envelope-from brooks@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 0D3965B5C; Wed, 31 Jul 2019 18:25:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6VIPqsx022181; Wed, 31 Jul 2019 18:25:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6VIPqVX022180; Wed, 31 Jul 2019 18:25:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907311825.x6VIPqVX022180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 31 Jul 2019 18:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r350475 - stable/12/lib/libproc X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/lib/libproc X-SVN-Commit-Revision: 350475 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45zMLT1NQTz49Tk X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-0.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.32)[-0.322,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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: Wed, 31 Jul 2019 18:25:53 -0000 Author: brooks Date: Wed Jul 31 18:25:52 2019 New Revision: 350475 URL: https://svnweb.freebsd.org/changeset/base/350475 Log: MFC r350158: Remove an unneeded temporary variable in two functions. There is no need to convert an intptr_t to a long just to cast it to a (void *). Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: stable/12/lib/libproc/proc_bkpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libproc/proc_bkpt.c ============================================================================== --- stable/12/lib/libproc/proc_bkpt.c Wed Jul 31 18:10:50 2019 (r350474) +++ stable/12/lib/libproc/proc_bkpt.c Wed Jul 31 18:25:52 2019 (r350475) @@ -102,7 +102,6 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t addre unsigned long *saved) { struct ptrace_io_desc piod; - unsigned long caddr; int ret = 0, stopped; instr_t instr; @@ -125,10 +124,9 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t addre /* * Read the original instruction. */ - caddr = address; instr = 0; piod.piod_op = PIOD_READ_I; - piod.piod_offs = (void *)caddr; + piod.piod_offs = (void *)address; piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { @@ -141,10 +139,9 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t addre /* * Write a breakpoint instruction to that address. */ - caddr = address; instr = BREAKPOINT_INSTR; piod.piod_op = PIOD_WRITE_I; - piod.piod_offs = (void *)caddr; + piod.piod_offs = (void *)address; piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) { @@ -167,7 +164,6 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t addre unsigned long saved) { struct ptrace_io_desc piod; - unsigned long caddr; int ret = 0, stopped; instr_t instr; @@ -189,10 +185,9 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t addre /* * Overwrite the breakpoint instruction that we setup previously. */ - caddr = address; instr = saved; piod.piod_op = PIOD_WRITE_I; - piod.piod_offs = (void *)caddr; + piod.piod_offs = (void *)address; piod.piod_addr = &instr; piod.piod_len = BREAKPOINT_INSTR_SZ; if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) {