Hi,
On Fri, Apr 07, 2017 at 08:06:47AM +0200, Anton Lindqvist wrote:
> Ping
>
> On Sun, Mar 26, 2017 at 07:10:29PM +1100, Jonathan Gray wrote:
> > On Sun, Mar 26, 2017 at 09:33:44AM +0200, Otto Moerbeek wrote:
> > > On Sun, Mar 26, 2017 at 06:31:41PM +1100, Jonathan Gray wrote:
> > >
> > > > On Sun, Mar 26, 2017 at 09:14:26AM +0200, Anton Lindqvist wrote:
> > > > > Hi,
> > > > > An assignment introduced in r1.219 looks redundant.
> > > >
> > > > child is assigned every iteration of the loop this diff looks wrong to
> > > > me.
> > >
> > > It's being assigned in the if statement.
> > >
> > > -Otto
> >
> > Ah indeed.
> >
> > > >
> > > > >
> > > > > Index: dsdt.c
> > > > > ===================================================================
> > > > > RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v
> > > > > retrieving revision 1.231
> > > > > diff -u -p -r1.231 dsdt.c
> > > > > --- dsdt.c 16 Feb 2017 18:02:22 -0000 1.231
> > > > > +++ dsdt.c 25 Mar 2017 21:16:04 -0000
> > > > > @@ -1261,7 +1261,6 @@ aml_find_node(struct aml_node *node, con
> > > > > const char *nn;
> > > > >
> > > > > SIMPLEQ_FOREACH(child, &node->son, sib) {
> > > > > - nn = child->name;
> > > > > if ((nn = child->name) != NULL) {
> > > > > if (*nn == AMLOP_ROOTCHAR) nn++;
> > > > > while (*nn == AMLOP_PARENTPREFIX) nn++;
Digging through some old diffs. Any ok's for this one? Although, I would
prefer keeping the assignment outside of the conditional.
Tested on amd64.
Index: dsdt.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/dsdt.c,v
retrieving revision 1.233
diff -u -p -r1.233 dsdt.c
--- dsdt.c 15 Apr 2017 04:54:04 -0000 1.233
+++ dsdt.c 28 May 2017 08:23:41 -0000
@@ -1260,7 +1260,7 @@ aml_find_node(struct aml_node *node, con
SIMPLEQ_FOREACH(child, &node->son, sib) {
nn = child->name;
- if ((nn = child->name) != NULL) {
+ if (nn != NULL) {
if (*nn == AMLOP_ROOTCHAR) nn++;
while (*nn == AMLOP_PARENTPREFIX) nn++;
if (strcmp(name, nn) == 0) {