treewide: fix hex2dec conversion for MAC address checksum offset
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>
Wed, 18 Sep 2019 11:56:13 +0000 (13:56 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sat, 28 Sep 2019 22:46:13 +0000 (00:46 +0200)
commit0aab49d234b15545650cb3b6cb49429a0b7b2407
tree29d589f7e1d01d6e72de83d4ea78e02932ce8e5d
parentc5b4fa20fadbdc47264a9c1f76d7b9351c42e7ec
treewide: fix hex2dec conversion for MAC address checksum offset

If chksum_offset is converted by $(($...)) at the beginning, the
check [ -n "$chksum_offset" ] will always return true, as the
conversion yields "0" for an empty argument, and [ -n "0" ] is
true.

With this patch, the variable is not converted before the check,
but only when it's used in dd.

No conversion is done for use in hexdump, as this can deal with
hex value offsets.

Fixes: b133e466b08e ("treewide: convert WiFi caldata size and offset to hexadecimal")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
target/linux/ath79/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom