summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2020-01-12 21:42:23 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2020-01-12 21:42:23 +0100
commitfbad4573390632c4d61b808bfc1ec91e4c62ff96 (patch)
tree01e8768b37a8dda674b6b7f46f68484887e09002 /utils
parentd6c9303c75b6e884335c0a905a1d7e13fbe3bbbe (diff)
downloadrockbox-fbad4573390632c4d61b808bfc1ec91e4c62ff96.tar.gz
rockbox-fbad4573390632c4d61b808bfc1ec91e4c62ff96.tar.bz2
rockbox-fbad4573390632c4d61b808bfc1ec91e4c62ff96.zip
nwztools/scsitools: simplify code and enable O2
Change-Id: Ic14bc5ff643c9cf4c6380b4c34999d704c65e460
Diffstat (limited to 'utils')
-rw-r--r--utils/nwztools/scsitools/Makefile2
-rw-r--r--utils/nwztools/scsitools/scsitool.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/utils/nwztools/scsitools/Makefile b/utils/nwztools/scsitools/Makefile
index 0267581f69..f520c10ee6 100644
--- a/utils/nwztools/scsitools/Makefile
+++ b/utils/nwztools/scsitools/Makefile
@@ -6,7 +6,7 @@ CC=$(PREFIX)gcc
LD=$(PREFIX)gcc
NWZ_DB_DIR=../../../firmware/target/hosted/sonynwz
INCLUDES=-I$(NWZ_DB_DIR) -I$(SCSI_DIR)
-CFLAGS=-std=c99 -Wall $(DEFINES) $(INCLUDES)
+CFLAGS=-std=c99 -Wall -O2 $(DEFINES) $(INCLUDES)
LDFLAGS=-L$(SCSI_DIR) -lrbscsi
BINS=scsitool$(EXE_EXT)
diff --git a/utils/nwztools/scsitools/scsitool.c b/utils/nwztools/scsitools/scsitool.c
index 8526f8676b..27fa3c7cc1 100644
--- a/utils/nwztools/scsitools/scsitool.c
+++ b/utils/nwztools/scsitools/scsitool.c
@@ -710,8 +710,7 @@ int get_dev_info(int argc, char **argv)
(void) argc;
(void )argv;
uint8_t cdb[12] = {0xfc, 0, 0x20, 'd', 'b', 'm', 'n', 0, 0x80, 0, 0, 0};
-
- char *buffer = malloc(0x80);
+ char buffer[80];
int buffer_size = 0x80;
uint8_t sense[32];
int sense_size = 32;
@@ -736,7 +735,7 @@ int get_dev_info(int argc, char **argv)
int get_dhp(int argc, char **argv)
{
(void) argc;
- (void )argv;
+ (void) argv;
uint8_t cdb[12] = {0xfc, 0, 'D', 'd', 'h', 'p', 0, 0, 0, 0, 0, 0};
char *buffer = malloc(0x80);