Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1481170

Re: [PATCH] xen: consolidate swiotbl_xen dma_ops

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] xen: consolidate swiotbl_xen dma_ops
Date 2016-09-12 13:50 +0200
Message-ID <sgxUm-2FS-21@gated-at.bofh.it> (permalink)
References <sgfXr-5K-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Christoph Hellwig <hch@lst.de> wrote:

> +struct dma_map_ops xen_swiotlb_dma_ops = {
> +	.mapping_error = xen_swiotlb_dma_mapping_error,
> +	.alloc = xen_swiotlb_alloc_coherent,
> +	.free = xen_swiotlb_free_coherent,
> +	.sync_single_for_cpu = xen_swiotlb_sync_single_for_cpu,
> +	.sync_single_for_device = xen_swiotlb_sync_single_for_device,
> +	.sync_sg_for_cpu = xen_swiotlb_sync_sg_for_cpu,
> +	.sync_sg_for_device = xen_swiotlb_sync_sg_for_device,
> +	.map_sg = xen_swiotlb_map_sg_attrs,
> +	.unmap_sg = xen_swiotlb_unmap_sg_attrs,
> +	.map_page = xen_swiotlb_map_page,
> +	.unmap_page = xen_swiotlb_unmap_page,
> +	.dma_supported = xen_swiotlb_dma_supported,
> +	.set_dma_mask = xen_swiotlb_set_dma_mask,
> +};

Please organize such initializers better! Something like this:

struct dma_map_ops xen_swiotlb_dma_ops = {
	.mapping_error		= xen_swiotlb_dma_mapping_error,
	.alloc			= xen_swiotlb_alloc_coherent,
	.free			= xen_swiotlb_free_coherent,
	.sync_single_for_cpu	= xen_swiotlb_sync_single_for_cpu,
	.sync_single_for_device = xen_swiotlb_sync_single_for_device,
	.sync_sg_for_cpu	= xen_swiotlb_sync_sg_for_cpu,
	.sync_sg_for_device	= xen_swiotlb_sync_sg_for_device,
	.map_sg			= xen_swiotlb_map_sg_attrs,
	.unmap_sg		= xen_swiotlb_unmap_sg_attrs,
	.map_page		= xen_swiotlb_map_page,
	.unmap_page		= xen_swiotlb_unmap_page,
	.dma_supported		= xen_swiotlb_dma_supported,
	.set_dma_mask		= xen_swiotlb_set_dma_mask,
};

Makes it much easier to review such definitions.

Thanks,

	Ingo

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] xen: consolidate swiotbl_xen dma_ops Christoph Hellwig <hch@lst.de> - 2016-09-11 18:40 +0200
  Re: [PATCH] xen: consolidate swiotbl_xen dma_ops Ingo Molnar <mingo@kernel.org> - 2016-09-12 13:50 +0200
    Re: [PATCH] xen: consolidate swiotbl_xen dma_ops Christoph Hellwig <hch@lst.de> - 2016-09-12 17:00 +0200
      Re: [PATCH] xen: consolidate swiotbl_xen dma_ops Ingo Molnar <mingo@kernel.org> - 2016-09-13 20:40 +0200
        Re: [PATCH] xen: consolidate swiotbl_xen dma_ops Christoph Hellwig <hch@lst.de> - 2016-09-14 07:40 +0200
  Re: [PATCH] xen: consolidate swiotbl_xen dma_ops Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> - 2016-09-13 15:10 +0200
  Re: [PATCH] xen: consolidate swiotbl_xen dma_ops Stefano Stabellini <sstabellini@kernel.org> - 2016-09-13 20:00 +0200

csiph-web