Re: [PATCH v4 03/11] treewide, serdev: add flags argument to receive_buf()

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

 



On Thu, 9 May 2024, Christoph Fritz wrote:

> For serdev device drivers to be able to detect TTY_BREAK and other flags
> in the buffer, pass the flag buffer pointer down to serdev its receive
> function and update all drivers using it.
> 
> The changes were mostly done using the following Coccinelle
> semantic patch:
> 
> // <smpl>
> @ rule1 @
> identifier fn;
> identifier opsname;
> @@
> struct serdev_device_ops opsname = {
> 	.receive_buf = fn,
> };
> @@
> identifier rule1.fn;
> parameter E1, E2, E3;
> typedef u8;
> @@
>   fn(E1, E2,
> + const u8 *flags,
>   E3)
>   { ... }
> // </smpl>
> 
> Signed-off-by: Christoph Fritz <christoph.fritz@xxxxxxxxx>

> + * @receive_buf:	Function called with data received from device (char
> + *			buffer), flags buffer (%TTY_NORMAL, %TTY_BREAK, etc)
> + *			and number of bytes;
>   *			returns number of bytes accepted; may sleep.
>   * @write_wakeup:	Function called when ready to transmit more data; must
>   *			not sleep.
>   */
>  struct serdev_device_ops {
> -	size_t (*receive_buf)(struct serdev_device *, const u8 *, size_t);
> +	size_t (*receive_buf)(struct serdev_device *, const u8 *, const u8 *,
> +			      size_t);

These parameters should be named now that they're being touched.

With that done,

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>

-- 
 i.

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux