diff mbox

[v2,3/3] api: config: rename ODP_SHM_NUM_BLOCKS to ODP_CONFIG_SHM_NUM_BLOCKS

Message ID 1424716517-17175-3-git-send-email-mike.holmes@linaro.org
State New
Headers show

Commit Message

Mike Holmes Feb. 23, 2015, 6:35 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 include/odp/api/config.h                   |  2 +-
 platform/linux-generic/odp_shared_memory.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

Comments

Mike Holmes Feb. 24, 2015, 1:30 p.m. UTC | #1
Will fix

On 24 February 2015 at 08:22, Savolainen, Petri (Nokia - FI/Espoo) <
petri.savolainen@nokia.com> wrote:

>
>
> > -----Original Message-----
> > From: lng-odp-bounces@lists.linaro.org [mailto:lng-odp-
> > bounces@lists.linaro.org] On Behalf Of ext Mike Holmes
> > Sent: Monday, February 23, 2015 8:35 PM
> > To: lng-odp@lists.linaro.org
> > Subject: [lng-odp] [PATCH v2 3/3] api: config: rename ODP_SHM_NUM_BLOCKS
> > to ODP_CONFIG_SHM_NUM_BLOCKS
> >
> > Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> > ---
> >  include/odp/api/config.h                   |  2 +-
> >  platform/linux-generic/odp_shared_memory.c | 16 ++++++++--------
> >  2 files changed, 9 insertions(+), 9 deletions(-)
> >
> > diff --git a/include/odp/api/config.h b/include/odp/api/config.h
> > index 965f6f0..1cc07a3 100644
> > --- a/include/odp/api/config.h
> > +++ b/include/odp/api/config.h
> > @@ -125,7 +125,7 @@ extern "C" {
> >   *
> >   * Limits how many blocks are available for calls to odp_shm_reserve()
> >   */
> > -#define ODP_SHM_NUM_BLOCKS 64
> > +#define ODP_CONFIG_SHM_NUM_BLOCKS 64
>
>
> I think this should be renamed to ODP_CONFIG_SHM_BLOCKS, since it's better
> inline with other macros in config.h (ODP_CONFIG_POOLS, ODP_CONFIG_QUEUES,
> ...).
>
> -Petri
>
>
diff mbox

Patch

diff --git a/include/odp/api/config.h b/include/odp/api/config.h
index 965f6f0..1cc07a3 100644
--- a/include/odp/api/config.h
+++ b/include/odp/api/config.h
@@ -125,7 +125,7 @@  extern "C" {
  *
  * Limits how many blocks are available for calls to odp_shm_reserve()
  */
-#define ODP_SHM_NUM_BLOCKS 64
+#define ODP_CONFIG_SHM_NUM_BLOCKS 64
 
 /**
  * @}
diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c
index 9b6e92b..d37567f 100644
--- a/platform/linux-generic/odp_shared_memory.c
+++ b/platform/linux-generic/odp_shared_memory.c
@@ -44,7 +44,7 @@  typedef struct {
 
 
 typedef struct {
-	odp_shm_block_t block[ODP_SHM_NUM_BLOCKS];
+	odp_shm_block_t block[ODP_CONFIG_SHM_NUM_BLOCKS];
 	odp_spinlock_t  lock;
 
 } odp_shm_table_t;
@@ -104,7 +104,7 @@  static int find_block(const char *name, uint32_t *index)
 {
 	uint32_t i;
 
-	for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) {
+	for (i = 0; i < ODP_CONFIG_SHM_NUM_BLOCKS; i++) {
 		if (strcmp(name, odp_shm_tbl->block[i].name) == 0) {
 			/* found it */
 			if (index != NULL)
@@ -130,7 +130,7 @@  int odp_shm_free(odp_shm_t shm)
 
 	i = from_handle(shm);
 
-	if (i >= ODP_SHM_NUM_BLOCKS) {
+	if (i >= ODP_CONFIG_SHM_NUM_BLOCKS) {
 		ODP_DBG("odp_shm_free: Bad handle\n");
 		return -1;
 	}
@@ -214,14 +214,14 @@  odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align,
 		return ODP_SHM_INVALID;
 	}
 
-	for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) {
+	for (i = 0; i < ODP_CONFIG_SHM_NUM_BLOCKS; i++) {
 		if (odp_shm_tbl->block[i].addr == NULL) {
 			/* Found free block */
 			break;
 		}
 	}
 
-	if (i > ODP_SHM_NUM_BLOCKS - 1) {
+	if (i > ODP_CONFIG_SHM_NUM_BLOCKS - 1) {
 		/* Table full */
 		odp_spinlock_unlock(&odp_shm_tbl->lock);
 		ODP_DBG("odp_shm_reserve: no more blocks\n");
@@ -319,7 +319,7 @@  void *odp_shm_addr(odp_shm_t shm)
 
 	i = from_handle(shm);
 
-	if (i > (ODP_SHM_NUM_BLOCKS - 1))
+	if (i > (ODP_CONFIG_SHM_NUM_BLOCKS - 1))
 		return NULL;
 
 	return odp_shm_tbl->block[i].addr;
@@ -333,7 +333,7 @@  int odp_shm_info(odp_shm_t shm, odp_shm_info_t *info)
 
 	i = from_handle(shm);
 
-	if (i > (ODP_SHM_NUM_BLOCKS - 1))
+	if (i > (ODP_CONFIG_SHM_NUM_BLOCKS - 1))
 		return -1;
 
 	block = &odp_shm_tbl->block[i];
@@ -362,7 +362,7 @@  void odp_shm_print_all(void)
 
 	ODP_PRINT("  id name                       kB align huge addr\n");
 
-	for (i = 0; i < ODP_SHM_NUM_BLOCKS; i++) {
+	for (i = 0; i < ODP_CONFIG_SHM_NUM_BLOCKS; i++) {
 		odp_shm_block_t *block;
 
 		block = &odp_shm_tbl->block[i];