Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

niu: read property length only if we use it

In three places, the driver calls of_get_property and reads the property
length although the length is not used. Update the calls to not request
the length.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Martin Kaiser and committed by
David S. Miller
451395f7 d39e8b92

+3 -3
+3 -3
drivers/net/ethernet/sun/niu.c
··· 9208 9208 else 9209 9209 dp = pci_device_to_OF_node(np->pdev); 9210 9210 9211 - phy_type = of_get_property(dp, "phy-type", &prop_len); 9211 + phy_type = of_get_property(dp, "phy-type", NULL); 9212 9212 if (!phy_type) { 9213 9213 netdev_err(dev, "%pOF: OF node lacks phy-type property\n", dp); 9214 9214 return -EINVAL; ··· 9242 9242 return -EINVAL; 9243 9243 } 9244 9244 9245 - model = of_get_property(dp, "model", &prop_len); 9245 + model = of_get_property(dp, "model", NULL); 9246 9246 9247 9247 if (model) 9248 9248 strcpy(np->vpd.model, model); 9249 9249 9250 - if (of_find_property(dp, "hot-swappable-phy", &prop_len)) { 9250 + if (of_find_property(dp, "hot-swappable-phy", NULL)) { 9251 9251 np->flags |= (NIU_FLAGS_10G | NIU_FLAGS_FIBER | 9252 9252 NIU_FLAGS_HOTPLUG_PHY); 9253 9253 }