All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX()
@ 2020-07-23  8:20 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-07-23  8:20 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Krzysztof Kozlowski,
	Kuninori Morimoto, Andrew Morton, linux-sh, linux-kernel
  Cc: Geert Uytterhoeven

The ioreadX() helpers accept now pointer to const memory so declaration
of read function needs updating.

This fixes build errors like:

    drivers/sh/clk/cpg.c: In function ‘sh_clk_mstp_enable’:
    drivers/sh/clk/cpg.c:49:9: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
        read = ioread8;

Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

Dear Andrew,

This was part of my v3 patchset commit 9ab7fb303cc1 ("iomap: Constify
ioreadX() iomem argument (as in generic implementation)") but I think it
was skipped when applying to your tree.

Maybe because it depends on commit 58c4d8659186 ("sh: clkfwk: remove
r8/r16/r32") which landed later?  Anyway it should go through your tree,
I think.
---
 drivers/sh/clk/cpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
index a5cacfe24a42..fd72d9088bdc 100644
--- a/drivers/sh/clk/cpg.c
+++ b/drivers/sh/clk/cpg.c
@@ -40,7 +40,7 @@ static int sh_clk_mstp_enable(struct clk *clk)
 {
 	sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
 	if (clk->status_reg) {
-		unsigned int (*read)(void __iomem *addr);
+		unsigned int (*read)(const void __iomem *addr);
 		int i;
 		void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
 			(phys_addr_t)clk->enable_reg + clk->mapped_reg;
-- 
2.17.1

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

* [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX()
@ 2020-07-23  8:20 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-07-23  8:20 UTC (permalink / raw)
  To: Yoshinori Sato, Rich Felker, Krzysztof Kozlowski,
	Kuninori Morimoto, Andrew Morton, linux-sh, linux-kernel
  Cc: Geert Uytterhoeven

The ioreadX() helpers accept now pointer to const memory so declaration
of read function needs updating.

This fixes build errors like:

    drivers/sh/clk/cpg.c: In function ‘sh_clk_mstp_enable’:
    drivers/sh/clk/cpg.c:49:9: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
        read = ioread8;

Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>

---

Dear Andrew,

This was part of my v3 patchset commit 9ab7fb303cc1 ("iomap: Constify
ioreadX() iomem argument (as in generic implementation)") but I think it
was skipped when applying to your tree.

Maybe because it depends on commit 58c4d8659186 ("sh: clkfwk: remove
r8/r16/r32") which landed later?  Anyway it should go through your tree,
I think.
---
 drivers/sh/clk/cpg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
index a5cacfe24a42..fd72d9088bdc 100644
--- a/drivers/sh/clk/cpg.c
+++ b/drivers/sh/clk/cpg.c
@@ -40,7 +40,7 @@ static int sh_clk_mstp_enable(struct clk *clk)
 {
 	sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
 	if (clk->status_reg) {
-		unsigned int (*read)(void __iomem *addr);
+		unsigned int (*read)(const void __iomem *addr);
 		int i;
 		void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
 			(phys_addr_t)clk->enable_reg + clk->mapped_reg;
-- 
2.17.1


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

* Re: [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX()
  2020-07-23  8:20 ` Krzysztof Kozlowski
@ 2020-07-23 12:49   ` John Paul Adrian Glaubitz
  -1 siblings, 0 replies; 8+ messages in thread
From: John Paul Adrian Glaubitz @ 2020-07-23 12:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Yoshinori Sato, Rich Felker,
	Kuninori Morimoto, Andrew Morton, linux-sh, linux-kernel
  Cc: Geert Uytterhoeven

Hi Krzysztof!

On 7/23/20 10:20 AM, Krzysztof Kozlowski wrote:
> Maybe because it depends on commit 58c4d8659186 ("sh: clkfwk: remove
> r8/r16/r32") which landed later?  Anyway it should go through your tree,
> I think.
> ---
>  drivers/sh/clk/cpg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
> index a5cacfe24a42..fd72d9088bdc 100644
> --- a/drivers/sh/clk/cpg.c
> +++ b/drivers/sh/clk/cpg.c
> @@ -40,7 +40,7 @@ static int sh_clk_mstp_enable(struct clk *clk)
>  {
>  	sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
>  	if (clk->status_reg) {
> -		unsigned int (*read)(void __iomem *addr);
> +		unsigned int (*read)(const void __iomem *addr);
>  		int i;
>  		void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
>  			(phys_addr_t)clk->enable_reg + clk->mapped_reg;

Is that a reverted patch, by any chance? The patch does not apply for me and looking at
the sources, the qualifier is already "const" [1].

Adrian

> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/sh/clk/cpg.c#n58

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

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

* Re: [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX()
@ 2020-07-23 12:49   ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 8+ messages in thread
From: John Paul Adrian Glaubitz @ 2020-07-23 12:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Yoshinori Sato, Rich Felker,
	Kuninori Morimoto, Andrew Morton, linux-sh, linux-kernel
  Cc: Geert Uytterhoeven

Hi Krzysztof!

On 7/23/20 10:20 AM, Krzysztof Kozlowski wrote:
> Maybe because it depends on commit 58c4d8659186 ("sh: clkfwk: remove
> r8/r16/r32") which landed later?  Anyway it should go through your tree,
> I think.
> ---
>  drivers/sh/clk/cpg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
> index a5cacfe24a42..fd72d9088bdc 100644
> --- a/drivers/sh/clk/cpg.c
> +++ b/drivers/sh/clk/cpg.c
> @@ -40,7 +40,7 @@ static int sh_clk_mstp_enable(struct clk *clk)
>  {
>  	sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
>  	if (clk->status_reg) {
> -		unsigned int (*read)(void __iomem *addr);
> +		unsigned int (*read)(const void __iomem *addr);
>  		int i;
>  		void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
>  			(phys_addr_t)clk->enable_reg + clk->mapped_reg;

Is that a reverted patch, by any chance? The patch does not apply for me and looking at
the sources, the qualifier is already "const" [1].

Adrian

> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/sh/clk/cpg.c#n58

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

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

* Re: [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX()
  2020-07-23 12:49   ` John Paul Adrian Glaubitz
@ 2020-07-23 12:57     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-07-23 12:57 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: Yoshinori Sato, Rich Felker, Kuninori Morimoto, Andrew Morton,
	linux-sh, linux-kernel, Geert Uytterhoeven

On Thu, Jul 23, 2020 at 02:49:46PM +0200, John Paul Adrian Glaubitz wrote:
> Hi Krzysztof!
> 
> On 7/23/20 10:20 AM, Krzysztof Kozlowski wrote:
> > Maybe because it depends on commit 58c4d8659186 ("sh: clkfwk: remove
> > r8/r16/r32") which landed later?  Anyway it should go through your tree,
> > I think.
> > ---
> >  drivers/sh/clk/cpg.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
> > index a5cacfe24a42..fd72d9088bdc 100644
> > --- a/drivers/sh/clk/cpg.c
> > +++ b/drivers/sh/clk/cpg.c
> > @@ -40,7 +40,7 @@ static int sh_clk_mstp_enable(struct clk *clk)
> >  {
> >  	sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
> >  	if (clk->status_reg) {
> > -		unsigned int (*read)(void __iomem *addr);
> > +		unsigned int (*read)(const void __iomem *addr);
> >  		int i;
> >  		void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
> >  			(phys_addr_t)clk->enable_reg + clk->mapped_reg;
> 
> Is that a reverted patch, by any chance? The patch does not apply for me and looking at
> the sources, the qualifier is already "const" [1].

The patch is for Andrew Morton's tree which contain two commits:
1. sh: clkfwk: remove r8/r16/r32
2. iomap: constify ioreadX() iomem argument (as in generic implementation)

This patch here was actually part of #2 because of being based on
linux-next. However it disappeared when applying to Andrew's tree
because patch #1 came later.

Best regards,
Krzysztof

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

* Re: [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX()
@ 2020-07-23 12:57     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-07-23 12:57 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: Yoshinori Sato, Rich Felker, Kuninori Morimoto, Andrew Morton,
	linux-sh, linux-kernel, Geert Uytterhoeven

On Thu, Jul 23, 2020 at 02:49:46PM +0200, John Paul Adrian Glaubitz wrote:
> Hi Krzysztof!
> 
> On 7/23/20 10:20 AM, Krzysztof Kozlowski wrote:
> > Maybe because it depends on commit 58c4d8659186 ("sh: clkfwk: remove
> > r8/r16/r32") which landed later?  Anyway it should go through your tree,
> > I think.
> > ---
> >  drivers/sh/clk/cpg.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/sh/clk/cpg.c b/drivers/sh/clk/cpg.c
> > index a5cacfe24a42..fd72d9088bdc 100644
> > --- a/drivers/sh/clk/cpg.c
> > +++ b/drivers/sh/clk/cpg.c
> > @@ -40,7 +40,7 @@ static int sh_clk_mstp_enable(struct clk *clk)
> >  {
> >  	sh_clk_write(sh_clk_read(clk) & ~(1 << clk->enable_bit), clk);
> >  	if (clk->status_reg) {
> > -		unsigned int (*read)(void __iomem *addr);
> > +		unsigned int (*read)(const void __iomem *addr);
> >  		int i;
> >  		void __iomem *mapped_status = (phys_addr_t)clk->status_reg -
> >  			(phys_addr_t)clk->enable_reg + clk->mapped_reg;
> 
> Is that a reverted patch, by any chance? The patch does not apply for me and looking at
> the sources, the qualifier is already "const" [1].

The patch is for Andrew Morton's tree which contain two commits:
1. sh: clkfwk: remove r8/r16/r32
2. iomap: constify ioreadX() iomem argument (as in generic implementation)

This patch here was actually part of #2 because of being based on
linux-next. However it disappeared when applying to Andrew's tree
because patch #1 came later.

Best regards,
Krzysztof


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

* Re: [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX()
  2020-07-23 12:57     ` Krzysztof Kozlowski
@ 2020-07-23 13:14       ` John Paul Adrian Glaubitz
  -1 siblings, 0 replies; 8+ messages in thread
From: John Paul Adrian Glaubitz @ 2020-07-23 13:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Yoshinori Sato, Rich Felker, Kuninori Morimoto, Andrew Morton,
	linux-sh, linux-kernel, Geert Uytterhoeven

Hi!

On 7/23/20 2:57 PM, Krzysztof Kozlowski wrote:
> The patch is for Andrew Morton's tree which contain two commits:
> 1. sh: clkfwk: remove r8/r16/r32
> 2. iomap: constify ioreadX() iomem argument (as in generic implementation)
> 
> This patch here was actually part of #2 because of being based on
> linux-next. However it disappeared when applying to Andrew's tree
> because patch #1 came later.

Okay. I'll try to look at the other two patches later.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

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

* Re: [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX()
@ 2020-07-23 13:14       ` John Paul Adrian Glaubitz
  0 siblings, 0 replies; 8+ messages in thread
From: John Paul Adrian Glaubitz @ 2020-07-23 13:14 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Yoshinori Sato, Rich Felker, Kuninori Morimoto, Andrew Morton,
	linux-sh, linux-kernel, Geert Uytterhoeven

Hi!

On 7/23/20 2:57 PM, Krzysztof Kozlowski wrote:
> The patch is for Andrew Morton's tree which contain two commits:
> 1. sh: clkfwk: remove r8/r16/r32
> 2. iomap: constify ioreadX() iomem argument (as in generic implementation)
> 
> This patch here was actually part of #2 because of being based on
> linux-next. However it disappeared when applying to Andrew's tree
> because patch #1 came later.

Okay. I'll try to look at the other two patches later.

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

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

end of thread, other threads:[~2020-07-23 13:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23  8:20 [PATCH] sh: clk: Fix assignment from incompatible pointer type for ioreadX() Krzysztof Kozlowski
2020-07-23  8:20 ` Krzysztof Kozlowski
2020-07-23 12:49 ` John Paul Adrian Glaubitz
2020-07-23 12:49   ` John Paul Adrian Glaubitz
2020-07-23 12:57   ` Krzysztof Kozlowski
2020-07-23 12:57     ` Krzysztof Kozlowski
2020-07-23 13:14     ` John Paul Adrian Glaubitz
2020-07-23 13:14       ` John Paul Adrian Glaubitz

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.