All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jes Sorensen <jes.sorensen@gmail.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: David Miller <davem@davemloft.net>,
	arnd@arndb.de, helmut.schaa@googlemail.com, kvalo@codeaurora.org,
	daniel@makrotopia.org, dev@kresin.me, johannes.berg@intel.com,
	pozega.tomislav@gmail.com, vasilugin@yandex.ru, roman@advem.lv,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rt2x00: improve calling conventions for register accessors
Date: Tue, 16 May 2017 09:44:19 -0400	[thread overview]
Message-ID: <0ce21c48-1d2c-3035-3c6e-52c7debf86d5@gmail.com> (raw)
In-Reply-To: <20170516115511.GA4230@redhat.com>

On 05/16/2017 07:55 AM, Stanislaw Gruszka wrote:
> On Mon, May 15, 2017 at 10:39:51AM -0400, David Miller wrote:
>> Passing return values by reference is and always has been a really
>> poor way to achieve what these functions are doing.
>>
>> And frankly, whilst the tool could see what's going on here better, we
>> should be making code easier rather than more difficult to audit.
>>
>> I am therefore very much in favor of Arnd's change.
>>
>> This isn't even a situation where there are multiple return values,
>> such as needing to signal an error and return an unsigned value at the
>> same time.
>>
>> These functions return _one_ value, and therefore they should be
>> returned as a true return value.
> 
> In rt2x00 driver we use poor convention in other kind of registers
> accessors like bbp, mac, eeprom. I dislike to changing only rfcsr
> accessors and leaving others in the old way. And changing all accessors
> would be massive and error prone change, which I'm not prefer either.

That's why you do it in multiple smaller patches rather than one ugly 
giant patch.

The rt2x00 current register accessor functions makes the Realtek vendor 
driver equivalent ones look pretty, which is saying something.

Jes

  parent reply	other threads:[~2017-05-16 13:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-15 13:46 [PATCH] rt2x00: improve calling conventions for register accessors Arnd Bergmann
2017-05-15 14:28 ` Stanislaw Gruszka
2017-05-15 14:36   ` Arnd Bergmann
2017-05-15 14:40     ` David Miller
2017-05-15 19:02       ` Daniel Golle
2017-05-15 19:02         ` Daniel Golle
2017-05-15 14:39   ` David Miller
2017-05-16 11:55     ` Stanislaw Gruszka
2017-05-16 11:58       ` Johannes Berg
2017-05-16 12:43         ` Stanislaw Gruszka
2017-05-16 15:37         ` David Miller
2017-05-16 13:44       ` Jes Sorensen [this message]
2017-05-16 14:19         ` Arnd Bergmann
2017-05-16 14:19           ` Arnd Bergmann
2017-05-16 14:31           ` Jes Sorensen
2017-05-16 14:31             ` Jes Sorensen
     [not found]             ` <CAKR_QVKYpcficnx5G5NdLKh7xa9S18udYQNXDQ=LmfG=Qeapbg@mail.gmail.com>
2017-05-17 14:48               ` Arnd Bergmann
2017-05-16 14:23       ` Stanislaw Gruszka
2017-05-16 15:11         ` Arnd Bergmann
2017-05-16 15:11           ` Arnd Bergmann

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=0ce21c48-1d2c-3035-3c6e-52c7debf86d5@gmail.com \
    --to=jes.sorensen@gmail.com \
    --cc=arnd@arndb.de \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=dev@kresin.me \
    --cc=helmut.schaa@googlemail.com \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pozega.tomislav@gmail.com \
    --cc=roman@advem.lv \
    --cc=sgruszka@redhat.com \
    --cc=vasilugin@yandex.ru \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.