mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
net: phy: directly copy struct mdio_board_info in mdiobus_register_board_info
Using a direct assignment instead of memcpy reduces the text segment size from 0x273 bytes to 0x19b bytes in my case. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://patch.msgid.link/af371f2a-42f3-4d94-80b9-3420380a3f6f@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
11d40db271
commit
f59fdcef3a
|
|
@ -62,14 +62,13 @@ int mdiobus_register_board_info(const struct mdio_board_info *info,
|
|||
unsigned int n)
|
||||
{
|
||||
struct mdio_board_entry *be;
|
||||
unsigned int i;
|
||||
|
||||
be = kcalloc(n, sizeof(*be), GFP_KERNEL);
|
||||
if (!be)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < n; i++, be++, info++) {
|
||||
memcpy(&be->board_info, info, sizeof(*info));
|
||||
for (int i = 0; i < n; i++, be++) {
|
||||
be->board_info = info[i];
|
||||
mutex_lock(&mdio_board_lock);
|
||||
list_add_tail(&be->list, &mdio_board_list);
|
||||
mutex_unlock(&mdio_board_lock);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user