netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] fec: Use DIV_ROUND_UP macro
@ 2013-05-21 15:44 Fabio Estevam
  2013-05-21 15:44 ` [PATCH 2/2] fec: Remove <linux/fec.h> header file Fabio Estevam
  2013-05-23  7:05 ` [PATCH 1/2] fec: Use DIV_ROUND_UP macro David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Fabio Estevam @ 2013-05-21 15:44 UTC (permalink / raw)
  To: davem; +Cc: shawn.guo, netdev, kernel, Fabio Estevam

Use the standard DIV_ROUND_UP macro in order to provide better readability.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/ethernet/freescale/fec_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index e277860..706e224 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -242,7 +242,7 @@ static void *swap_buffer(void *bufaddr, int len)
 	int i;
 	unsigned int *buf = bufaddr;
 
-	for (i = 0; i < (len + 3) / 4; i++, buf++)
+	for (i = 0; i < DIV_ROUND_UP(len, 4); i++, buf++)
 		*buf = cpu_to_be32(*buf);
 
 	return bufaddr;
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] fec: Remove <linux/fec.h> header file
  2013-05-21 15:44 [PATCH 1/2] fec: Use DIV_ROUND_UP macro Fabio Estevam
@ 2013-05-21 15:44 ` Fabio Estevam
  2013-05-21 16:02   ` Fabio Estevam
  2013-05-23  7:05 ` [PATCH 1/2] fec: Use DIV_ROUND_UP macro David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2013-05-21 15:44 UTC (permalink / raw)
  To: davem; +Cc: shawn.guo, netdev, kernel, Fabio Estevam

There is no need to have a header file to hold a single structure.

Move the 'fec_platform_data' structure definition into the local "fec.h" file 
and get rid of <linux/fec.h> header.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/net/ethernet/freescale/fec.h      |  6 ++++++
 drivers/net/ethernet/freescale/fec_main.c |  1 -
 drivers/net/ethernet/freescale/fec_ptp.c  |  1 -
 include/linux/fec.h                       | 24 ------------------------
 4 files changed, 6 insertions(+), 26 deletions(-)
 delete mode 100644 include/linux/fec.h

diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index 9ce5b71..d036303 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -16,6 +16,7 @@
 #include <linux/clocksource.h>
 #include <linux/net_tstamp.h>
 #include <linux/ptp_clock_kernel.h>
+#include <linux/phy.h>
 
 #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \
     defined(CONFIG_M520x) || defined(CONFIG_M532x) || \
@@ -274,6 +275,11 @@ struct fec_enet_private {
 	struct fec_enet_delayed_work delay_work;
 };
 
+struct fec_platform_data {
+	phy_interface_t phy;
+	unsigned char mac[ETH_ALEN];
+};
+
 void fec_ptp_init(struct net_device *ndev, struct platform_device *pdev);
 void fec_ptp_start_cyclecounter(struct net_device *ndev);
 int fec_ptp_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd);
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index 706e224..148bcd2 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -48,7 +48,6 @@
 #include <linux/clk.h>
 #include <linux/platform_device.h>
 #include <linux/phy.h>
-#include <linux/fec.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
diff --git a/drivers/net/ethernet/freescale/fec_ptp.c b/drivers/net/ethernet/freescale/fec_ptp.c
index 25fc960..24ee926 100644
--- a/drivers/net/ethernet/freescale/fec_ptp.c
+++ b/drivers/net/ethernet/freescale/fec_ptp.c
@@ -41,7 +41,6 @@
 #include <linux/clk.h>
 #include <linux/platform_device.h>
 #include <linux/phy.h>
-#include <linux/fec.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
diff --git a/include/linux/fec.h b/include/linux/fec.h
deleted file mode 100644
index bcff455..0000000
--- a/include/linux/fec.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* include/linux/fec.h
- *
- * Copyright (c) 2009 Orex Computed Radiography
- *   Baruch Siach <baruch@tkos.co.il>
- *
- * Copyright (C) 2010 Freescale Semiconductor, Inc.
- *
- * Header file for the FEC platform data
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-#ifndef __LINUX_FEC_H__
-#define __LINUX_FEC_H__
-
-#include <linux/phy.h>
-
-struct fec_platform_data {
-	phy_interface_t phy;
-	unsigned char mac[ETH_ALEN];
-};
-
-#endif
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] fec: Remove <linux/fec.h> header file
  2013-05-21 15:44 ` [PATCH 2/2] fec: Remove <linux/fec.h> header file Fabio Estevam
@ 2013-05-21 16:02   ` Fabio Estevam
  2013-05-23  7:06     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2013-05-21 16:02 UTC (permalink / raw)
  To: davem; +Cc: Fabio Estevam, shawn.guo, netdev, kernel

On Tue, May 21, 2013 at 12:44 PM, Fabio Estevam
<fabio.estevam@freescale.com> wrote:
> There is no need to have a header file to hold a single structure.
>
> Move the 'fec_platform_data' structure definition into the local "fec.h" file
> and get rid of <linux/fec.h> header.

Please discard this one. It will cause issues on Coldfire.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] fec: Use DIV_ROUND_UP macro
  2013-05-21 15:44 [PATCH 1/2] fec: Use DIV_ROUND_UP macro Fabio Estevam
  2013-05-21 15:44 ` [PATCH 2/2] fec: Remove <linux/fec.h> header file Fabio Estevam
@ 2013-05-23  7:05 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2013-05-23  7:05 UTC (permalink / raw)
  To: fabio.estevam; +Cc: shawn.guo, netdev, kernel

From: Fabio Estevam <fabio.estevam@freescale.com>
Date: Tue, 21 May 2013 12:44:26 -0300

> Use the standard DIV_ROUND_UP macro in order to provide better readability.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Applied.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] fec: Remove <linux/fec.h> header file
  2013-05-21 16:02   ` Fabio Estevam
@ 2013-05-23  7:06     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-05-23  7:06 UTC (permalink / raw)
  To: festevam; +Cc: fabio.estevam, shawn.guo, netdev, kernel

From: Fabio Estevam <festevam@gmail.com>
Date: Tue, 21 May 2013 13:02:56 -0300

> On Tue, May 21, 2013 at 12:44 PM, Fabio Estevam
> <fabio.estevam@freescale.com> wrote:
>> There is no need to have a header file to hold a single structure.
>>
>> Move the 'fec_platform_data' structure definition into the local "fec.h" file
>> and get rid of <linux/fec.h> header.
> 
> Please discard this one. It will cause issues on Coldfire.

Ok.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-23  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21 15:44 [PATCH 1/2] fec: Use DIV_ROUND_UP macro Fabio Estevam
2013-05-21 15:44 ` [PATCH 2/2] fec: Remove <linux/fec.h> header file Fabio Estevam
2013-05-21 16:02   ` Fabio Estevam
2013-05-23  7:06     ` David Miller
2013-05-23  7:05 ` [PATCH 1/2] fec: Use DIV_ROUND_UP macro David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).