All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dissect: simplify lookup_member()
@ 2006-12-14 21:37 Oleg Nesterov
  2007-02-27 18:40 ` Josh Triplett
  0 siblings, 1 reply; 4+ messages in thread
From: Oleg Nesterov @ 2006-12-14 21:37 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Christopher Li, linux-sparse

Change examine_sym_node() to recursively inspect the members of SYM_STRUCT.
This allows us to simplify lookup_member(): no need to do examine_sym_node(),
the member was already examined.

This is also good because now ->r_symdef(member) is called on declaration,
not when dissect detects the first usage of ->member.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- DS/dissect.c~	2006-04-20 23:49:03.000000000 +0400
+++ DS/dissect.c	2006-04-21 00:04:18.000000000 +0400
@@ -210,13 +210,16 @@ static void examine_sym_node(struct symb
 		case SYM_STRUCT: case SYM_UNION: //case SYM_ENUM:
 			if (base->evaluated)
 				return;
+			if (!base->symbol_list)
+				return;
+			base->evaluated = 1;
+
 			if (!base->ident && name)
 				base->ident = mk_name(root, name);
-			if (!base->ident || !base->symbol_list)
-				return;
-			if (reporter->r_symdef)
+			if (base->ident && reporter->r_symdef)
 				reporter->r_symdef(base);
-			base->evaluated = 1;
+			DO_LIST(base->symbol_list, mem,
+				examine_sym_node(mem, base->ident ?: root));
 		default:
 			return;
 		}
@@ -263,14 +266,8 @@ found:
 
 static struct symbol *lookup_member(struct symbol *type, struct ident *name, int *addr)
 {
-	struct symbol *node = __lookup_member(type, name, addr);
-
-	if (node != NULL)
-		examine_sym_node(node, type->ident);
-	else
-		node = no_member(name);
-
-	return node;
+	return __lookup_member(type, name, addr)
+		?: no_member(name);
 }
 
 static struct expression *peek_preop(struct expression *expr, int op)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dissect: simplify lookup_member()
  2006-12-14 21:37 [PATCH] dissect: simplify lookup_member() Oleg Nesterov
@ 2007-02-27 18:40 ` Josh Triplett
  2007-02-28  1:18   ` Pavel Roskin
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Triplett @ 2007-02-27 18:40 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: Christopher Li, linux-sparse

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

Oleg Nesterov wrote:
> Change examine_sym_node() to recursively inspect the members of SYM_STRUCT.
> This allows us to simplify lookup_member(): no need to do examine_sym_node(),
> the member was already examined.
> 
> This is also good because now ->r_symdef(member) is called on declaration,
> not when dissect detects the first usage of ->member.
> 
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

Applied.

- Josh Triplett



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] dissect: simplify lookup_member()
  2007-02-27 18:40 ` Josh Triplett
@ 2007-02-28  1:18   ` Pavel Roskin
  2007-02-28  2:55     ` Git mirror delay Josh Triplett
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Roskin @ 2007-02-28  1:18 UTC (permalink / raw)
  To: Josh Triplett; +Cc: linux-sparse

On Tue, 2007-02-27 at 10:40 -0800, Josh Triplett wrote:
> Oleg Nesterov wrote:
> > Change examine_sym_node() to recursively inspect the members of SYM_STRUCT.
> > This allows us to simplify lookup_member(): no need to do examine_sym_node(),
> > the member was already examined.
> > 
> > This is also good because now ->r_symdef(member) is called on declaration,
> > not when dissect detects the first usage of ->member.
> > 
> > Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
> 
> Applied.

Josh, I'll really appreciate if you push your changes to the publicly
available repository as soon as you post "applied".  This way, when I
have some time for sparse, I read the list, see your post, update sparse
and see how it's affecting my projects.

If the changes are only available the next day, I'll probably be busy
with other things.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Git mirror delay
  2007-02-28  1:18   ` Pavel Roskin
@ 2007-02-28  2:55     ` Josh Triplett
  0 siblings, 0 replies; 4+ messages in thread
From: Josh Triplett @ 2007-02-28  2:55 UTC (permalink / raw)
  To: Pavel Roskin; +Cc: linux-sparse

[-- Attachment #1: Type: text/plain, Size: 1473 bytes --]

Pavel Roskin wrote:
> On Tue, 2007-02-27 at 10:40 -0800, Josh Triplett wrote:
>> Oleg Nesterov wrote:
>>> Change examine_sym_node() to recursively inspect the members of SYM_STRUCT.
>>> This allows us to simplify lookup_member(): no need to do examine_sym_node(),
>>> the member was already examined.
>>>
>>> This is also good because now ->r_symdef(member) is called on declaration,
>>> not when dissect detects the first usage of ->member.
>>>
>>> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
>> Applied.
> 
> Josh, I'll really appreciate if you push your changes to the publicly
> available repository as soon as you post "applied".  This way, when I
> have some time for sparse, I read the list, see your post, update sparse
> and see how it's affecting my projects.
> 
> If the changes are only available the next day, I'll probably be busy
> with other things.

To the best of my knowledge, I always push out changes before I send the
corresponding "applied" mail.  However, I often send the mail a few moments
after pushing out the change, and the kernel.org mirroring processes do not
run the instant I push changes out.  In particular, I just confirmed that a
fresh clone of git://git.kernel.org/pub/scm/linux/kernel/git/josh/sparse.git
did not include the changes I've pushed about 8 hours ago today.

The new git.kernel.org server may help alleviate some of the issues that lead
to this high mirroring delay.

- Josh Triplett


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-02-28  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-14 21:37 [PATCH] dissect: simplify lookup_member() Oleg Nesterov
2007-02-27 18:40 ` Josh Triplett
2007-02-28  1:18   ` Pavel Roskin
2007-02-28  2:55     ` Git mirror delay Josh Triplett

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.