From 39c6f3385e92c0dc38ed4f10136a960c2842fb9f Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Mon, 20 Dec 2021 11:19:26 +0000 Subject: [PATCH] Remove usb_bulk_buffer.c containing unused variable definition. This removes the definition of the offset variable, volatile uint32_t usb_bulk_buffer_offset = 0; which is actually superfluous. This variable, along with its neighbour usb_bulk_buffer_tx, is placed explicitly by the linker script. Its type is defined by the declaration in usb_bulk_buffer.h. There is no need to define it here, and doing so gives the misleading impression that its initial value can be changed by modifying this line! The initialization to zero never actually takes effect, because the variable is not placed in the .data or .bss sections which are initialised by the startup code. The offset and tx variables are both set in set_transceiver_mode before SGPIO streaming is started, so the M0 code does not use them uninitialised. --- firmware/hackrf_usb/CMakeLists.txt | 1 - firmware/hackrf_usb/usb_bulk_buffer.c | 25 ------------------------- 2 files changed, 26 deletions(-) delete mode 100644 firmware/hackrf_usb/usb_bulk_buffer.c diff --git a/firmware/hackrf_usb/CMakeLists.txt b/firmware/hackrf_usb/CMakeLists.txt index 651c6527..1e58db95 100644 --- a/firmware/hackrf_usb/CMakeLists.txt +++ b/firmware/hackrf_usb/CMakeLists.txt @@ -35,7 +35,6 @@ set(SRC_M4 hackrf_usb.c "${PATH_HACKRF_FIRMWARE_COMMON}/tuning.c" "${PATH_HACKRF_FIRMWARE_COMMON}/streaming.c" - usb_bulk_buffer.c "${PATH_HACKRF_FIRMWARE_COMMON}/usb.c" "${PATH_HACKRF_FIRMWARE_COMMON}/usb_request.c" "${PATH_HACKRF_FIRMWARE_COMMON}/usb_standard_request.c" diff --git a/firmware/hackrf_usb/usb_bulk_buffer.c b/firmware/hackrf_usb/usb_bulk_buffer.c deleted file mode 100644 index ea3e6b77..00000000 --- a/firmware/hackrf_usb/usb_bulk_buffer.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2012 Jared Boone - * Copyright 2013 Benjamin Vernoux - * - * This file is part of HackRF. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#include "usb_bulk_buffer.h" - -volatile uint32_t usb_bulk_buffer_offset = 0;