[haiku-commits] Re: r41815 - haiku/trunk/src/add-ons/kernel/drivers/network/ipro1000/dev/e1000

> Author: modeenf
> Date: 2011-05-29 21:27:05 +0200 (Sun, 29 May 2011)
> New Revision: 41815
> Changeset: https://dev.haiku-os.org/changeset/41815
> 
> Added:
>    haiku/trunk/src/add-
> ons/kernel/drivers/network/ipro1000/dev/e1000/e1000_mbx.c
> ...
> Modified:
>    haiku/trunk/src/add-
> ons/kernel/drivers/network/ipro1000/dev/e1000/Jamfile
> ...
>    haiku/trunk/src/add-
> ons/kernel/drivers/network/ipro1000/dev/e1000/if_igb.h
> Log:
> Hope I fix more than I breake with this update of ipro1000
> it's taken from freebsd driver e1000 r221505

You just committed modified vendor code directly to trunk. Please don't 
do it that way. There are vendor branches that should be updated with 
the unmodified version of the vendor source you are working from 
(sources from FreeBSD r221505 in this case). Then any Haiku specific 
changes are supposed to be applied to these sources while merging them 
into trunk. This gives a way to see what changes exactly were done 
between the original sources and what ends up in trunk.

> This include alot of cards (including my HP)
> ...
> The part below was perhaps needed but I could not fix the error that 
> whas showing (located in if_em.c) aslo it works as is on my HP 8540.

While it certainly is nice to get newer cards supported, I don't think 
it is the right thing to just ignore problems like this and commit 
anyway. If this part was actually needed you might break a lot of 
previously supported cards this way which'd affect a lot of users.

If you aren't able to solve a problem yourself, discuss the problem on 
a mailing list, post a diff, commit to a separate branch so that someone 
else can take a look or simply don't commit until you can either be 
sure that the code you're adding/removing/changing is correct (by 
understanding what it does or doesn't do) or until you find and fix the 
problem. Anything else is just guesswork and results in poor code 
quality over time.

> static int
> em_sysctl_reg_handler(SYSCTL_HANDLER_ARGS)
> {
>       struct adapter *adapter;
>       u_int val;
> 
>       adapter = oidp->oid_arg1;
>       val = E1000_READ_REG(&adapter->hw, oidp->oid_arg2);
>       return (sysctl_handle_int(oidp, &val, 0, req));
> }

In this case you could've just looked up the sysctl function to see 
that they are all stubs in our FreeBSD compatibility layer right now. 
So the code doesn't do anything on Haiku either way. I hope by 
"removing it" you simply meant surrounding it with "#ifndef __HAIKU__" 
so one can easily spot it, anyway.

Regards
Michael

PS: Try typing a bit slower and/or proof reading.

Other related posts: