2017-09-07 21:11:03

by Tristram.Ha

[permalink] [raw]
Subject: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.

From: Tristram Ha <[email protected]>

Break ksz_common.c into 2 files so that the common code can be used by other KSZ switch drivers.

Signed-off-by: Tristram Ha <[email protected]>
---
diff --git a/drivers/net/dsa/microchip/Makefile b/drivers/net/dsa/microchip/Makefile
index ed335e2..0961c30 100644
--- a/drivers/net/dsa/microchip/Makefile
+++ b/drivers/net/dsa/microchip/Makefile
@@ -1,2 +1,2 @@
-obj-$(CONFIG_MICROCHIP_KSZ) += ksz_common.o
+obj-$(CONFIG_MICROCHIP_KSZ) += ksz9477.o ksz_common.o
obj-$(CONFIG_MICROCHIP_KSZ_SPI_DRIVER) += ksz_spi.o


2017-09-07 21:24:54

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.

On Thu, Sep 07, 2017 at 09:08:58PM +0000, [email protected] wrote:
> From: Tristram Ha <[email protected]>
>
> Break ksz_common.c into 2 files so that the common code can be used by other KSZ switch drivers.
>
> Signed-off-by: Tristram Ha <[email protected]>
> ---
> diff --git a/drivers/net/dsa/microchip/Makefile b/drivers/net/dsa/microchip/Makefile
> index ed335e2..0961c30 100644
> --- a/drivers/net/dsa/microchip/Makefile
> +++ b/drivers/net/dsa/microchip/Makefile
> @@ -1,2 +1,2 @@
> -obj-$(CONFIG_MICROCHIP_KSZ) += ksz_common.o
> +obj-$(CONFIG_MICROCHIP_KSZ) += ksz9477.o ksz_common.o
> obj-$(CONFIG_MICROCHIP_KSZ_SPI_DRIVER) += ksz_spi.o

Hi Tristram

I would of thought this would break the build. You don't add ksz9477.c
until the next patch.

Each patch needs to compile, otherwise you break git bisect.

Andrew

2017-09-07 22:26:29

by Tristram.Ha

[permalink] [raw]
Subject: RE: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.

> -----Original Message-----
> From: Andrew Lunn [mailto:[email protected]]
> Sent: Thursday, September 07, 2017 2:25 PM
> To: Tristram Ha - C24268
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; Woojung Huh - C21699
> Subject: Re: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ
> switch drivers.
>
> On Thu, Sep 07, 2017 at 09:08:58PM +0000, [email protected] wrote:
> > From: Tristram Ha <[email protected]>
> >
> > Break ksz_common.c into 2 files so that the common code can be used by other
> KSZ switch drivers.
> >
> > Signed-off-by: Tristram Ha <[email protected]>
> > ---
> > diff --git a/drivers/net/dsa/microchip/Makefile
> > b/drivers/net/dsa/microchip/Makefile
> > index ed335e2..0961c30 100644
> > --- a/drivers/net/dsa/microchip/Makefile
> > +++ b/drivers/net/dsa/microchip/Makefile
> > @@ -1,2 +1,2 @@
> > -obj-$(CONFIG_MICROCHIP_KSZ) += ksz_common.o
> > +obj-$(CONFIG_MICROCHIP_KSZ) += ksz9477.o ksz_common.o
> > obj-$(CONFIG_MICROCHIP_KSZ_SPI_DRIVER) += ksz_spi.o
>
> Hi Tristram
>
> I would of thought this would break the build. You don't add ksz9477.c until the
> next patch.
>
> Each patch needs to compile, otherwise you break git bisect.
>
> Andrew

Eventually the file will need to be broken in two, so you would like to see all 3 changes (Makefile, ksz_common.c, and ksz9477.c) in 1 patch file?

2017-09-07 22:40:41

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.

> > > Signed-off-by: Tristram Ha <[email protected]>
> > > ---
> > > diff --git a/drivers/net/dsa/microchip/Makefile
> > > b/drivers/net/dsa/microchip/Makefile
> > > index ed335e2..0961c30 100644
> > > --- a/drivers/net/dsa/microchip/Makefile
> > > +++ b/drivers/net/dsa/microchip/Makefile
> > > @@ -1,2 +1,2 @@
> > > -obj-$(CONFIG_MICROCHIP_KSZ) += ksz_common.o
> > > +obj-$(CONFIG_MICROCHIP_KSZ) += ksz9477.o ksz_common.o
> > > obj-$(CONFIG_MICROCHIP_KSZ_SPI_DRIVER) += ksz_spi.o
> >
> > Hi Tristram
> >
> > I would of thought this would break the build. You don't add ksz9477.c until the
> > next patch.
> >
> > Each patch needs to compile, otherwise you break git bisect.
> >
> > Andrew
>

> Eventually the file will need to be broken in two, so you would like
> to see all 3 changes (Makefile, ksz_common.c, and ksz9477.c) in 1
> patch file?

You cannot break the build. Each patch must compile on its own.

Breaking changes up into smaller chunks is good. Makes it easier to
review. So think about how you can do it without breaking the build,
but have smaller changes. For example, move a group of functions at a
time?

Andrew

2017-09-08 00:40:07

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.

On Thu, Sep 07, 2017 at 09:08:58PM +0000, [email protected] wrote:
> From: Tristram Ha <[email protected]>

Hi Tristram

Another process thing you are missing. Patch subject should follow a
pattern:

git log --oneline drivers/net/dsa/mv88e6xxx
bb0a2675f72b net: dsa: mv88e6xxx: Enable CMODE config support for 6390X
b3e05aa12319 net: dsa: mv88e6xxx: add a multi_chip info flag
68b8f60cf70d net: dsa: mv88e6xxx: add Energy Detect ops
9069c13a4867 net: dsa: mv88e6xxx: add a global2_addr info flag
9e907d739cc3 net: dsa: mv88e6xxx: add POT operation
a2a05db8a5ed net: dsa: mv88e6xxx: add POT flag to 88E6390
51c901a77562 net: dsa: mv88e6xxx: distinguish Global 2 Rsvd2CPU
d6c5e6aff50c net: dsa: mv88e6xxx: add number of Global 2 IRQs
74e60241ce14 net: dsa: mv88e6xxx: remove 88E6185 G2 interrupt
2466f64ae4e9 net: dsa: mv88e6xxx: remove unused capabilities

Please set the subject line in your patches similarly.

Andrew

2017-09-08 08:56:56

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.

On Thu 2017-09-07 21:08:58, [email protected] wrote:
> From: Tristram Ha <[email protected]>
>
> Break ksz_common.c into 2 files so that the common code can be used by other KSZ switch drivers.
>
> Signed-off-by: Tristram Ha <[email protected]>
> ---
> diff --git a/drivers/net/dsa/microchip/Makefile b/drivers/net/dsa/microchip/Makefile
> index ed335e2..0961c30 100644
> --- a/drivers/net/dsa/microchip/Makefile
> +++ b/drivers/net/dsa/microchip/Makefile
> @@ -1,2 +1,2 @@
> -obj-$(CONFIG_MICROCHIP_KSZ) += ksz_common.o
> +obj-$(CONFIG_MICROCHIP_KSZ) += ksz9477.o ksz_common.o
> obj-$(CONFIG_MICROCHIP_KSZ_SPI_DRIVER) += ksz_spi.o

I believe you should also rename option to CONFIG_MICROCHIP_KSZ_9477
here... and introduce appropriate Kconfig change.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (947.00 B)
signature.asc (181.00 B)
Digital signature
Download all attachments

2017-09-08 08:57:43

by Pavel Machek

[permalink] [raw]
Subject: Re: [PATCH RFC 1/6] The file ksz_common.c will be used by other KSZ switch drivers.


> > > Signed-off-by: Tristram Ha <[email protected]>
> > > ---
> > > diff --git a/drivers/net/dsa/microchip/Makefile
> > > b/drivers/net/dsa/microchip/Makefile
> > > index ed335e2..0961c30 100644
> > > --- a/drivers/net/dsa/microchip/Makefile
> > > +++ b/drivers/net/dsa/microchip/Makefile
> > > @@ -1,2 +1,2 @@
> > > -obj-$(CONFIG_MICROCHIP_KSZ) += ksz_common.o
> > > +obj-$(CONFIG_MICROCHIP_KSZ) += ksz9477.o ksz_common.o
> > > obj-$(CONFIG_MICROCHIP_KSZ_SPI_DRIVER) += ksz_spi.o
> >
> > Hi Tristram
> >
> > I would of thought this would break the build. You don't add ksz9477.c until the
> > next patch.
> >
> > Each patch needs to compile, otherwise you break git bisect.
> >
> > Andrew
>
> Eventually the file will need to be broken in two, so you would like
>to see all 3 changes (Makefile, ksz_common.c, and ksz9477.c) in 1
> patch file?

Yes please.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


Attachments:
(No filename) (1.02 kB)
signature.asc (181.00 B)
Digital signature
Download all attachments