public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Maninder Singh <maninder1.s@samsung.com>
Cc: forest@alittletooquiet.net, gregkh@linuxfoundation.org,
	devel@driverdev.osuosl.org, gclement@baobob.org,
	tvboxspy@gmail.com, linux-kernel@vger.kernel.org,
	joe@perches.com, pankaj.m@samsung.com
Subject: Re: [RESEND PATCH 1/1] staging:vt6655: remove checks around dev_kfree_skb
Date: Thu, 16 Jul 2015 10:54:42 +0300	[thread overview]
Message-ID: <20150716075441.GG5835@mwanda> (raw)
In-Reply-To: <1436930571-17832-1-git-send-email-maninder1.s@samsung.com>

On Wed, Jul 15, 2015 at 08:52:51AM +0530, Maninder Singh wrote:
> dev_kfree_skb checks for NULL pointer itself,
> Thus no need of explicit NULL check.
> 

I hate these patches.  I have told Markus to stop sending them but he
has issues so now I only complain when they introduce a bug.  There was
one bug I have missed because it was a benchmark regression and I knew
it was theoretically possible but I didn't know the code well enough to
say which were fast paths...

My main objection is that relying on the sanity check inside the
function call makes the code more subtle to understand.  We know we need
a NULL check but it is hidden away in another file.  The motivation for
this patch you are sending is "There is a sanity check in dev_kfree_skb()
so let's do an insane thing and save some lines of code."

For this particular patch we assume throughout the whole driver that
"pTDInfo->skb" can be NULL so making it inconsistent in this one place
is wrong.

regards,
dan carpenter


  reply	other threads:[~2015-07-16  7:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-15  3:22 [RESEND PATCH 1/1] staging:vt6655: remove checks around dev_kfree_skb Maninder Singh
2015-07-16  7:54 ` Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-07-16  8:45 Maninder Singh
2015-07-16  8:54 ` Dan Carpenter
2015-07-16 10:08   ` Malcolm Priestley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150716075441.GG5835@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=forest@alittletooquiet.net \
    --cc=gclement@baobob.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maninder1.s@samsung.com \
    --cc=pankaj.m@samsung.com \
    --cc=tvboxspy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox