Re: [PATCH net-next 9/9] net: pse-pd: Add PD692x0 PSE controller driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 16 Nov 2023 23:38:08 +0100
Andrew Lunn <andrew@xxxxxxx> wrote:

> > +static int pd692x0_send_msg(struct pd692x0_priv *priv, struct pd692x0_msg
> > *msg) +{
> > +	const struct i2c_client *client = priv->client;
> > +	int ret;
> > +
> > +	if (msg->content.key == PD692X0_KEY_CMD && priv->last_cmd_key) {
> > +		while (time_is_after_jiffies(msecs_to_jiffies(30) +
> > priv->last_cmd_key_time))
> > +			usleep_range(1000, 2000);  
> 
> That is a bit odd. Could you not just calculate how long a sleep is
> needed, rather than loop?

Oh, right indeed! Don't know why my brain wanted a loop here.

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux