public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Raphaël Beamonte" <raphael.beamonte@gmail.com>
Cc: Cristina Opriceana <cristina.opriceana@gmail.com>,
	devel@driverdev.osuosl.org, lkml <linux-kernel@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCHv2 03/16] staging: rtl8192u: r8192U_core: add temporary variables to keep lines under 80 characters
Date: Wed, 16 Sep 2015 22:18:29 -0700	[thread overview]
Message-ID: <20150917051829.GA12481@kroah.com> (raw)
In-Reply-To: <CAE_Gge1cGbeV93bzF_1Vo9S-3QtxtASSD1Mzt_ULcPux41Aa-w@mail.gmail.com>

On Thu, Sep 17, 2015 at 01:06:33AM -0400, Raphaël Beamonte wrote:
> 2015-09-17 0:57 GMT-04:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> <SNIP>
> >> @@ -1748,8 +1755,9 @@ static short rtl8192_usb_initendpoints(struct net_device *dev)
> >>               oldaddr = priv->oldaddr;
> >>               align = ((long)oldaddr) & 3;
> >>               if (align) {
> >> -                     newaddr = oldaddr + 4 - align;
> >> -                     priv->rx_urb[16]->transfer_buffer_length = 16 - 4 + align;
> >> +                     align = 4 - align;
> >> +                     newaddr = oldaddr + align;
> >> +                     priv->rx_urb[16]->transfer_buffer_length = 16 - align;
> >
> > At a quick glance, this conversion looks wrong...
> 
> What is wrong with it?
> 
> oldaddr + 4 - align;
> can also be read:
> oldaddr + (4 - align);
> 
> as well as
> 16 - 4 + align;
> can also be read
> 16 - (4 - align);
> as when we remove the parenthesis, the - sign invert the parenthesis
> elements signs.
> 
> Calculating (4 - align) previously thus preserve the logic here!

Ugh, it's been a long day, yeah, ok, this is the same, you are right.

But step back please, what exactly is this trying to do?  I think it's a
round_up type function, perhaps that should be what we do instead (the
kernel has such functions already.)

> > And it's not what your changelog text said you were doing :(
> 
> It's true that I didn't add a new temporary variable here but instead
> re-used one that is not used after, but I thought it went in the same
> idea as the rest of this patch. Should I separate that as another
> patch?

It might be the same "idea", but it's not what you did, so don't try to
sneak it in.

greg k-h

  reply	other threads:[~2015-09-17  5:18 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11  7:29 [PATCHv2 00/16] staging: rtl8192u: code clean up Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 01/16] staging: rtl8192u: r8192U_core: fix comments lines over 80 characters Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 02/16] staging: rtl8192u: r8192U_core: add line breaks to keep lines under " Raphaël Beamonte
2015-09-17  4:55   ` Greg Kroah-Hartman
2015-09-11  7:29 ` [PATCHv2 03/16] staging: rtl8192u: r8192U_core: add temporary variables " Raphaël Beamonte
2015-09-17  4:57   ` Greg Kroah-Hartman
2015-09-17  5:06     ` Raphaël Beamonte
2015-09-17  5:18       ` Greg Kroah-Hartman [this message]
2015-09-17 18:26         ` Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 04/16] staging: rtl8192u: r8192U_core: reverse conditions to get " Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 05/16] staging: rtl8192u: r8192U_core: rtl8192_adapter_start: reorganize function Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 06/16] staging: rtl8192u: r8192U_core: rtl8192_read_eeprom_info: " Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 07/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable pprevious_stats to prev_stats Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 08/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable slide_beacon_adc_pwdb_index to sb_index Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 09/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable slide_beacon_adc_pwdb_statistics to sb_stats Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 10/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: remove unneeded variable Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 11/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable rfpath to rfp Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 12/16] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: reorganize function Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 13/16] staging: rtl8192u: r8192U_core: rtl8192_tx: replace some inline conditions Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 14/16] staging: rtl8192u: r8192U_core: rtl8192_ioctl: reorganize function Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 15/16] staging: rtl8192u: r8192U_core: replace else { if() {} } by else if () {} Raphaël Beamonte
2015-09-11  7:29 ` [PATCHv2 16/16] staging: rtl8192u: remove all code framed by symbol TO_DO_LIST Raphaël Beamonte
2015-09-20 17:14 ` [PATCHv3 00/15] staging: rtl8192u: code clean up Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 01/15] staging: rtl8192u: r8192U_core: add line breaks to keep lines under 80 characters Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 02/15] staging: rtl8192u: r8192U_core: add temporary variables " Raphaël Beamonte
2015-09-21  2:16     ` Greg Kroah-Hartman
2015-09-21 16:31       ` Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 03/15] staging: rtl8192u: r8192U_core: reverse conditions to get " Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 04/15] staging: rtl8192u: r8192U_core: rtl8192_adapter_start: reorganize function Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 05/15] staging: rtl8192u: r8192U_core: rtl8192_read_eeprom_info: " Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 06/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable pprevious_stats to prev_stats Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 07/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable slide_beacon_adc_pwdb_index to sb_index Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 08/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable slide_beacon_adc_pwdb_statistics to sb_stats Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 09/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: remove unneeded variable Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 10/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: rename variable rfpath to rfp Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 11/15] staging: rtl8192u: r8192U_core: rtl8192_process_phyinfo: reorganize function Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 12/15] staging: rtl8192u: r8192U_core: rtl8192_tx: replace some inline conditions Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 13/15] staging: rtl8192u: r8192U_core: rtl8192_ioctl: reorganize function Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 14/15] staging: rtl8192u: r8192U_core: replace else { if() {} } by else if () {} Raphaël Beamonte
2015-09-20 17:14   ` [PATCHv3 15/15] staging: rtl8192u: remove all code framed by symbol TO_DO_LIST Raphaël Beamonte

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=20150917051829.GA12481@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=cristina.opriceana@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raphael.beamonte@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