[Pdbg] [PATCH 3/9] libpdbg: Avoid direct access of class in pdbg_target
Amitay Isaacs
amitay at ozlabs.org
Mon Jun 22 10:44:55 AEST 2020
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
libpdbg/adu.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libpdbg/adu.c b/libpdbg/adu.c
index fe60118..6600caa 100644
--- a/libpdbg/adu.c
+++ b/libpdbg/adu.c
@@ -166,7 +166,7 @@ int adu_getmem(struct pdbg_target *adu_target, uint64_t start_addr,
{
struct mem *adu;
- assert(!strcmp(adu_target->class, "mem"));
+ assert(pdbg_target_is_class(adu_target, "mem"));
adu = target_to_mem(adu_target);
return adu_read(adu, start_addr, output, size, 8, false);
@@ -177,7 +177,7 @@ int adu_getmem_ci(struct pdbg_target *adu_target, uint64_t start_addr,
{
struct mem *adu;
- assert(!strcmp(adu_target->class, "mem"));
+ assert(pdbg_target_is_class(adu_target, "mem"));
adu = target_to_mem(adu_target);
return adu_read(adu, start_addr, output, size, 8, true);
@@ -188,7 +188,7 @@ int adu_getmem_io(struct pdbg_target *adu_target, uint64_t start_addr,
{
struct mem *adu;
- assert(!strcmp(adu_target->class, "mem"));
+ assert(pdbg_target_is_class(adu_target, "mem"));
adu = target_to_mem(adu_target);
/* There is no equivalent for cachable memory as blocksize
@@ -201,7 +201,7 @@ int __adu_getmem(struct pdbg_target *adu_target, uint64_t start_addr,
{
struct mem *adu;
- assert(!strcmp(adu_target->class, "mem"));
+ assert(pdbg_target_is_class(adu_target, "mem"));
adu = target_to_mem(adu_target);
return adu_read(adu, start_addr, output, size, 8, ci);
@@ -250,7 +250,7 @@ int adu_putmem(struct pdbg_target *adu_target, uint64_t start_addr,
{
struct mem *adu;
- assert(!strcmp(adu_target->class, "mem"));
+ assert(pdbg_target_is_class(adu_target, "mem"));
adu = target_to_mem(adu_target);
return adu_write(adu, start_addr, input, size, 8, false);
@@ -261,7 +261,7 @@ int adu_putmem_ci(struct pdbg_target *adu_target, uint64_t start_addr,
{
struct mem *adu;
- assert(!strcmp(adu_target->class, "mem"));
+ assert(pdbg_target_is_class(adu_target, "mem"));
adu = target_to_mem(adu_target);
return adu_write(adu, start_addr, input, size, 8, true);
@@ -272,7 +272,7 @@ int adu_putmem_io(struct pdbg_target *adu_target, uint64_t start_addr,
{
struct mem *adu;
- assert(!strcmp(adu_target->class, "mem"));
+ assert(pdbg_target_is_class(adu_target, "mem"));
adu = target_to_mem(adu_target);
return adu_write(adu, start_addr, input, size, block_size, true);
@@ -283,7 +283,7 @@ int __adu_putmem(struct pdbg_target *adu_target, uint64_t start_addr,
{
struct mem *adu;
- assert(!strcmp(adu_target->class, "mem"));
+ assert(pdbg_target_is_class(adu_target, "mem"));
adu = target_to_mem(adu_target);
return adu_write(adu, start_addr, input, size, 8, ci);
--
2.26.2
More information about the Pdbg
mailing list