From: Armando Uribe <x0095078@ti.com>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>,
Ohad Ben-Cohen <ohad@wizery.com>,
Ameya Palande <ameya.palande@nokia.com>,
<linux-kernel@vger.kernel.org>, <devel@driverdev.osuosl.org>,
Rene Sapiens <rene.sapiens@ti.com>,
Felipe Contreras <felipe.contreras@gmail.com>,
Armando Uribe <x0095078@ti.com>
Subject: [PATCH 5/9] staging: tidspbridge: Remove redundant macro from cod.c
Date: Thu, 22 Jul 2010 20:25:30 -0500 [thread overview]
Message-ID: <1279848334-4043-6-git-send-email-x0095078@ti.com> (raw)
In-Reply-To: <1279848334-4043-5-git-send-email-x0095078@ti.com>
This patch removes a redundant macro from cod.c simply used
to verify that a field was not NULL
Signed-off-by: Armando Uribe <x0095078@ti.com>
---
drivers/staging/tidspbridge/pmgr/cod.c | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/tidspbridge/pmgr/cod.c b/drivers/staging/tidspbridge/pmgr/cod.c
index 10db8cf..0cbe6e5 100644
--- a/drivers/staging/tidspbridge/pmgr/cod.c
+++ b/drivers/staging/tidspbridge/pmgr/cod.c
@@ -46,9 +46,6 @@
/* magic number for handle validation */
#define MAGIC 0xc001beef
-/* macro to validate COD manager handles */
-#define IS_VALID(h) ((h) != NULL && (h)->ul_magic == MAGIC)
-
/*
* ======== cod_manager ========
*/
@@ -199,7 +196,7 @@ void cod_close(struct cod_libraryobj *lib)
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(lib != NULL);
- DBC_REQUIRE(IS_VALID(((struct cod_libraryobj *)lib)->cod_mgr));
+ DBC_REQUIRE(lib->cod_mgr);
hmgr = lib->cod_mgr;
hmgr->fxns.close_fxn(lib->dbll_lib);
@@ -285,7 +282,7 @@ int cod_create(struct cod_manager **mgr, char *str_zl_file,
void cod_delete(struct cod_manager *cod_mgr_obj)
{
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
if (cod_mgr_obj->base_lib) {
if (cod_mgr_obj->loaded)
@@ -328,7 +325,7 @@ int cod_get_base_lib(struct cod_manager *cod_mgr_obj,
int status = 0;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(plib != NULL);
*plib = (struct dbll_library_obj *)cod_mgr_obj->base_lib;
@@ -345,7 +342,7 @@ int cod_get_base_name(struct cod_manager *cod_mgr_obj, char *sz_name,
int status = 0;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(sz_name != NULL);
if (usize <= COD_MAXPATHLENGTH)
@@ -365,7 +362,7 @@ int cod_get_base_name(struct cod_manager *cod_mgr_obj, char *sz_name,
int cod_get_entry(struct cod_manager *cod_mgr_obj, u32 *entry_pt)
{
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(entry_pt != NULL);
*entry_pt = cod_mgr_obj->ul_entry;
@@ -384,7 +381,7 @@ int cod_get_loader(struct cod_manager *cod_mgr_obj,
int status = 0;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(loader != NULL);
*loader = (struct dbll_tar_obj *)cod_mgr_obj->target;
@@ -406,7 +403,7 @@ int cod_get_section(struct cod_libraryobj *lib, char *str_sect,
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(lib != NULL);
- DBC_REQUIRE(IS_VALID(lib->cod_mgr));
+ DBC_REQUIRE(lib->cod_mgr);
DBC_REQUIRE(str_sect != NULL);
DBC_REQUIRE(addr != NULL);
DBC_REQUIRE(len != NULL);
@@ -440,7 +437,7 @@ int cod_get_sym_value(struct cod_manager *cod_mgr_obj, char *str_sym,
struct dbll_sym_val *dbll_sym;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(str_sym != NULL);
DBC_REQUIRE(pul_value != NULL);
@@ -505,7 +502,7 @@ int cod_load_base(struct cod_manager *cod_mgr_obj, u32 num_argc, char *args[],
u32 i;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(cod_mgr_obj));
+ DBC_REQUIRE(cod_mgr_obj);
DBC_REQUIRE(num_argc > 0);
DBC_REQUIRE(args != NULL);
DBC_REQUIRE(args[0] != NULL);
@@ -561,7 +558,7 @@ int cod_open(struct cod_manager *hmgr, char *sz_coff_path,
struct cod_libraryobj *lib = NULL;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(hmgr));
+ DBC_REQUIRE(hmgr);
DBC_REQUIRE(sz_coff_path != NULL);
DBC_REQUIRE(flags == COD_NOLOAD || flags == COD_SYMB);
DBC_REQUIRE(lib_obj != NULL);
@@ -598,7 +595,7 @@ int cod_open_base(struct cod_manager *hmgr, char *sz_coff_path,
struct dbll_library_obj *lib;
DBC_REQUIRE(refs > 0);
- DBC_REQUIRE(IS_VALID(hmgr));
+ DBC_REQUIRE(hmgr);
DBC_REQUIRE(sz_coff_path != NULL);
/* if we previously opened a base image, close it now */
@@ -636,7 +633,7 @@ int cod_read_section(struct cod_libraryobj *lib, char *str_sect,
DBC_REQUIRE(refs > 0);
DBC_REQUIRE(lib != NULL);
- DBC_REQUIRE(IS_VALID(lib->cod_mgr));
+ DBC_REQUIRE(lib->cod_mgr);
DBC_REQUIRE(str_sect != NULL);
DBC_REQUIRE(str_content != NULL);
--
1.6.3.3
next prev parent reply other threads:[~2010-07-23 1:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-23 1:25 [PATCH 0/9] staging: tidspbridge: Code Clean Up related to macros Armando Uribe
2010-07-23 1:25 ` [PATCH 1/9] staging: tidspbridge: Remove Redundant wrappers Armando Uribe
2010-07-23 1:25 ` [PATCH 2/9] staging: tidspbridge: Remove redundant macros in io_sm.c Armando Uribe
2010-07-23 1:25 ` [PATCH 3/9] staging: tidspbridge: Change macros to static inline functions in io_sm Armando Uribe
2010-07-23 1:25 ` [PATCH 4/9] staging: tidspbridge: Change macros to static inline functions used in cload Armando Uribe
2010-07-23 1:25 ` Armando Uribe [this message]
2010-07-23 1:25 ` [PATCH 6/9] staging: tidspbridge: Remove unused magic number Armando Uribe
2010-07-23 1:25 ` [PATCH 7/9] staging: tidspbridge: Remove macros used as cast Armando Uribe
2010-07-23 1:25 ` [PATCH 8/9] staging: tidspbridge: Change macros to static inline functions Armando Uribe
2010-07-23 1:25 ` [PATCH 9/9] staging: tidspbridge: Remove unused macros Armando Uribe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1279848334-4043-6-git-send-email-x0095078@ti.com \
--to=x0095078@ti.com \
--cc=ameya.palande@nokia.com \
--cc=devel@driverdev.osuosl.org \
--cc=felipe.contreras@gmail.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ohad@wizery.com \
--cc=omar.ramirez@ti.com \
--cc=rene.sapiens@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®