summaryrefslogtreecommitdiffstats
path: root/pcilib/pci.c
diff options
context:
space:
mode:
authornicolas.zilio@hotmail.fr <>2015-09-15 11:45:37 +0200
committernicolas.zilio@hotmail.fr <>2015-09-15 11:45:37 +0200
commit6c47064466d8484813741f347e41af1d4ac90f85 (patch)
treec5b2ff848825c8a4395ca17350c5e85569097c91 /pcilib/pci.c
parentc71075ca84d896c650dd0b65c7664149ed51dcec (diff)
downloadpcitool-6c47064466d8484813741f347e41af1d4ac90f85.tar.gz
pcitool-6c47064466d8484813741f347e41af1d4ac90f85.tar.bz2
pcitool-6c47064466d8484813741f347e41af1d4ac90f85.tar.xz
pcitool-6c47064466d8484813741f347e41af1d4ac90f85.zip
cleaning
Diffstat (limited to 'pcilib/pci.c')
-rw-r--r--pcilib/pci.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/pcilib/pci.c b/pcilib/pci.c
index 946b003..b37e817 100644
--- a/pcilib/pci.c
+++ b/pcilib/pci.c
@@ -139,13 +139,9 @@ pcilib_t *pcilib_open(const char *device, const char *model) {
}
ctx->alloc_reg = PCILIB_DEFAULT_REGISTER_SPACE;
- ctx->alloc_formula_views=PCILIB_DEFAULT_VIEW_SPACE;
ctx->alloc_views=PCILIB_DEFAULT_VIEW_SPACE;
- ctx->alloc_enum_views=PCILIB_DEFAULT_VIEW_SPACE;
ctx->registers = (pcilib_register_description_t *)malloc(PCILIB_DEFAULT_REGISTER_SPACE * sizeof(pcilib_register_description_t));
ctx->register_ctx = (pcilib_register_context_t *)malloc(PCILIB_DEFAULT_REGISTER_SPACE * sizeof(pcilib_register_context_t));
- ctx->enum_views = (pcilib_view_enum2_t *)malloc(PCILIB_DEFAULT_VIEW_SPACE * sizeof(pcilib_view_enum2_t));
- ctx->formula_views = (pcilib_view_formula_t*)malloc(PCILIB_DEFAULT_VIEW_SPACE * sizeof(pcilib_view_formula_t));
ctx->views = (pcilib_view_t*)malloc(PCILIB_DEFAULT_VIEW_SPACE * sizeof(pcilib_view_t));
ctx->alloc_units=PCILIB_DEFAULT_UNIT_SPACE;
ctx->units=(pcilib_unit_t*)malloc(PCILIB_DEFAULT_UNIT_SPACE * sizeof(pcilib_unit_t));
@@ -157,7 +153,7 @@ pcilib_t *pcilib_open(const char *device, const char *model) {
}
/* i think we need a better error handling here, because, it's not that a problem to not have views working, but how to block the use if the memory here was not good?, and we could have only one type of views that is working*/
- if((!ctx->enum_views)||(!ctx->formula_views) || (!ctx->units) || !(ctx->views)){
+ if((!ctx->units) || !(ctx->views)){
pcilib_warning("Error allocating memory for views");
}
@@ -169,8 +165,6 @@ pcilib_t *pcilib_open(const char *device, const char *model) {
memset(ctx->register_ctx, 0, PCILIB_DEFAULT_REGISTER_SPACE * sizeof(pcilib_register_context_t));
- memset(ctx->enum_views,0,sizeof(pcilib_view_enum2_t));
- memset(ctx->formula_views,0,sizeof(pcilib_view_formula_t));
memset(ctx->units,0,sizeof(pcilib_unit_t));
memset(ctx->views,0,sizeof(pcilib_view_t));