From 2cbb18604bfc8cf2f5763d1f7df95c0eee039e02 Mon Sep 17 00:00:00 2001 From: Tau Date: Mon, 25 Feb 2019 21:55:49 -0500 Subject: [PATCH] board/sg-led.c: Remove error path from update cmd No way to return it to the host application anyway since this command is unacknowledged. --- board/sg-led.c | 8 +------- board/sg-led.h | 2 +- cardhook/_com12.c | 5 ++--- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/board/sg-led.c b/board/sg-led.c index 9d9ecb3..128cf4a 100644 --- a/board/sg-led.c +++ b/board/sg-led.c @@ -160,24 +160,18 @@ static HRESULT sg_led_cmd_set_color( const struct sg_led *led, const struct sg_led_req_set_color *req) { - HRESULT hr; - if (req->req.payload_len != sizeof(req->payload)) { sg_led_dprintf(led, "%s: Payload size is incorrect\n", __func__); goto fail; } - hr = led->ops->set_color( + led->ops->set_color( led->ops_ctx, req->payload[0], req->payload[1], req->payload[2]); - if (FAILED(hr)) { - sg_led_dprintf(led, "led->ops->set_color: Error %x\n", hr); - } - fail: /* No response */ return S_FALSE; diff --git a/board/sg-led.h b/board/sg-led.h index c287e81..2d4ba01 100644 --- a/board/sg-led.h +++ b/board/sg-led.h @@ -8,7 +8,7 @@ struct sg_led_ops { HRESULT (*reset)(void *ctx); - HRESULT (*set_color)(void *ctx, uint8_t r, uint8_t g, uint8_t b); + void (*set_color)(void *ctx, uint8_t r, uint8_t g, uint8_t b); }; struct sg_led { diff --git a/cardhook/_com12.c b/cardhook/_com12.c index b4adc6b..56017d6 100644 --- a/cardhook/_com12.c +++ b/cardhook/_com12.c @@ -26,7 +26,7 @@ static HRESULT com12_mifare_read_luid( uint32_t uid, uint8_t *luid, size_t nbytes); -static HRESULT com12_led_set_color(void *ctx, uint8_t r, uint8_t g, uint8_t b); +static void com12_led_set_color(void *ctx, uint8_t r, uint8_t g, uint8_t b); static const struct sg_nfc_ops com12_nfc_ops = { .mifare_poll = com12_mifare_poll, @@ -188,7 +188,6 @@ static HRESULT com12_mifare_read_luid( return S_OK; } -static HRESULT com12_led_set_color(void *ctx, uint8_t r, uint8_t g, uint8_t b) +static void com12_led_set_color(void *ctx, uint8_t r, uint8_t g, uint8_t b) { - return S_OK; }