All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ufs-exynos: Move definitions from .h to .c
@ 2021-05-09 21:38 ` Bart Van Assche
  2021-05-16  2:12   ` Alim Akhtar
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Bart Van Assche @ 2021-05-09 21:38 UTC (permalink / raw)
  To: Martin K . Petersen, James E . J . Bottomley
  Cc: linux-scsi, Christoph Hellwig, Bart Van Assche, Alim Akhtar, Kiwoong Kim

In the Linux kernel definitions of data structures should occur in .c
files. Hence move the exynos7_uic_attr definition from a .h into a .c
file. Additionally, declare exynos_ufs_drvs static. This patch fixes the
following two sparse warnings:

drivers/scsi/ufs/ufs-exynos.h:248:28: warning: symbol 'exynos_ufs_drvs' was not declared. Should it be static?
drivers/scsi/ufs/ufs-exynos.h:250:28: warning: symbol 'exynos7_uic_attr' was not declared. Should it be static?

Cc: Alim Akhtar <alim.akhtar@samsung.com>
Cc: Kiwoong Kim <kwmad.kim@samsung.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/ufs/ufs-exynos.c | 27 ++++++++++++++++++++++++++-
 drivers/scsi/ufs/ufs-exynos.h | 26 --------------------------
 2 files changed, 26 insertions(+), 27 deletions(-)

diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index 70647eacf195..4c38689ecdd2 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -107,6 +107,7 @@ enum {
 
 #define CNTR_DIV_VAL 40
 
+static struct exynos_ufs_drv_data exynos_ufs_drvs;
 static void exynos_ufs_auto_ctrl_hcc(struct exynos_ufs *ufs, bool en);
 static void exynos_ufs_ctrl_clkstop(struct exynos_ufs *ufs, bool en);
 
@@ -1231,8 +1232,32 @@ static int exynos_ufs_remove(struct platform_device *pdev)
 	return 0;
 }
 
-struct exynos_ufs_drv_data exynos_ufs_drvs = {
+static struct exynos_ufs_uic_attr exynos7_uic_attr = {
+	.tx_trailingclks		= 0x10,
+	.tx_dif_p_nsec			= 3000000,	/* unit: ns */
+	.tx_dif_n_nsec			= 1000000,	/* unit: ns */
+	.tx_high_z_cnt_nsec		= 20000,	/* unit: ns */
+	.tx_base_unit_nsec		= 100000,	/* unit: ns */
+	.tx_gran_unit_nsec		= 4000,		/* unit: ns */
+	.tx_sleep_cnt			= 1000,		/* unit: ns */
+	.tx_min_activatetime		= 0xa,
+	.rx_filler_enable		= 0x2,
+	.rx_dif_p_nsec			= 1000000,	/* unit: ns */
+	.rx_hibern8_wait_nsec		= 4000000,	/* unit: ns */
+	.rx_base_unit_nsec		= 100000,	/* unit: ns */
+	.rx_gran_unit_nsec		= 4000,		/* unit: ns */
+	.rx_sleep_cnt			= 1280,		/* unit: ns */
+	.rx_stall_cnt			= 320,		/* unit: ns */
+	.rx_hs_g1_sync_len_cap		= SYNC_LEN_COARSE(0xf),
+	.rx_hs_g2_sync_len_cap		= SYNC_LEN_COARSE(0xf),
+	.rx_hs_g3_sync_len_cap		= SYNC_LEN_COARSE(0xf),
+	.rx_hs_g1_prep_sync_len_cap	= PREP_LEN(0xf),
+	.rx_hs_g2_prep_sync_len_cap	= PREP_LEN(0xf),
+	.rx_hs_g3_prep_sync_len_cap	= PREP_LEN(0xf),
+	.pa_dbg_option_suite		= 0x30103,
+};
 
+static struct exynos_ufs_drv_data exynos_ufs_drvs = {
 	.compatible		= "samsung,exynos7-ufs",
 	.uic_attr		= &exynos7_uic_attr,
 	.quirks			= UFSHCD_QUIRK_PRDT_BYTE_GRAN |
diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h
index 06ee565f7eb0..67505fe32ebf 100644
--- a/drivers/scsi/ufs/ufs-exynos.h
+++ b/drivers/scsi/ufs/ufs-exynos.h
@@ -245,30 +245,4 @@ static inline void exynos_ufs_disable_dbg_mode(struct ufs_hba *hba)
 	ufshcd_dme_set(hba, UIC_ARG_MIB(PA_DBG_MODE), FALSE);
 }
 
-struct exynos_ufs_drv_data exynos_ufs_drvs;
-
-struct exynos_ufs_uic_attr exynos7_uic_attr = {
-	.tx_trailingclks		= 0x10,
-	.tx_dif_p_nsec			= 3000000,	/* unit: ns */
-	.tx_dif_n_nsec			= 1000000,	/* unit: ns */
-	.tx_high_z_cnt_nsec		= 20000,	/* unit: ns */
-	.tx_base_unit_nsec		= 100000,	/* unit: ns */
-	.tx_gran_unit_nsec		= 4000,		/* unit: ns */
-	.tx_sleep_cnt			= 1000,		/* unit: ns */
-	.tx_min_activatetime		= 0xa,
-	.rx_filler_enable		= 0x2,
-	.rx_dif_p_nsec			= 1000000,	/* unit: ns */
-	.rx_hibern8_wait_nsec		= 4000000,	/* unit: ns */
-	.rx_base_unit_nsec		= 100000,	/* unit: ns */
-	.rx_gran_unit_nsec		= 4000,		/* unit: ns */
-	.rx_sleep_cnt			= 1280,		/* unit: ns */
-	.rx_stall_cnt			= 320,		/* unit: ns */
-	.rx_hs_g1_sync_len_cap		= SYNC_LEN_COARSE(0xf),
-	.rx_hs_g2_sync_len_cap		= SYNC_LEN_COARSE(0xf),
-	.rx_hs_g3_sync_len_cap		= SYNC_LEN_COARSE(0xf),
-	.rx_hs_g1_prep_sync_len_cap	= PREP_LEN(0xf),
-	.rx_hs_g2_prep_sync_len_cap	= PREP_LEN(0xf),
-	.rx_hs_g3_prep_sync_len_cap	= PREP_LEN(0xf),
-	.pa_dbg_option_suite		= 0x30103,
-};
 #endif /* _UFS_EXYNOS_H_ */

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

* RE: [PATCH] ufs-exynos: Move definitions from .h to .c
  2021-05-09 21:38 ` [PATCH] ufs-exynos: Move definitions from .h to .c Bart Van Assche
@ 2021-05-16  2:12   ` Alim Akhtar
  2021-05-16 18:10     ` Bart Van Assche
  2021-05-21 20:07   ` Martin K. Petersen
  2021-05-26  4:07   ` Martin K. Petersen
  2 siblings, 1 reply; 6+ messages in thread
From: Alim Akhtar @ 2021-05-16  2:12 UTC (permalink / raw)
  To: 'Bart Van Assche', 'Martin K . Petersen',
	'James E . J . Bottomley'
  Cc: linux-scsi, 'Christoph Hellwig', 'Kiwoong Kim'

Hi Bart,

> -----Original Message-----
> From: Bart Van Assche <bvanassche@acm.org>
> Sent: 10 May 2021 03:08
> To: Martin K . Petersen <martin.petersen@oracle.com>; James E . J .
> Bottomley <jejb@linux.vnet.ibm.com>
> Cc: linux-scsi@vger.kernel.org; Christoph Hellwig <hch@lst.de>; Bart Van
> Assche <bvanassche@acm.org>; Alim Akhtar <alim.akhtar@samsung.com>;
> Kiwoong Kim <kwmad.kim@samsung.com>
> Subject: [PATCH] ufs-exynos: Move definitions from .h to .c
> 
> In the Linux kernel definitions of data structures should occur in .c
files.
> Hence move the exynos7_uic_attr definition from a .h into a .c file.
> Additionally, declare exynos_ufs_drvs static. This patch fixes the
following
> two sparse warnings:
> 
> drivers/scsi/ufs/ufs-exynos.h:248:28: warning: symbol 'exynos_ufs_drvs'
> was not declared. Should it be static?
> drivers/scsi/ufs/ufs-exynos.h:250:28: warning: symbol 'exynos7_uic_attr'
> was not declared. Should it be static?
> 
> Cc: Alim Akhtar <alim.akhtar@samsung.com>
> Cc: Kiwoong Kim <kwmad.kim@samsung.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
Just for the subject tag consistency, can add subsystem name , scsi: ufs:
<driver_name> 
Rest looks good.
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>

>  drivers/scsi/ufs/ufs-exynos.c | 27 ++++++++++++++++++++++++++-
> drivers/scsi/ufs/ufs-exynos.h | 26 --------------------------
>  2 files changed, 26 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
> index 70647eacf195..4c38689ecdd2 100644
> --- a/drivers/scsi/ufs/ufs-exynos.c
> +++ b/drivers/scsi/ufs/ufs-exynos.c
> @@ -107,6 +107,7 @@ enum {
> 
>  #define CNTR_DIV_VAL 40
> 
> +static struct exynos_ufs_drv_data exynos_ufs_drvs;
>  static void exynos_ufs_auto_ctrl_hcc(struct exynos_ufs *ufs, bool en);
> static void exynos_ufs_ctrl_clkstop(struct exynos_ufs *ufs, bool en);
> 
> @@ -1231,8 +1232,32 @@ static int exynos_ufs_remove(struct
> platform_device *pdev)
>  	return 0;
>  }
> 
> -struct exynos_ufs_drv_data exynos_ufs_drvs = {
> +static struct exynos_ufs_uic_attr exynos7_uic_attr = {
> +	.tx_trailingclks		= 0x10,
> +	.tx_dif_p_nsec			= 3000000,	/* unit: ns */
> +	.tx_dif_n_nsec			= 1000000,	/* unit: ns */
> +	.tx_high_z_cnt_nsec		= 20000,	/* unit: ns */
> +	.tx_base_unit_nsec		= 100000,	/* unit: ns */
> +	.tx_gran_unit_nsec		= 4000,		/* unit: ns */
> +	.tx_sleep_cnt			= 1000,		/* unit: ns */
> +	.tx_min_activatetime		= 0xa,
> +	.rx_filler_enable		= 0x2,
> +	.rx_dif_p_nsec			= 1000000,	/* unit: ns */
> +	.rx_hibern8_wait_nsec		= 4000000,	/* unit: ns */
> +	.rx_base_unit_nsec		= 100000,	/* unit: ns */
> +	.rx_gran_unit_nsec		= 4000,		/* unit: ns */
> +	.rx_sleep_cnt			= 1280,		/* unit: ns */
> +	.rx_stall_cnt			= 320,		/* unit: ns */
> +	.rx_hs_g1_sync_len_cap		= SYNC_LEN_COARSE(0xf),
> +	.rx_hs_g2_sync_len_cap		= SYNC_LEN_COARSE(0xf),
> +	.rx_hs_g3_sync_len_cap		= SYNC_LEN_COARSE(0xf),
> +	.rx_hs_g1_prep_sync_len_cap	= PREP_LEN(0xf),
> +	.rx_hs_g2_prep_sync_len_cap	= PREP_LEN(0xf),
> +	.rx_hs_g3_prep_sync_len_cap	= PREP_LEN(0xf),
> +	.pa_dbg_option_suite		= 0x30103,
> +};
> 
> +static struct exynos_ufs_drv_data exynos_ufs_drvs = {
>  	.compatible		= "samsung,exynos7-ufs",
>  	.uic_attr		= &exynos7_uic_attr,
>  	.quirks			= UFSHCD_QUIRK_PRDT_BYTE_GRAN |
> diff --git a/drivers/scsi/ufs/ufs-exynos.h b/drivers/scsi/ufs/ufs-exynos.h
> index 06ee565f7eb0..67505fe32ebf 100644
> --- a/drivers/scsi/ufs/ufs-exynos.h
> +++ b/drivers/scsi/ufs/ufs-exynos.h
> @@ -245,30 +245,4 @@ static inline void
> exynos_ufs_disable_dbg_mode(struct ufs_hba *hba)
>  	ufshcd_dme_set(hba, UIC_ARG_MIB(PA_DBG_MODE), FALSE);  }
> 
> -struct exynos_ufs_drv_data exynos_ufs_drvs;
> -
> -struct exynos_ufs_uic_attr exynos7_uic_attr = {
> -	.tx_trailingclks		= 0x10,
> -	.tx_dif_p_nsec			= 3000000,	/* unit: ns */
> -	.tx_dif_n_nsec			= 1000000,	/* unit: ns */
> -	.tx_high_z_cnt_nsec		= 20000,	/* unit: ns */
> -	.tx_base_unit_nsec		= 100000,	/* unit: ns */
> -	.tx_gran_unit_nsec		= 4000,		/* unit: ns */
> -	.tx_sleep_cnt			= 1000,		/* unit: ns */
> -	.tx_min_activatetime		= 0xa,
> -	.rx_filler_enable		= 0x2,
> -	.rx_dif_p_nsec			= 1000000,	/* unit: ns */
> -	.rx_hibern8_wait_nsec		= 4000000,	/* unit: ns */
> -	.rx_base_unit_nsec		= 100000,	/* unit: ns */
> -	.rx_gran_unit_nsec		= 4000,		/* unit: ns */
> -	.rx_sleep_cnt			= 1280,		/* unit: ns */
> -	.rx_stall_cnt			= 320,		/* unit: ns */
> -	.rx_hs_g1_sync_len_cap		= SYNC_LEN_COARSE(0xf),
> -	.rx_hs_g2_sync_len_cap		= SYNC_LEN_COARSE(0xf),
> -	.rx_hs_g3_sync_len_cap		= SYNC_LEN_COARSE(0xf),
> -	.rx_hs_g1_prep_sync_len_cap	= PREP_LEN(0xf),
> -	.rx_hs_g2_prep_sync_len_cap	= PREP_LEN(0xf),
> -	.rx_hs_g3_prep_sync_len_cap	= PREP_LEN(0xf),
> -	.pa_dbg_option_suite		= 0x30103,
> -};
>  #endif /* _UFS_EXYNOS_H_ */


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

* Re: [PATCH] ufs-exynos: Move definitions from .h to .c
  2021-05-16  2:12   ` Alim Akhtar
@ 2021-05-16 18:10     ` Bart Van Assche
  2021-05-16 18:14       ` Martin K. Petersen
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Van Assche @ 2021-05-16 18:10 UTC (permalink / raw)
  To: Alim Akhtar, 'Martin K . Petersen',
	'James E . J . Bottomley'
  Cc: linux-scsi, 'Christoph Hellwig', 'Kiwoong Kim'

On 5/15/21 7:12 PM, Alim Akhtar wrote:
> Just for the subject tag consistency, can add subsystem name , scsi: ufs:
> <driver_name> 
> Rest looks good.
> Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>

Martin Petersen, the SCSI maintainer will add the "scsi: " prefix to the
subject before applying this patch. So you want me to change the subject
prefix from "ufs-exynos: " into "ufs: ufs-exynos: "?

Anyway, thanks for the review.

Bart.

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

* Re: [PATCH] ufs-exynos: Move definitions from .h to .c
  2021-05-16 18:10     ` Bart Van Assche
@ 2021-05-16 18:14       ` Martin K. Petersen
  0 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2021-05-16 18:14 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Alim Akhtar, 'Martin K . Petersen',
	'James E . J . Bottomley',
	linux-scsi, 'Christoph Hellwig', 'Kiwoong Kim'


Bart,

> Martin Petersen, the SCSI maintainer will add the "scsi: " prefix to the
> subject before applying this patch. So you want me to change the subject
> prefix from "ufs-exynos: " into "ufs: ufs-exynos: "?

Don't worry about it, I'll fix that up.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] ufs-exynos: Move definitions from .h to .c
  2021-05-09 21:38 ` [PATCH] ufs-exynos: Move definitions from .h to .c Bart Van Assche
  2021-05-16  2:12   ` Alim Akhtar
@ 2021-05-21 20:07   ` Martin K. Petersen
  2021-05-26  4:07   ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2021-05-21 20:07 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, James E . J . Bottomley, linux-scsi,
	Christoph Hellwig, Alim Akhtar, Kiwoong Kim


Bart,

> In the Linux kernel definitions of data structures should occur in .c
> files. Hence move the exynos7_uic_attr definition from a .h into a .c
> file. Additionally, declare exynos_ufs_drvs static. This patch fixes
> the following two sparse warnings:

Applied to 5.14/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] ufs-exynos: Move definitions from .h to .c
  2021-05-09 21:38 ` [PATCH] ufs-exynos: Move definitions from .h to .c Bart Van Assche
  2021-05-16  2:12   ` Alim Akhtar
  2021-05-21 20:07   ` Martin K. Petersen
@ 2021-05-26  4:07   ` Martin K. Petersen
  2 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2021-05-26  4:07 UTC (permalink / raw)
  To: James E . J . Bottomley, Bart Van Assche
  Cc: Martin K . Petersen, Christoph Hellwig, Kiwoong Kim, Alim Akhtar,
	linux-scsi

On Sun, 9 May 2021 14:38:17 -0700, Bart Van Assche wrote:

> In the Linux kernel definitions of data structures should occur in .c
> files. Hence move the exynos7_uic_attr definition from a .h into a .c
> file. Additionally, declare exynos_ufs_drvs static. This patch fixes the
> following two sparse warnings:
> 
> drivers/scsi/ufs/ufs-exynos.h:248:28: warning: symbol 'exynos_ufs_drvs' was not declared. Should it be static?
> drivers/scsi/ufs/ufs-exynos.h:250:28: warning: symbol 'exynos7_uic_attr' was not declared. Should it be static?

Applied to 5.14/scsi-queue, thanks!

[1/1] ufs-exynos: Move definitions from .h to .c
      https://git.kernel.org/mkp/scsi/c/b592d66235f5

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-05-26  4:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210509213827epcas5p173b48dab49036c8d85eadfc8bda9efd8@epcas5p1.samsung.com>
2021-05-09 21:38 ` [PATCH] ufs-exynos: Move definitions from .h to .c Bart Van Assche
2021-05-16  2:12   ` Alim Akhtar
2021-05-16 18:10     ` Bart Van Assche
2021-05-16 18:14       ` Martin K. Petersen
2021-05-21 20:07   ` Martin K. Petersen
2021-05-26  4:07   ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.