Re: [PATCH v3 3/3] counter: 104-quad-8: Utilize helper functions to handle PR, FLAG and PSC

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

 



On Mon, Apr 10, 2023 at 10:03:13AM -0400, William Breathitt Gray wrote:
> The Preset Register (PR), Flag Register (FLAG), and Filter Clock
> Prescaler (PSC) have common usage patterns. Wrap up such usage into
> dedicated functions to improve code clarity.

...

>  	*val = 0;

Is not needed now as always being initialized by below call.

>  	spin_lock_irqsave(&priv->lock, irqflags);
>  
>  	iowrite8(SELECT_RLD | RESET_BP | TRANSFER_CNTR_TO_OL, &chan->control);
> -
> -	for (i = 0; i < 3; i++)
> -		*val |= (unsigned long)ioread8(&chan->data) << (8 * i);
> +	ioread8_rep(&chan->data, val, 3);
>  
>  	spin_unlock_irqrestore(&priv->lock, irqflags);

...

> +	struct channel_reg __iomem *const chan = priv->reg->channel + id;

Not sure if array representation will look better here and elsewhere.

	struct channel_reg __iomem *const chan = &priv->reg->channel[id];

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux