mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-19 03:06:35 +00:00
lantiq: fix compilation warning in lantiq_etop_init
Commitc5cc3d9610
("lantiq: Change the data-type of mac address in ETOP driver") changed the type of the mac variable. Since then, the priv->mac check always evaluates as true, so this check can be removed. This fix compilation warning: drivers/net/ethernet/lantiq_etop.c: In function 'ltq_etop_init': drivers/net/ethernet/lantiq_etop.c:775:13: warning: the comparison will always evaluate as 'true' for the address of 'mac' will never be NULL [-Waddress] 775 | if (priv->mac && !is_valid_ether_addr(mac.sa_data)) | ^~~~ drivers/net/ethernet/lantiq_etop.c:157:23: note: 'mac' declared here 157 | unsigned char mac[6]; | cc1: all warnings being treated as errors Fixes:c5cc3d9610
("lantiq: Change the data-type of mac address in ETOP driver") Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl> [ fix wrong fixes tag format ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
f1287e9bc6
commit
0e2a332252
@ -210,7 +210,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
|
|||||||
- memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr));
|
- memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr));
|
||||||
+ memcpy(&mac.sa_data, ltq_get_eth_mac(), ETH_ALEN);
|
+ memcpy(&mac.sa_data, ltq_get_eth_mac(), ETH_ALEN);
|
||||||
+
|
+
|
||||||
+ if (priv->mac && !is_valid_ether_addr(mac.sa_data))
|
+ if (!is_valid_ether_addr(mac.sa_data))
|
||||||
+ memcpy(&mac.sa_data, priv->mac, ETH_ALEN);
|
+ memcpy(&mac.sa_data, priv->mac, ETH_ALEN);
|
||||||
+
|
+
|
||||||
if (!is_valid_ether_addr(mac.sa_data)) {
|
if (!is_valid_ether_addr(mac.sa_data)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user