netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug in qeth in 2.6
@ 2003-09-03 18:54 Pete Zaitcev
  0 siblings, 0 replies; 4+ messages in thread
From: Pete Zaitcev @ 2003-09-03 18:54 UTC (permalink / raw)
  To: cohuck; +Cc: netdev, zaitcev

This code is obviously broken in case several cards are present,
look what happens to ``result''.

devices/s390/net/qeth.c:

static int
qeth_verify_dev(struct net_device *dev)
{
        struct qeth_card *tmp;
        int result = 0;
                                                                                
        read_lock(&list_lock);
        tmp = firstcard;
        for (; tmp && (!result); tmp = tmp->next) {
                if (atomic_read(&tmp->shutdown_phase))
                        continue;
                result = (dev == tmp->dev)?
                        QETH_VERIFY_IS_REAL_DEV:__qeth_verify_dev_vlan(dev, tmp);
        }
        read_unlock(&list_lock);
        return result;
}

Someone got seriously carried away with cleanups.
I have to say, I'm disappointed. The original qeth in 2.4
had poor C style, but it was a mistake to run amok adding
spaces. The diff between 2.4 and 2.6 is too hard to read,
even with -b. Now I have to review whole darn thing line by line.
Oh woe!

-- Pete

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

* Re: Bug in qeth in 2.6
@ 2003-09-04  8:54 Cornelia Huck
  2003-09-04 15:45 ` Pete Zaitcev
  0 siblings, 1 reply; 4+ messages in thread
From: Cornelia Huck @ 2003-09-04  8:54 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: netdev, zaitcev, Utz Bacher

Hi Pete,

could you please elaborate what's exactly wrong with qeth_verify_dev()?

It has the same behaviour as in 2.4, and it looks correct to us...

Best regards / Mit freundlichen Gruessen

Cornelia Huck
zLinux Developer
Tel.: +49-7031-16-4837, Mail: cohuck@de.ibm.com

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

* Re: Bug in qeth in 2.6
  2003-09-04  8:54 Bug in qeth in 2.6 Cornelia Huck
@ 2003-09-04 15:45 ` Pete Zaitcev
  0 siblings, 0 replies; 4+ messages in thread
From: Pete Zaitcev @ 2003-09-04 15:45 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: Pete Zaitcev, netdev, Utz Bacher

On Thu, Sep 04, 2003 at 10:54:43AM +0200, Cornelia Huck wrote:
> could you please elaborate what's exactly wrong with qeth_verify_dev()?
> 
> It has the same behaviour as in 2.4, and it looks correct to us...

2.4 was like this:

	result = 0;
	for (all in list) {
		if (something)
			result = QETH_VERIFY_IS_SOMETHING;
	}

2.6 is:

	result = 0;
	for (all in list) {
		result = (something)? QETH_VERIFY_IS_SOMETHING: foo();
	}

Results are different if two cards are present on the list
and the function is asked to verify the first card.

-- Pete

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

* Re: Bug in qeth in 2.6
@ 2003-09-04 16:01 Cornelia Huck
  0 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2003-09-04 16:01 UTC (permalink / raw)
  To: Pete Zaitcev; +Cc: netdev, Utz Bacher, Pete Zaitcev

Hi,

sorry, I still don't see it...

> 2.4 was like this:
>
>            result = 0;
>            for (all in list) {
>                        if (something)
>                                    result = QETH_VERIFY_IS_SOMETHING;

and it stops here if something...

>            }

... and here follows a second loop over the list, looking for foo().

>
> 2.6 is:
>
>            result = 0;
>            for (all in list) {
>                        result = (something)? QETH_VERIFY_IS_SOMETHING:
foo();

and here it stops if something or foo()...

>            }

...no second loop here.

Since it's either something or foo(), this looks like the same behaviour to
me.

Best regards / Mit freundlichen Gruessen

Cornelia Huck
zLinux Developer
Tel.: +49-7031-16-4837, Mail: cohuck@de.ibm.com

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

end of thread, other threads:[~2003-09-04 16:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-04  8:54 Bug in qeth in 2.6 Cornelia Huck
2003-09-04 15:45 ` Pete Zaitcev
  -- strict thread matches above, loose matches on Subject: below --
2003-09-04 16:01 Cornelia Huck
2003-09-03 18:54 Pete Zaitcev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).