Resend leds-lp5562 allow firmware files up to the maximum length
cover Resend leds-lp5562 allow firmware files up to the maximum length
As requested, resending patch with git-send-email.
Nick Stoughton (1):
leds: leds-lp5562 allow firmware files up to the maximum length
drivers/leds/leds-lp5562.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
Nick Stoughton
PATCH 1/1 leds: leds-lp5562 allow firmware files up to the maximum length
Firmware files are in ASCII, using 2 hex characters per byte. The maximum length of a firmware string is therefore
16 (commands) * 2 (bytes per command) * 2 (characters per byte) = 64
--- drivers/leds/leds-lp5562.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/leds/leds-lp5562.c +5 -1
@@ -260,7 +260,11 @@ static void lp5562_firmware_loaded(struct lp55xx_chip *chip) {const struct firmware *fw = chip->fw; -if (fw->size >LP5562_PROGRAM_LENGTH ) { +/* +* the firmware is encoded in ascii hex character, with 2 chars +* per byte +*/ +if (fw->size > (LP5562_PROGRAM_LENGTH *2 )) {dev_err (&chip->cl->dev,"firmware data size overflow: %zu\n" , fw->size);return ;
Signature · 1 line
Nick Stoughton
Re: [PATCH 1/1] leds: leds-lp5562 allow firmware files up to the maximum length
Hi Nick,
Thank you for the update. Now it applies cleanly.
Quoted 15 lines · Nick Stoughton
Firmware files are in ASCII, using 2 hex characters per byte. The maximum length of a firmware string is therefore
16 (commands) * 2 (bytes per command) * 2 (characters per byte) = 64
Signed-off-by Nick Stoughton <[email protected]>--- drivers/leds/leds-lp5562.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/leds/leds-lp5562.c +0
-0
drivers/leds/leds-lp5562.c static void lp5562_firmware_loaded(struct lp55xx_chip *chip) · line 266
Quoted 8 lines
drivers/leds/leds-lp5562.c +4
-1@@ -260,7 +260,11 @@ static void lp5562_firmware_loaded(struct lp55xx_chip *chip) {const struct firmware *fw = chip->fw; -if (fw->size >LP5562_PROGRAM_LENGTH ) { +/* +* the firmware is encoded in ascii hex character, with 2 chars +* per byte +*/
If you used scripts/checkpatch.pl on this patch then you would notice some problems here. I fixed them up by myself.
Added also the tag to the commit message:
and applied.
Thanks.
Quoted 5 lines
drivers/leds/leds-lp5562.c +1
-0+if (fw->size > (LP5562_PROGRAM_LENGTH *2 )) {dev_err (&chip->cl->dev,"firmware data size overflow: %zu\n" , fw->size);return ;
Signature · 2 lines
Best regards, Jacek Anaszewski