linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM
@ 2019-04-10 11:57 Naga Sureshkumar Relli
  2019-04-10 12:22 ` YueHaibing
  0 siblings, 1 reply; 6+ messages in thread
From: Naga Sureshkumar Relli @ 2019-04-10 11:57 UTC (permalink / raw)
  To: yuehaibing, vigneshr, broonie
  Cc: linux-kernel, linux-spi, michal.simek, nagasuresh12,
	Naga Sureshkumar Relli

From: YueHaibing <yuehaibing@huawei.com>

When building with CONFIG_SPI_MEM is not set
gc warns this:

drivers/spi/spi-zynq-qspi.o: In function `zynq_qspi_supports_op':
spi-zynq-qspi.c:(.text+0x1da): undefined reference to `spi_mem_default_supports_op'

Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
---
Changes in v3
 - Updated the Author name
 - Removed extra line between Fixes and rest of the tags
Changes in v2
 - Added static inline to the function spi_mem_default_supports_op();
---
 include/linux/spi/spi-mem.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index eb71e9d..bf399f2 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -295,6 +295,8 @@ int spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,
 void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
 					  const struct spi_mem_op *op,
 					  struct sg_table *sg);
+bool spi_mem_default_supports_op(struct spi_mem *mem,
+				 const struct spi_mem_op *op);
 #else
 static inline int
 spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,
@@ -310,6 +312,9 @@ spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
 				     struct sg_table *sg)
 {
 }
+
+static inline bool spi_mem_default_supports_op(struct spi_mem *mem,
+				 const struct spi_mem_op *op);
 #endif /* CONFIG_SPI_MEM */
 
 int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);
@@ -336,9 +341,6 @@ int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv,
 
 void spi_mem_driver_unregister(struct spi_mem_driver *drv);
 
-bool spi_mem_default_supports_op(struct spi_mem *mem,
-				 const struct spi_mem_op *op);
-
 #define spi_mem_driver_register(__drv)                                  \
 	spi_mem_driver_register_with_owner(__drv, THIS_MODULE)
 
-- 
2.7.4


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

* Re: [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM
  2019-04-10 11:57 [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM Naga Sureshkumar Relli
@ 2019-04-10 12:22 ` YueHaibing
  2019-04-10 12:24   ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: YueHaibing @ 2019-04-10 12:22 UTC (permalink / raw)
  To: Naga Sureshkumar Relli, vigneshr, broonie
  Cc: linux-kernel, linux-spi, michal.simek, nagasuresh12

On 2019/4/10 19:57, Naga Sureshkumar Relli wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> 
> When building with CONFIG_SPI_MEM is not set
> gc warns this:
> 
> drivers/spi/spi-zynq-qspi.o: In function `zynq_qspi_supports_op':
> spi-zynq-qspi.c:(.text+0x1da): undefined reference to `spi_mem_default_supports_op'
> 
> Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
> ---
> Changes in v3
>  - Updated the Author name
>  - Removed extra line between Fixes and rest of the tags
> Changes in v2
>  - Added static inline to the function spi_mem_default_supports_op();
> ---
>  include/linux/spi/spi-mem.h | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
> index eb71e9d..bf399f2 100644
> --- a/include/linux/spi/spi-mem.h
> +++ b/include/linux/spi/spi-mem.h
> @@ -295,6 +295,8 @@ int spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,
>  void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
>  					  const struct spi_mem_op *op,
>  					  struct sg_table *sg);
> +bool spi_mem_default_supports_op(struct spi_mem *mem,
> +				 const struct spi_mem_op *op);
>  #else
>  static inline int
>  spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,
> @@ -310,6 +312,9 @@ spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
>  				     struct sg_table *sg)
>  {
>  }
> +
> +static inline bool spi_mem_default_supports_op(struct spi_mem *mem,
> +				 const struct spi_mem_op *op);

Here miss a Function body, right?

+static inline bool
+spi_mem_default_supports_op(struct spi_mem *mem,
+			    const struct spi_mem_op *op)
+{
+	return false;
+}

>  #endif /* CONFIG_SPI_MEM */
>  
>  int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);
> @@ -336,9 +341,6 @@ int spi_mem_driver_register_with_owner(struct spi_mem_driver *drv,
>  
>  void spi_mem_driver_unregister(struct spi_mem_driver *drv);
>  
> -bool spi_mem_default_supports_op(struct spi_mem *mem,
> -				 const struct spi_mem_op *op);
> -
>  #define spi_mem_driver_register(__drv)                                  \
>  	spi_mem_driver_register_with_owner(__drv, THIS_MODULE)
>  
> 


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

* Re: [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM
  2019-04-10 12:22 ` YueHaibing
@ 2019-04-10 12:24   ` Mark Brown
  2019-04-10 12:30     ` Naga Sureshkumar Relli
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2019-04-10 12:24 UTC (permalink / raw)
  To: YueHaibing
  Cc: Naga Sureshkumar Relli, vigneshr, linux-kernel, linux-spi,
	michal.simek, nagasuresh12

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

On Wed, Apr 10, 2019 at 08:22:29PM +0800, YueHaibing wrote:
> On 2019/4/10 19:57, Naga Sureshkumar Relli wrote:

> > +static inline bool spi_mem_default_supports_op(struct spi_mem *mem,
> > +				 const struct spi_mem_op *op);

> Here miss a Function body, right?

Yeah, I'm surprised that builds...

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* RE: [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM
  2019-04-10 12:24   ` Mark Brown
@ 2019-04-10 12:30     ` Naga Sureshkumar Relli
  2019-04-10 12:35       ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Naga Sureshkumar Relli @ 2019-04-10 12:30 UTC (permalink / raw)
  To: Mark Brown, YueHaibing
  Cc: vigneshr, linux-kernel, linux-spi, Michal Simek, nagasuresh12

Hi,

> -----Original Message-----
> From: linux-spi-owner@vger.kernel.org <linux-spi-owner@vger.kernel.org> On Behalf Of
> Mark Brown
> Sent: Wednesday, April 10, 2019 5:55 PM
> To: YueHaibing <yuehaibing@huawei.com>
> Cc: Naga Sureshkumar Relli <nagasure@xilinx.com>; vigneshr@ti.com; linux-
> kernel@vger.kernel.org; linux-spi@vger.kernel.org; Michal Simek <michals@xilinx.com>;
> nagasuresh12@gmail.com
> Subject: Re: [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM
> 
> On Wed, Apr 10, 2019 at 08:22:29PM +0800, YueHaibing wrote:
> > On 2019/4/10 19:57, Naga Sureshkumar Relli wrote:
> 
> > > +static inline bool spi_mem_default_supports_op(struct spi_mem *mem,
> > > +				 const struct spi_mem_op *op);
> 
> > Here miss a Function body, right?
> 
> Yeah, I'm surprised that builds...
Sorry, I tested with CONFIG_SPI_MEM enabled. It's my bad.

Regards,
Naga Sureshkumar Relli

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

* Re: [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM
  2019-04-10 12:30     ` Naga Sureshkumar Relli
@ 2019-04-10 12:35       ` Mark Brown
  2019-04-10 13:10         ` YueHaibing
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Brown @ 2019-04-10 12:35 UTC (permalink / raw)
  To: Naga Sureshkumar Relli
  Cc: YueHaibing, vigneshr, linux-kernel, linux-spi, Michal Simek,
	nagasuresh12

[-- Attachment #1: Type: text/plain, Size: 453 bytes --]

On Wed, Apr 10, 2019 at 12:30:37PM +0000, Naga Sureshkumar Relli wrote:

> > Yeah, I'm surprised that builds...

> Sorry, I tested with CONFIG_SPI_MEM enabled. It's my bad.

I also see that I'd queued an earlier version for application.  I've
lost track of whatever issues there were with that, sorry - could one of
you please post an incremental patch for them?  IIRC they were nice to
haves and the patch that was applied fixes the correctness issue.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM
  2019-04-10 12:35       ` Mark Brown
@ 2019-04-10 13:10         ` YueHaibing
  0 siblings, 0 replies; 6+ messages in thread
From: YueHaibing @ 2019-04-10 13:10 UTC (permalink / raw)
  To: Mark Brown, Naga Sureshkumar Relli
  Cc: vigneshr, linux-kernel, linux-spi, Michal Simek, nagasuresh12

On 2019/4/10 20:35, Mark Brown wrote:
> On Wed, Apr 10, 2019 at 12:30:37PM +0000, Naga Sureshkumar Relli wrote:
> 
>>> Yeah, I'm surprised that builds...
> 
>> Sorry, I tested with CONFIG_SPI_MEM enabled. It's my bad.
> 
> I also see that I'd queued an earlier version for application.  I've
> lost track of whatever issues there were with that, sorry - could one of
> you please post an incremental patch for them?  IIRC they were nice to
> haves and the patch that was applied fixes the correctness issue.

Ok, there just make the stub helper to  static inline

I can post a new patch based my initial patch.

> 


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

end of thread, other threads:[~2019-04-10 13:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10 11:57 [LINUX PATCH v3] spi: spi-mem: Fix build error without CONFIG_SPI_MEM Naga Sureshkumar Relli
2019-04-10 12:22 ` YueHaibing
2019-04-10 12:24   ` Mark Brown
2019-04-10 12:30     ` Naga Sureshkumar Relli
2019-04-10 12:35       ` Mark Brown
2019-04-10 13:10         ` YueHaibing

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).