[LEDE-DEV] [PATCH 6/6] lantiq: use ath9k device tree bindings binding/owl-loader

Bastian Bittorf bb at npl.de
Tue Nov 22 22:36:33 PST 2016


* Martin Blumenstingl <martin.blumenstingl at googlemail.com> [23.11.2016 07:22]:
> +xor() {
> +	local ret="0x$1"
> +
> +	shift 1
> +	while [[ "$1" ]]; do
> +		local val="0x$1"
> +		ret=$((${ret:-0} ^ ${val:-0}))
> +		shift 1
> +	done
> +
> +	printf "%02x" "$ret"
> +}

minor stuff:
please 'local val' once, remove the bashism [[
and if you like 'shift 1' = shift


> +ath9k_eeprom_die() {
> +	echo "ath9k eeprom: " "$*"

just: echo "ath9k eeprom: $*"

> +		echo -ne \\x${xor_fw_chksum:0:2}\\x${xor_fw_chksum:2:2} | \
> +			dd of=/lib/firmware/$FIRMWARE conv=notrunc bs=1 seek=$chksum_offset count=2

please use 'printf' here, instead of 'echo -ne' which is not POSIX.

> +case "$FIRMWARE" in
> +"ath9k-eeprom-pci-0000:00:0e.0.bin"|"ath9k-eeprom-pci-0000:01:00.0.bin"|"ath9k-eeprom-pci-0000:02:00.0.bin")


can you please split into multiple lines like
 "foo"|\
 "bar"|\
 "foo")
or is it even possible to just 'ath9k-eeprom-pci-0000:'*) ?


> +	board=$(lantiq_board_name)
> +	case $board in

better: "$board"

thank you - bye, bastian



More information about the Lede-dev mailing list