Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1380259

Re: [PATCH net-next 7/7] net: dsa: mv88e6xxx: drop switch id

From Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 7/7] net: dsa: mv88e6xxx: drop switch id
Date 2016-04-15 23:10 +0200
Message-ID <roja2-X1-15@gated-at.bofh.it> (permalink)
References <rogFb-7ma-3@gated-at.bofh.it> <rogFc-7ma-33@gated-at.bofh.it> <rohKY-8cQ-69@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Andrew,

Andrew Lunn <andrew@lunn.ch> writes:

<snip>

>> -#define PORT_SWITCH_ID_6350	0x3710
>> -#define PORT_SWITCH_ID_6351	0x3750
>> -#define PORT_SWITCH_ID_6352	0x3520
>
> NACK
>
> These numbers are not obvious. PORT_SWITCH_ID_6320 i can
> understand. 0x1150 i have no idea what it is.

0x1150 is not even correct. That's the product number (bits 4:15) masked
with an assumed revision 0 (bits 0:3).

That leads to confusion and error, as seen in the patch 2/7.

These values are now only used in a device description table, where they
seem pretty understandable to me.

This header file is full of inconsistencies. We have masks, offsets,
shifts, shifted and unshifted values, just for the sake of hidding said
magic numbers, while an explicit comment in a function could do the job.

But OK if we really want them defined, I'll introduce 12-bit
PORT_SWITCH_ID_PROD_NUM_* before dropping the 16-bit PORT_SWITCH_ID_*.

Thanks,
Vivien

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 7/7] net: dsa: mv88e6xxx: drop switch id Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-04-15 20:30 +0200
  Re: [PATCH net-next 7/7] net: dsa: mv88e6xxx: drop switch id Andrew Lunn <andrew@lunn.ch> - 2016-04-15 21:40 +0200
    Re: [PATCH net-next 7/7] net: dsa: mv88e6xxx: drop switch id Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-04-15 23:10 +0200
      Re: [PATCH net-next 7/7] net: dsa: mv88e6xxx: drop switch id Andrew Lunn <andrew@lunn.ch> - 2016-04-16 00:00 +0200

csiph-web