diff mbox

[U-Boot,v5,05/21] sf: Cleanup sf_params

Message ID 1477849590-11954-6-git-send-email-jagan@openedev.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show

Commit Message

Jagan Teki Oct. 30, 2016, 5:46 p.m. UTC
- Move headers froms sf_params to common header file
- Removed unnecessary comment

Cc: Simon Glass <sjg@chromium.org>
Cc: Bin Meng <bmeng.cn@gmail.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Vignesh R <vigneshr@ti.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Jagan Teki <jagan@openedev.com>
---
 drivers/mtd/spi/sf_internal.h | 5 +++--
 drivers/mtd/spi/sf_params.c   | 5 -----
 2 files changed, 3 insertions(+), 7 deletions(-)

Comments

Simon Glass Nov. 5, 2016, 4:07 p.m. UTC | #1
Hi Jagan,

On 30 October 2016 at 11:46, Jagan Teki <jagan@openedev.com> wrote:
> - Move headers froms sf_params to common header file
> - Removed unnecessary comment
>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Bin Meng <bmeng.cn@gmail.com>
> Cc: York Sun <york.sun@nxp.com>
> Cc: Vignesh R <vigneshr@ti.com>
> Cc: Mugunthan V N <mugunthanvnm@ti.com>
> Cc: Michal Simek <michal.simek@xilinx.com>
> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
> Signed-off-by: Jagan Teki <jagan@openedev.com>
> ---
>  drivers/mtd/spi/sf_internal.h | 5 +++--
>  drivers/mtd/spi/sf_params.c   | 5 -----
>  2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
> index 71feba9..4a88cf7 100644
> --- a/drivers/mtd/spi/sf_internal.h
> +++ b/drivers/mtd/spi/sf_internal.h
> @@ -10,8 +10,9 @@
>  #ifndef _SF_INTERNAL_H_
>  #define _SF_INTERNAL_H_
>
> -#include <linux/types.h>
> -#include <linux/compiler.h>
> +#include <common.h>
> +#include <spi.h>
> +#include <spi_flash.h>

No, these headers should remain in the C file that needs them.
Transitive include should be minimised.

>
>  /* Dual SPI flash memories - see SPI_COMM_DUAL_... */
>  enum spi_dual_flash {
> diff --git a/drivers/mtd/spi/sf_params.c b/drivers/mtd/spi/sf_params.c
> index 7fcc3bc..7314455 100644
> --- a/drivers/mtd/spi/sf_params.c
> +++ b/drivers/mtd/spi/sf_params.c
> @@ -6,10 +6,6 @@
>   * SPDX-License-Identifier:    GPL-2.0+
>   */
>
> -#include <common.h>
> -#include <spi.h>
> -#include <spi_flash.h>
> -
>  #include "sf_internal.h"
>
>  /* Used when the "_ext_id" is two bytes at most */
> @@ -27,7 +23,6 @@
>                 .page_size = 256,                                       \
>                 .flags = (_flags),
>
> -/* SPI/QSPI flash device params structure */
>  const struct spi_flash_info spi_flash_ids[] = {
>  #ifdef CONFIG_SPI_FLASH_ATMEL          /* ATMEL */
>         {"AT45DB011D",     INFO(0x1f2200, 0x0, 64 * 1024,     4, SECT_4K) },
> --
> 2.7.4
>

Regards,
Simon
Jagan Teki Nov. 15, 2016, 7:54 a.m. UTC | #2
On Sat, Nov 5, 2016 at 9:37 PM, Simon Glass <sjg@chromium.org> wrote:
> Hi Jagan,
>
> On 30 October 2016 at 11:46, Jagan Teki <jagan@openedev.com> wrote:
>> - Move headers froms sf_params to common header file
>> - Removed unnecessary comment
>>
>> Cc: Simon Glass <sjg@chromium.org>
>> Cc: Bin Meng <bmeng.cn@gmail.com>
>> Cc: York Sun <york.sun@nxp.com>
>> Cc: Vignesh R <vigneshr@ti.com>
>> Cc: Mugunthan V N <mugunthanvnm@ti.com>
>> Cc: Michal Simek <michal.simek@xilinx.com>
>> Cc: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
>> Signed-off-by: Jagan Teki <jagan@openedev.com>
>> ---
>>  drivers/mtd/spi/sf_internal.h | 5 +++--
>>  drivers/mtd/spi/sf_params.c   | 5 -----
>>  2 files changed, 3 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
>> index 71feba9..4a88cf7 100644
>> --- a/drivers/mtd/spi/sf_internal.h
>> +++ b/drivers/mtd/spi/sf_internal.h
>> @@ -10,8 +10,9 @@
>>  #ifndef _SF_INTERNAL_H_
>>  #define _SF_INTERNAL_H_
>>
>> -#include <linux/types.h>
>> -#include <linux/compiler.h>
>> +#include <common.h>
>> +#include <spi.h>
>> +#include <spi_flash.h>
>
> No, these headers should remain in the C file that needs them.
> Transitive include should be minimised.

OK, will skip this patch.

thanks!
diff mbox

Patch

diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
index 71feba9..4a88cf7 100644
--- a/drivers/mtd/spi/sf_internal.h
+++ b/drivers/mtd/spi/sf_internal.h
@@ -10,8 +10,9 @@ 
 #ifndef _SF_INTERNAL_H_
 #define _SF_INTERNAL_H_
 
-#include <linux/types.h>
-#include <linux/compiler.h>
+#include <common.h>
+#include <spi.h>
+#include <spi_flash.h>
 
 /* Dual SPI flash memories - see SPI_COMM_DUAL_... */
 enum spi_dual_flash {
diff --git a/drivers/mtd/spi/sf_params.c b/drivers/mtd/spi/sf_params.c
index 7fcc3bc..7314455 100644
--- a/drivers/mtd/spi/sf_params.c
+++ b/drivers/mtd/spi/sf_params.c
@@ -6,10 +6,6 @@ 
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
-#include <common.h>
-#include <spi.h>
-#include <spi_flash.h>
-
 #include "sf_internal.h"
 
 /* Used when the "_ext_id" is two bytes at most */
@@ -27,7 +23,6 @@ 
 		.page_size = 256,					\
 		.flags = (_flags),
 
-/* SPI/QSPI flash device params structure */
 const struct spi_flash_info spi_flash_ids[] = {
 #ifdef CONFIG_SPI_FLASH_ATMEL		/* ATMEL */
 	{"AT45DB011D",	   INFO(0x1f2200, 0x0, 64 * 1024,     4, SECT_4K) },