usb: remove unused return from usb top level actions
What changed, and why it matters
This commit is a minor code cleanup in the USB storage feature of the Blockstream Jade hardware wallet. It changes two functions so they return nothing (void) instead of a true/false value, because the returned value was never actually used. There is no security-relevant change here.
No security action needed. Treat as routine refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies usbstorage_sign_psbt() and usbstorage_export_xpub() in main/usbhmsc/usbmode.c and their declarations in usbmode.h. Both previously returned bool and propagated the return value of handle_usbstorage_action(). The commit removes the unused return values, converting the functions to void and dropping the now-unneeded stdbool.h include. The underlying action handler and its error handling are unchanged.
Changed components
main/usbhmsc/usbmode.cmain/usbhmsc/usbmode.hInspect captured patch +7 / −7
diff --git a/main/usbhmsc/usbmode.c b/main/usbhmsc/usbmode.c
index de4b797..6680e83 100644
--- a/main/usbhmsc/usbmode.c
+++ b/main/usbhmsc/usbmode.c
@@ -16,7 +16,6 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
@@ -885,12 +884,12 @@ cleanup:
// Sign PSBT file, and write updated file back to the usb-storage directory.
// Accepts binary PSBT or base64-encoded PSBT file as 'xxx.psbt'.
// After any signatures are added, the file is written in the same format.
-bool usbstorage_sign_psbt(const char* extra_path)
+void usbstorage_sign_psbt(const char* extra_path)
{
// extra_path is optional
const bool is_async = false;
const usbstorage_action_context_t ctx = { .extra_path = extra_path };
- return handle_usbstorage_action("Sign PSBT", sign_usb_psbt, &ctx, is_async);
+ handle_usbstorage_action("Sign PSBT", sign_usb_psbt, &ctx, is_async);
}
static gui_activity_t* make_export_xpub_prompt_activity(void)
@@ -1043,11 +1042,11 @@ static bool export_usb_xpub_fn(const usbstorage_action_context_t* ctx)
return true;
}
-bool usbstorage_export_xpub(const char* extra_path)
+void usbstorage_export_xpub(const char* extra_path)
{
const bool is_async = false;
usbstorage_action_context_t ctx = { .extra_path = NULL, .ctx = NULL };
- return handle_usbstorage_action("Export Xpub", export_usb_xpub_fn, &ctx, is_async);
+ handle_usbstorage_action("Export Xpub", export_usb_xpub_fn, &ctx, is_async);
}
#endif // AMALGAMATED_BUILD
diff --git a/main/usbhmsc/usbmode.h b/main/usbhmsc/usbmode.h
index 989cc7b..742d31d 100644
--- a/main/usbhmsc/usbmode.h
+++ b/main/usbhmsc/usbmode.h
@@ -7,8 +7,9 @@
bool usbstorage_firmware_ota(const char* extra_path);
// Sign PSBT file, and write updated file
-bool usbstorage_sign_psbt(const char* extra_path);
+void usbstorage_sign_psbt(const char* extra_path);
+
// Write xpub file to usb
-bool usbstorage_export_xpub(const char* extra_path);
+void usbstorage_export_xpub(const char* extra_path);
#endif /* USBMODE_H_ */
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.