Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1464671
| From | Linus Torvalds <torvalds@linux-foundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCHv6 1/2] add basic register-field manipulation macros |
| Date | 2016-08-17 19:20 +0200 |
| Message-ID | <s7cFs-40T-27@gated-at.bofh.it> (permalink) |
| References | <s6OjL-4IB-5@gated-at.bofh.it> <s6OjL-4IB-15@gated-at.bofh.it> <s76qm-8dD-31@gated-at.bofh.it> <s7c2J-3xu-1@gated-at.bofh.it> <s7cFs-40T-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Aug 17, 2016 at 10:11 AM, Jakub Kicinski
<jakub.kicinski@netronome.com> wrote:
> On Wed, 17 Aug 2016 09:33:26 -0700, Linus Torvalds wrote:
>>
>> I'm not a huge fan, since the interface fundamentally seems to be
>> oddly designed (why pass in the mask rather than "start bit +
>> length"?).
>
> Would that not require start and length to have separate defines?
Yeah.
> I assume doing:
>
> #define REG_BLA_FIELD_FOO 3, 4
> val = FIELD_GET(REG_BLA_FIELD_FOO, reg);
>
> is not acceptable. Attempts to define a single value brought us to the
> shifted mask.
Agreed. Maybe the mask with the complexity to then undo it (at compile
time) is the better approach.
Linus
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHv6 0/2] register-field manipulation macros Jakub Kicinski <jakub.kicinski@netronome.com> - 2016-08-16 17:20 +0200
[PATCHv6 1/2] add basic register-field manipulation macros Jakub Kicinski <jakub.kicinski@netronome.com> - 2016-08-16 17:20 +0200
Re: [PATCHv6 1/2] add basic register-field manipulation macros Kalle Valo <kvalo@codeaurora.org> - 2016-08-17 12:40 +0200
Re: [PATCHv6 1/2] add basic register-field manipulation macros Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 18:40 +0200
Re: [PATCHv6 1/2] add basic register-field manipulation macros Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-17 19:20 +0200
Re: [RFC (v7)] add basic register-field manipulation macros Linus Torvalds <torvalds@linux-foundation.org> - 2016-08-19 04:40 +0200
Re: [RFC (v7)] add basic register-field manipulation macros Kalle Valo <kvalo@codeaurora.org> - 2016-08-19 11:20 +0200
[RFC (v7)] add basic register-field manipulation macros Jakub Kicinski <jakub.kicinski@netronome.com> - 2016-08-19 08:50 +0200
Re: [PATCHv6 1/2] add basic register-field manipulation macros Jakub Kicinski <jakub.kicinski@netronome.com> - 2016-08-17 19:20 +0200
[PATCHv6 2/2] mt7601u: use linux/bitfield.h Jakub Kicinski <jakub.kicinski@netronome.com> - 2016-08-16 17:20 +0200
csiph-web