lkml.org 
[lkml]   [2023]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V1] net: mhi : Add support to enable ethernet interface
On Fri, Jun 30, 2023 at 03:14:41PM +0530, Vivek Pernamitta wrote:
> Add support to enable ethernet interface for MHI SWIP channels.
>
> Signed-off-by: Vivek Pernamitta <quic_vpernami@quicinc.com>

...

> @@ -301,11 +318,17 @@ static void mhi_net_rx_refill_work(struct work_struct *work)
> schedule_delayed_work(&mhi_netdev->rx_refill, HZ / 2);
> }
>
> -static int mhi_net_newlink(struct mhi_device *mhi_dev, struct net_device *ndev)
> +static int mhi_net_newlink(struct mhi_device *mhi_dev, struct net_device *ndev, bool eth_dev)
> {
> struct mhi_net_dev *mhi_netdev;
> int err;
>
> + if (eth_dev) {
> + eth_random_addr(ndev->dev_addr);
> + if (!is_valid_ether_addr(ndev->dev_addr))
> + return -EADDRNOTAVAIL;
> + }

Hi Vivek,

This doesn't seem right.
As GCC points out, dev_addr is const.
And I don't think eth_random_addr() produces invalid addresses.

Perhaps you want eth_hw_addr_random() here.

As was mentioned elsewhere in this thread, net-next, is closed.
So please post a v2 once it re-opens, after 10th July.

--
pw-bot: changes-requested

\
 
 \ /
  Last update: 2023-06-30 15:14    [W:0.170 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site