Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1231928

Re: [PATCH v11 3/4] add FPGA manager core

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH v11 3/4] add FPGA manager core
Date 2015-09-24 10:00 +0200
Message-ID <qc9BD-5cV-1@gated-at.bofh.it> (permalink)
References (1 earlier) <qbEoa-26P-27@gated-at.bofh.it> <qbEoa-26P-23@gated-at.bofh.it> <qbShr-5pG-1@gated-at.bofh.it> <qbT3Q-6As-9@gated-at.bofh.it> <qc9BD-5cV-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Of course, the maintainer gets the last word regardless of what anyone
else thinks.

Generally, minimal code is better.  Trying to future proof code is a
waste of time because you can't predict what will happen in the future.
It's way more likely that some pointer you never expected to be NULL
will be NULL instead of the few checked at the beginning of a function.
Adding useless code uses RAM and makes the function slower.  It's a bit
confusing for users as well because they will wonder when the NULL check
is used.  A lot of times this sort of error handling is a bit fake and
what I mean is that it looks correct but the system will just crash in a
later function.

Also especially with a simple NULL dereferences like this theoretical
one, it's better to just get the oops.  It kills the module but you get
a good message in the log and it's normally straight forward to debug.

We spent a surprising amount of time discussing useless code.  I made
someone redo a patch yesterday because they had incomplete error
handling for a situation which could never happen.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v11 3/4] add FPGA manager core Josh Cartwright <joshc@ni.com> - 2015-09-23 00:40 +0200
  Re: [PATCH v11 3/4] add FPGA manager core Pavel Machek <pavel@denx.de> - 2015-09-23 15:30 +0200
    Re: [PATCH v11 3/4] add FPGA manager core Dan Carpenter <dan.carpenter@oracle.com> - 2015-09-23 16:20 +0200
      Re: [PATCH v11 3/4] add FPGA manager core Dan Carpenter <dan.carpenter@oracle.com> - 2015-09-24 10:00 +0200
        Re: [PATCH v11 3/4] add FPGA manager core Pavel Machek <pavel@denx.de> - 2015-09-24 23:20 +0200
        Re: [PATCH v11 3/4] add FPGA manager core Dan Carpenter <dan.carpenter@oracle.com> - 2015-09-25 12:10 +0200
  Re: [PATCH v11 3/4] add FPGA manager core Josh Cartwright <joshc@ni.com> - 2015-09-24 01:10 +0200

csiph-web