Re: [PATCH 1/2] block: Alias block_op_close() to block_op_flush()

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

 



On Fri, Jan 11, 2019 at 09:58:14PM -0800, Andrey Smirnov wrote:
> The two functions are identical, so there's no need to keep two copies
> of the same code around. Alias block_op_close() to block_op_flush()
> and drop standalone definition for the former.
> 
> Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
> ---
>  common/block.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/common/block.c b/common/block.c
> index 8d0de42d90..549df71a9d 100644
> --- a/common/block.c
> +++ b/common/block.c
> @@ -329,13 +329,6 @@ static ssize_t block_op_write(struct cdev *cdev, const void *buf, size_t count,
>  }
>  #endif
>  
> -static int block_op_close(struct cdev *cdev)
> -{
> -	struct block_device *blk = cdev->priv;
> -
> -	return writebuffer_flush(blk);
> -}
> -
>  static int block_op_flush(struct cdev *cdev)
>  {
>  	struct block_device *blk = cdev->priv;
> @@ -343,6 +336,8 @@ static int block_op_flush(struct cdev *cdev)
>  	return writebuffer_flush(blk);
>  }
>  
> +static int block_op_close(struct cdev *cdev) __alias(block_op_flush);
> +
>  static struct cdev_operations block_ops = {
>  	.read	= block_op_read,
>  #ifdef CONFIG_BLOCK_WRITE
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux