From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by sourceware.org (Postfix) with ESMTPS id 690233857C45 for ; Tue, 6 Oct 2020 11:20:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 690233857C45 Received: by mail-ed1-x544.google.com with SMTP id p13so7172367edi.7 for ; Tue, 06 Oct 2020 04:20:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4neeIsIxo90BUF3vLQ7LibjaGoL7TiCY+lcOfLlXF3U=; b=U6kAO8qWoY0RwN8cSye75Ei9Bb/SI7wW5AQ7CQYz99nSP10/4hcFDsHz1OnMhJdMB9 oG4TbRQt1cAnuatv9yH4SCflhYabD9ryqMJkVu8yd7KCk4d0iHeFFYwr4BV6xLaaQVnV 3Zl1IH7+11WzIZoSqAnhKDfRGYVYiE5BHQCH1Dg3F4Vuo+ExX7DTHmI90huBGqBq+rdF /zFfC8dzoN4pyTt0OMHgEK6eXwjC/yfhp2X0+sUEEiOrDNEWS0MTyBmSGyoQp65ClzTO tgypyPBAfEZVvsS3H8ZlwvRLnZKUKM9bCWzF2iVY2+8WkDMJZgpYfOIULyTrwPKvB34B Fniw== X-Gm-Message-State: AOAM530rsdS5DEpl0XNSOs1fOl5K0SXl6YPSQTeJ6W/0Os4g5I4K6uuY zu8G6pjqKvt/XFhTHULk4pnQrTP6Lz0= X-Google-Smtp-Source: ABdhPJwizLjU2n5ynvIXmb2u7Cj15n95zkG6dnETxHQXpfblfv+uIFJdAqlLh/enpiOsQA+G/UJf+g== X-Received: by 2002:a05:6402:84f:: with SMTP id b15mr4858337edz.149.1601983227038; Tue, 06 Oct 2020 04:20:27 -0700 (PDT) Received: from atlantis.home ([2a03:1b20:3:f011::6d]) by smtp.gmail.com with ESMTPSA id q14sm1936600ejo.53.2020.10.06.04.20.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2020 04:20:25 -0700 (PDT) From: Shahab Vahedi To: gdb-patches@sourceware.org Cc: Shahab Vahedi , Shahab Vahedi , Simon Marchi , Francois Bedard Subject: [PATCH] gdbserver: Remove unused argument in register_data() Date: Tue, 6 Oct 2020 13:20:16 +0200 Message-Id: <20201006112016.26534-1-shahab.vahedi@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Oct 2020 11:20:31 -0000 From: Shahab Vahedi The register_data() function in gdbserver/regcache.cc has an input argument called "fetch". This argument is not used by this static function at all. Therefore, it is time to get rid of it. gdbserver/ChangeLog: * regache.cc (register_data): Remove "fetch" from arguments. --- gdbserver/regcache.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc index 6c0af95b34e..add826b2897 100644 --- a/gdbserver/regcache.cc +++ b/gdbserver/regcache.cc @@ -300,7 +300,7 @@ regcache_register_size (const struct regcache *regcache, int n) } static unsigned char * -register_data (const struct regcache *regcache, int n, int fetch) +register_data (const struct regcache *regcache, int n) { return (regcache->registers + find_register_by_number (regcache->tdesc, n).offset / 8); @@ -319,7 +319,7 @@ regcache::raw_supply (int n, const void *buf) { if (buf) { - memcpy (register_data (this, n, 0), buf, register_size (tdesc, n)); + memcpy (register_data (this, n), buf, register_size (tdesc, n)); #ifndef IN_PROCESS_AGENT if (register_status != NULL) register_status[n] = REG_VALID; @@ -327,7 +327,7 @@ regcache::raw_supply (int n, const void *buf) } else { - memset (register_data (this, n, 0), 0, register_size (tdesc, n)); + memset (register_data (this, n), 0, register_size (tdesc, n)); #ifndef IN_PROCESS_AGENT if (register_status != NULL) register_status[n] = REG_UNAVAILABLE; @@ -340,7 +340,7 @@ regcache::raw_supply (int n, const void *buf) void supply_register_zeroed (struct regcache *regcache, int n) { - memset (register_data (regcache, n, 0), 0, + memset (register_data (regcache, n), 0, register_size (regcache->tdesc, n)); #ifndef IN_PROCESS_AGENT if (regcache->register_status != NULL) @@ -420,7 +420,7 @@ collect_register (struct regcache *regcache, int n, void *buf) void regcache::raw_collect (int n, void *buf) const { - memcpy (buf, register_data (this, n, 1), register_size (tdesc, n)); + memcpy (buf, register_data (this, n), register_size (tdesc, n)); } enum register_status @@ -461,7 +461,7 @@ regcache_raw_get_unsigned_by_name (struct regcache *regcache, void collect_register_as_string (struct regcache *regcache, int n, char *buf) { - bin2hex (register_data (regcache, n, 1), buf, + bin2hex (register_data (regcache, n), buf, register_size (regcache->tdesc, n)); } @@ -508,7 +508,7 @@ regcache::raw_compare (int regnum, const void *buf, int offset) const { gdb_assert (buf != NULL); - const unsigned char *regbuf = register_data (this, regnum, 1); + const unsigned char *regbuf = register_data (this, regnum); int size = register_size (tdesc, regnum); gdb_assert (size >= offset); -- 2.28.0