Re: [PATCHv2 01/10] xshm: Shared Memory layout for ST-E M7400 driver.

From: Arnd Bergmann
Date: Fri Dec 09 2011 - 09:46:01 EST


On Friday 09 December 2011, Sjur BrÃndeland wrote:
> Add structures defining the channel configuration and the
> shared memory layout used for ST-Ericsson M7400.
>
> These data structures are shared between the Linux host and the
> M7400 modem.
>
> Signed-off-by: Sjur BrÃndeland <sjur.brandeland@xxxxxxxxxxxxxx>
> ---
> include/linux/xshm/xshm_ipctoc.h | 160 ++++++++++++++++++++++++++++++++++++++
> 1 files changed, 160 insertions(+), 0 deletions(-)
> create mode 100644 include/linux/xshm/xshm_ipctoc.h

Generally, the include/linux path is for interfaces between modules, while
hardware data structures should be in the same directory as the driver using
them to provide an abstract interface.

> diff --git a/include/linux/xshm/xshm_ipctoc.h b/include/linux/xshm/xshm_ipctoc.h
> new file mode 100644
> index 0000000..b008c23
> --- /dev/null
> +++ b/include/linux/xshm/xshm_ipctoc.h
> @@ -0,0 +1,160 @@
> +/*
> + * Copyright (C) ST-Ericsson AB 2011
> + * Author: Sjur Brendeland / sjur.brandeland@xxxxxxxxxxxxxx
> + * License terms: GNU General Public License (GPL) version 2
> + */
> +
> +#ifndef XSHM_TOC
> +#define XSHM_TOC
> +
> +/**
> + * DOC: XSHM Shared Memory Layout
> + *
> + * XSHM defines a set of structures describing the memory layout used
> + * for the Shared Memory IPC. In short &toc_entry points out &ipc_toc,
> + * which points out the &xshm_ipctoc_channel. &xshm_ipctoc_channel defines
> + * the channels used to communicate between host and external device (modem).
> + *
> + * &xshm_ipctoc_channel can be used in packet-mode or stream-mode,
> + * and points out &xshm_bufidx holding information about cirular
> + * buffers, andtheir read/write indices etc.
> + */
> +
> +#pragma pack(1)

Better remove the #pragma. Marking data structures as packed when they
are already packed to start with only leads to worse optimizations in the
compiler, but does not have a functional impact.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/