linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: tools: Make default_tx/rx and input_tx static
@ 2020-06-11  3:42 Qing Zhang
  2020-06-11  3:42 ` [PATCH 2/2] spi: tools: Fix build errors Qing Zhang
  2020-06-11 15:29 ` [PATCH 1/2] spi: tools: Make default_tx/rx and input_tx static Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Qing Zhang @ 2020-06-11  3:42 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel, Tiezhu Yang, Xuefeng Li

Fix the following sparse warning:

./spidev_test.c:50:9: warning: symbol 'default_tx' was not declared. Should it be static?
./spidev_test.c:59:9: warning: symbol 'default_rx' was not declared. Should it be static?
./spidev_test.c:60:6: warning: symbol 'input_tx' was not declared. Should it be static?

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
---
 tools/spi/spidev_test.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/spi/spidev_test.c b/tools/spi/spidev_test.c
index 56ea053f..83844f8 100644
--- a/tools/spi/spidev_test.c
+++ b/tools/spi/spidev_test.c
@@ -47,7 +47,7 @@ static int transfer_size;
 static int iterations;
 static int interval = 5; /* interval in seconds for showing transfer rate */
 
-uint8_t default_tx[] = {
+static uint8_t default_tx[] = {
 	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
 	0x40, 0x00, 0x00, 0x00, 0x00, 0x95,
 	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
@@ -56,8 +56,8 @@ uint8_t default_tx[] = {
 	0xF0, 0x0D,
 };
 
-uint8_t default_rx[ARRAY_SIZE(default_tx)] = {0, };
-char *input_tx;
+static uint8_t default_rx[ARRAY_SIZE(default_tx)] = {0, };
+static char *input_tx;
 
 static void hex_dump(const void *src, size_t length, size_t line_size,
 		     char *prefix)
-- 
2.1.0


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

* [PATCH 2/2] spi: tools: Fix build errors
  2020-06-11  3:42 [PATCH 1/2] spi: tools: Make default_tx/rx and input_tx static Qing Zhang
@ 2020-06-11  3:42 ` Qing Zhang
  2020-06-11  8:02   ` Geert Uytterhoeven
  2020-06-11 15:29 ` [PATCH 1/2] spi: tools: Make default_tx/rx and input_tx static Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Qing Zhang @ 2020-06-11  3:42 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel, Tiezhu Yang, Xuefeng Li

Fix the following build errors:

include/linux/spi 2>&1 || true
ln -sf /home/zhangqing/spi.git2/tools/spi/../../include/uapi/linux/spi/spidev.h include/linux/spi/spidev.h
make -f /home/zhangqing/spi.git2/tools/build/Makefile.build dir=. obj=spidev_test
make[1]: Entering directory '/home/zhangqing/spi.git2/tools/spi'
  CC       spidev_test.o
spidev_test.c: In function ‘transfer’:
spidev_test.c:131:13: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function)
  if (mode & SPI_TX_OCTAL)
             ^
spidev_test.c:131:13: note: each undeclared identifier is reported only once for each function it appears in
spidev_test.c:137:13: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function)
  if (mode & SPI_RX_OCTAL)
             ^
spidev_test.c: In function ‘parse_opts’:
spidev_test.c:290:12: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function)
    mode |= SPI_TX_OCTAL;
            ^
spidev_test.c:308:12: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function)
    mode |= SPI_RX_OCTAL;
            ^
  LD       spidev_test-in.o
ld: cannot find spidev_test.o: No such file or directory
/home/zhangqing/spi.git2/tools/build/Makefile.build:144: recipe for target 'spidev_test-in.o' failed
make[1]: *** [spidev_test-in.o] Error 1
make[1]: Leaving directory '/home/zhangqing/spi.git2/tools/spi'
Makefile:39: recipe for target 'spidev_test-in.o' failed
make: *** [spidev_test-in.o] Error 2

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
---
 include/uapi/linux/spi/spidev.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/spi/spidev.h b/include/uapi/linux/spi/spidev.h
index ee0f246..8b04c62 100644
--- a/include/uapi/linux/spi/spidev.h
+++ b/include/uapi/linux/spi/spidev.h
@@ -48,6 +48,8 @@
 #define SPI_TX_QUAD		0x200
 #define SPI_RX_DUAL		0x400
 #define SPI_RX_QUAD		0x800
+#define	SPI_TX_OCTAL	        0x2000
+#define	SPI_RX_OCTAL            0x4000
 
 /*---------------------------------------------------------------------------*/
 
-- 
2.1.0


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

* Re: [PATCH 2/2] spi: tools: Fix build errors
  2020-06-11  3:42 ` [PATCH 2/2] spi: tools: Fix build errors Qing Zhang
@ 2020-06-11  8:02   ` Geert Uytterhoeven
  2020-06-11  8:53     ` zhangqing
  0 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2020-06-11  8:02 UTC (permalink / raw)
  To: Qing Zhang
  Cc: Mark Brown, linux-spi, Linux Kernel Mailing List, Tiezhu Yang,
	Xuefeng Li

Hi Qing,

Thanks for your patch!

On Thu, Jun 11, 2020 at 5:43 AM Qing Zhang <zhangqing@loongson.cn> wrote:
> Fix the following build errors:
>
> include/linux/spi 2>&1 || true
> ln -sf /home/zhangqing/spi.git2/tools/spi/../../include/uapi/linux/spi/spidev.h include/linux/spi/spidev.h
> make -f /home/zhangqing/spi.git2/tools/build/Makefile.build dir=. obj=spidev_test
> make[1]: Entering directory '/home/zhangqing/spi.git2/tools/spi'
>   CC       spidev_test.o
> spidev_test.c: In function ‘transfer’:
> spidev_test.c:131:13: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function)
>   if (mode & SPI_TX_OCTAL)
>              ^
> spidev_test.c:131:13: note: each undeclared identifier is reported only once for each function it appears in
> spidev_test.c:137:13: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function)
>   if (mode & SPI_RX_OCTAL)
>              ^
> spidev_test.c: In function ‘parse_opts’:
> spidev_test.c:290:12: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function)
>     mode |= SPI_TX_OCTAL;
>             ^
> spidev_test.c:308:12: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function)
>     mode |= SPI_RX_OCTAL;
>             ^
>   LD       spidev_test-in.o
> ld: cannot find spidev_test.o: No such file or directory
> /home/zhangqing/spi.git2/tools/build/Makefile.build:144: recipe for target 'spidev_test-in.o' failed
> make[1]: *** [spidev_test-in.o] Error 1
> make[1]: Leaving directory '/home/zhangqing/spi.git2/tools/spi'
> Makefile:39: recipe for target 'spidev_test-in.o' failed
> make: *** [spidev_test-in.o] Error 2
>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>

Oops, somehow I forgot I had made a similar change on the target
when adding Octal mode support to spidev_test.c.
Sorry for that.

Fixes: 896fa735084e4a91 ("spi: spidev_test: Add support for Octal mode
data transfers")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> --- a/include/uapi/linux/spi/spidev.h
> +++ b/include/uapi/linux/spi/spidev.h
> @@ -48,6 +48,8 @@
>  #define SPI_TX_QUAD            0x200
>  #define SPI_RX_DUAL            0x400
>  #define SPI_RX_QUAD            0x800
> +#define        SPI_TX_OCTAL            0x2000
> +#define        SPI_RX_OCTAL            0x4000

Probably we should add SPI_CS_WORD and SPI_3WIRE_HIZ, too?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 2/2] spi: tools: Fix build errors
  2020-06-11  8:02   ` Geert Uytterhoeven
@ 2020-06-11  8:53     ` zhangqing
  0 siblings, 0 replies; 5+ messages in thread
From: zhangqing @ 2020-06-11  8:53 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Mark Brown, linux-spi, Linux Kernel Mailing List, Tiezhu Yang,
	Xuefeng Li

On 06/11/2020 04:02 PM, Geert Uytterhoeven wrote:
> Hi Qing,
>
> Thanks for your patch!
>
> On Thu, Jun 11, 2020 at 5:43 AM Qing Zhang <zhangqing@loongson.cn> wrote:
>> Fix the following build errors:
>>
>> include/linux/spi 2>&1 || true
>> ln -sf /home/zhangqing/spi.git2/tools/spi/../../include/uapi/linux/spi/spidev.h include/linux/spi/spidev.h
>> make -f /home/zhangqing/spi.git2/tools/build/Makefile.build dir=. obj=spidev_test
>> make[1]: Entering directory '/home/zhangqing/spi.git2/tools/spi'
>>    CC       spidev_test.o
>> spidev_test.c: In function ‘transfer’:
>> spidev_test.c:131:13: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function)
>>    if (mode & SPI_TX_OCTAL)
>>               ^
>> spidev_test.c:131:13: note: each undeclared identifier is reported only once for each function it appears in
>> spidev_test.c:137:13: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function)
>>    if (mode & SPI_RX_OCTAL)
>>               ^
>> spidev_test.c: In function ‘parse_opts’:
>> spidev_test.c:290:12: error: ‘SPI_TX_OCTAL’ undeclared (first use in this function)
>>      mode |= SPI_TX_OCTAL;
>>              ^
>> spidev_test.c:308:12: error: ‘SPI_RX_OCTAL’ undeclared (first use in this function)
>>      mode |= SPI_RX_OCTAL;
>>              ^
>>    LD       spidev_test-in.o
>> ld: cannot find spidev_test.o: No such file or directory
>> /home/zhangqing/spi.git2/tools/build/Makefile.build:144: recipe for target 'spidev_test-in.o' failed
>> make[1]: *** [spidev_test-in.o] Error 1
>> make[1]: Leaving directory '/home/zhangqing/spi.git2/tools/spi'
>> Makefile:39: recipe for target 'spidev_test-in.o' failed
>> make: *** [spidev_test-in.o] Error 2
>>
>> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> Oops, somehow I forgot I had made a similar change on the target
> when adding Octal mode support to spidev_test.c.
> Sorry for that.
>
> Fixes: 896fa735084e4a91 ("spi: spidev_test: Add support for Octal mode
> data transfers")
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
>> --- a/include/uapi/linux/spi/spidev.h
>> +++ b/include/uapi/linux/spi/spidev.h
>> @@ -48,6 +48,8 @@
>>   #define SPI_TX_QUAD            0x200
>>   #define SPI_RX_DUAL            0x400
>>   #define SPI_RX_QUAD            0x800
>> +#define        SPI_TX_OCTAL            0x2000
>> +#define        SPI_RX_OCTAL            0x4000
> Probably we should add SPI_CS_WORD and SPI_3WIRE_HIZ, too?

Hi Geert,

Thanks for your reply and suggestion.
Maybe SPI_CS_WORD and SPI_3WIRE_HIZ will be used in the future.
I will do it and then send v2.

Thanks,
Qing

>
> Gr{oetje,eeting}s,
>
>                          Geert
>


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

* Re: [PATCH 1/2] spi: tools: Make default_tx/rx and input_tx static
  2020-06-11  3:42 [PATCH 1/2] spi: tools: Make default_tx/rx and input_tx static Qing Zhang
  2020-06-11  3:42 ` [PATCH 2/2] spi: tools: Fix build errors Qing Zhang
@ 2020-06-11 15:29 ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-06-11 15:29 UTC (permalink / raw)
  To: Qing Zhang; +Cc: Tiezhu Yang, linux-spi, Xuefeng Li, linux-kernel

On Thu, 11 Jun 2020 11:42:26 +0800, Qing Zhang wrote:
> Fix the following sparse warning:
> 
> ./spidev_test.c:50:9: warning: symbol 'default_tx' was not declared. Should it be static?
> ./spidev_test.c:59:9: warning: symbol 'default_rx' was not declared. Should it be static?
> ./spidev_test.c:60:6: warning: symbol 'input_tx' was not declared. Should it be static?

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/2] spi: tools: Make default_tx/rx and input_tx static
      commit: bd2077915bfebf6965480753f9dd6a8319d06d14
[2/2] spi: tools: Fix build errors
      (no commit info)

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2020-06-11 15:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11  3:42 [PATCH 1/2] spi: tools: Make default_tx/rx and input_tx static Qing Zhang
2020-06-11  3:42 ` [PATCH 2/2] spi: tools: Fix build errors Qing Zhang
2020-06-11  8:02   ` Geert Uytterhoeven
2020-06-11  8:53     ` zhangqing
2020-06-11 15:29 ` [PATCH 1/2] spi: tools: Make default_tx/rx and input_tx static Mark Brown

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