mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 09:56:51 +03:00
ethtool-util: no need for memcpy() where normal assignment works too
This commit is contained in:
parent
db256aab13
commit
89e1ba0ab2
@ -417,7 +417,7 @@ static int get_glinksettings(int *fd, struct ifreq *ifr, struct ethtool_link_use
|
|||||||
if (!u)
|
if (!u)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
memcpy(&u->base, &ecmd.req, sizeof(struct ethtool_link_settings));
|
ecmd.req = u->base;
|
||||||
|
|
||||||
offset = 0;
|
offset = 0;
|
||||||
memcpy(u->link_modes.supported, &ecmd.link_mode_data[offset], 4 * ecmd.req.link_mode_masks_nwords);
|
memcpy(u->link_modes.supported, &ecmd.link_mode_data[offset], 4 * ecmd.req.link_mode_masks_nwords);
|
||||||
@ -480,7 +480,7 @@ static int set_slinksettings(int *fd, struct ifreq *ifr, const struct ethtool_li
|
|||||||
if (u->base.cmd != ETHTOOL_GLINKSETTINGS || u->base.link_mode_masks_nwords <= 0)
|
if (u->base.cmd != ETHTOOL_GLINKSETTINGS || u->base.link_mode_masks_nwords <= 0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
memcpy(&ecmd.req, &u->base, sizeof(ecmd.req));
|
ecmd.req = u->base;
|
||||||
ecmd.req.cmd = ETHTOOL_SLINKSETTINGS;
|
ecmd.req.cmd = ETHTOOL_SLINKSETTINGS;
|
||||||
offset = 0;
|
offset = 0;
|
||||||
memcpy(&ecmd.link_mode_data[offset], u->link_modes.supported, 4 * ecmd.req.link_mode_masks_nwords);
|
memcpy(&ecmd.link_mode_data[offset], u->link_modes.supported, 4 * ecmd.req.link_mode_masks_nwords);
|
||||||
|
Loading…
Reference in New Issue
Block a user