public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	navin patidar <navin.patidar@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8188eu: hal: phy: Removed variables that is never used
Date: Sat, 31 Jan 2015 19:14:15 +0300	[thread overview]
Message-ID: <20150131161415.GD6456@mwanda> (raw)
In-Reply-To: <1422714597-31736-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

> I have also removed all the code that thereby serves no purpose.

[ snip ]

> @@ -743,7 +743,7 @@ static u8 phy_path_a_iqk(struct adapter *adapt, bool config_pathb)
>  	reg_eac = phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
>  	reg_e94 = phy_query_bb_reg(adapt, rTx_Power_Before_IQK_A, bMaskDWord);
>  	reg_e9c = phy_query_bb_reg(adapt, rTx_Power_After_IQK_A, bMaskDWord);
> -	reg_ea4 = phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord);
> +	phy_query_bb_reg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord);
>  
>  	if (!(reg_eac & BIT28) &&
>  	    (((reg_e94 & 0x03FF0000)>>16) != 0x142) &&

You clearly didn't remove *all* the "code that thereby serves no
purpose".

Could we call a cease fire on these and stop sending them until Greg or
someone else weighs in?  It's hard for me to comment on 50 patches that
I don't like.

To re-iterate:

1) Removing part of the line is 90% likely to be wrong.  We can't know
   without knowing the code better, knowing the hardware, or testing.

2) Silencing static checker warnings in the wrong way, negates the
   usefulness of static checkers and makes bad code hard to find.  Some
   of these "unused" variable warnings could easily be bugs so we are
   hiding bugs.

3) From an aesthetic point of view the code was easier to understand
   before.  The line you have deleted was clearly copy and pasted from
   the line before.  But now it looks deliberate and the information we
   need to understand the original intent is hidden in the git log.

regards,
dan carpenter


      reply	other threads:[~2015-01-31 16:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-31 14:29 [PATCH] staging: rtl8188eu: hal: phy: Removed variables that is never used Rickard Strandqvist
2015-01-31 16:14 ` Dan Carpenter [this message]

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=20150131161415.GD6456@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=navin.patidar@gmail.com \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /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