All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] sandbox: spi: sandbox_sf_state_name() is required
@ 2020-06-07  7:27 Heinrich Schuchardt
  2020-06-07 13:45 ` Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Heinrich Schuchardt @ 2020-06-07  7:27 UTC (permalink / raw)
  To: u-boot

Compiling drivers/mtd/spi/sandbox.c fails when compiled with
CONFIG_LOG=n:

In file included from include/common.h:20,
                 from drivers/mtd/spi/sandbox.c:13:
drivers/mtd/spi/sandbox.c:295:15: error: format ?%s? expects argument of
type ?char *?, but argument 7 has type ?int? [-Werror=format=]
  295 |   log_content(" cmd: transition to %s state\n",
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:37:21: note: in definition of macro ?pr_fmt?
   37 | #define pr_fmt(fmt) fmt
      |                     ^~~
include/log.h:128:30: note: in expansion of macro ?log_nop?
  128 | #define log_content(_fmt...) log_nop(LOG_CATEGORY, \
      |                              ^~~~~~~
drivers/mtd/spi/sandbox.c:295:3: note: in expansion of macro
?log_content?
  295 |   log_content(" cmd: transition to %s state\n",
      |   ^~~~~~~~~~~
drivers/mtd/spi/sandbox.c:295:37: note: format string is defined here
  295 |   log_content(" cmd: transition to %s state\n",
      |                                    ~^
      |                                     |
      |                                     char *
      |                                    %d

Supply function sandbox_sf_state_name() independent of CONFIG_LOG.

Fixes: c3aed5db591e ("sandbox: spi: Add more logging")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/mtd/spi/sandbox.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
index 8cbe97ee20..0b602dc914 100644
--- a/drivers/mtd/spi/sandbox.c
+++ b/drivers/mtd/spi/sandbox.c
@@ -44,7 +44,6 @@ enum sandbox_sf_state {
 	SF_WRITE_STATUS, /* write the flash's status register */
 };

-#if CONFIG_IS_ENABLED(LOG)
 static const char *sandbox_sf_state_name(enum sandbox_sf_state state)
 {
 	static const char * const states[] = {
@@ -53,7 +52,6 @@ static const char *sandbox_sf_state_name(enum sandbox_sf_state state)
 	};
 	return states[state];
 }
-#endif /* LOG */

 /* Bits for the status register */
 #define STAT_WIP	(1 << 0)
--
2.26.2

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

* [PATCH 1/1] sandbox: spi: sandbox_sf_state_name() is required
  2020-06-07  7:27 [PATCH 1/1] sandbox: spi: sandbox_sf_state_name() is required Heinrich Schuchardt
@ 2020-06-07 13:45 ` Simon Glass
  2020-07-06  1:34 ` Simon Glass
  2020-07-06  1:37 ` Simon Glass
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2020-06-07 13:45 UTC (permalink / raw)
  To: u-boot

On Sun, 7 Jun 2020 at 01:28, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Compiling drivers/mtd/spi/sandbox.c fails when compiled with
> CONFIG_LOG=n:
>
> In file included from include/common.h:20,
>                  from drivers/mtd/spi/sandbox.c:13:
> drivers/mtd/spi/sandbox.c:295:15: error: format ?%s? expects argument of
> type ?char *?, but argument 7 has type ?int? [-Werror=format=]
>   295 |   log_content(" cmd: transition to %s state\n",
>       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/printk.h:37:21: note: in definition of macro ?pr_fmt?
>    37 | #define pr_fmt(fmt) fmt
>       |                     ^~~
> include/log.h:128:30: note: in expansion of macro ?log_nop?
>   128 | #define log_content(_fmt...) log_nop(LOG_CATEGORY, \
>       |                              ^~~~~~~
> drivers/mtd/spi/sandbox.c:295:3: note: in expansion of macro
> ?log_content?
>   295 |   log_content(" cmd: transition to %s state\n",
>       |   ^~~~~~~~~~~
> drivers/mtd/spi/sandbox.c:295:37: note: format string is defined here
>   295 |   log_content(" cmd: transition to %s state\n",
>       |                                    ~^
>       |                                     |
>       |                                     char *
>       |                                    %d
>
> Supply function sandbox_sf_state_name() independent of CONFIG_LOG.
>
> Fixes: c3aed5db591e ("sandbox: spi: Add more logging")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/mtd/spi/sandbox.c | 2 --
>  1 file changed, 2 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

We probably need to update test/run and CI config with a test that
builds sandbox with this CONFIG_LOG=n

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

* [PATCH 1/1] sandbox: spi: sandbox_sf_state_name() is required
  2020-06-07  7:27 [PATCH 1/1] sandbox: spi: sandbox_sf_state_name() is required Heinrich Schuchardt
  2020-06-07 13:45 ` Simon Glass
@ 2020-07-06  1:34 ` Simon Glass
  2020-07-06  1:37 ` Simon Glass
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2020-07-06  1:34 UTC (permalink / raw)
  To: u-boot

On Sun, 7 Jun 2020 at 01:28, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Compiling drivers/mtd/spi/sandbox.c fails when compiled with
> CONFIG_LOG=n:
>
> In file included from include/common.h:20,
>                  from drivers/mtd/spi/sandbox.c:13:
> drivers/mtd/spi/sandbox.c:295:15: error: format ?%s? expects argument of
> type ?char *?, but argument 7 has type ?int? [-Werror=format=]
>   295 |   log_content(" cmd: transition to %s state\n",
>       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/printk.h:37:21: note: in definition of macro ?pr_fmt?
>    37 | #define pr_fmt(fmt) fmt
>       |                     ^~~
> include/log.h:128:30: note: in expansion of macro ?log_nop?
>   128 | #define log_content(_fmt...) log_nop(LOG_CATEGORY, \
>       |                              ^~~~~~~
> drivers/mtd/spi/sandbox.c:295:3: note: in expansion of macro
> ?log_content?
>   295 |   log_content(" cmd: transition to %s state\n",
>       |   ^~~~~~~~~~~
> drivers/mtd/spi/sandbox.c:295:37: note: format string is defined here
>   295 |   log_content(" cmd: transition to %s state\n",
>       |                                    ~^
>       |                                     |
>       |                                     char *
>       |                                    %d
>
> Supply function sandbox_sf_state_name() independent of CONFIG_LOG.
>
> Fixes: c3aed5db591e ("sandbox: spi: Add more logging")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/mtd/spi/sandbox.c | 2 --
>  1 file changed, 2 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

We probably need to update test/run and CI config with a test that
builds sandbox with this CONFIG_LOG=n

Applied to u-boot-dm/next, thanks!

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

* [PATCH 1/1] sandbox: spi: sandbox_sf_state_name() is required
  2020-06-07  7:27 [PATCH 1/1] sandbox: spi: sandbox_sf_state_name() is required Heinrich Schuchardt
  2020-06-07 13:45 ` Simon Glass
  2020-07-06  1:34 ` Simon Glass
@ 2020-07-06  1:37 ` Simon Glass
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Glass @ 2020-07-06  1:37 UTC (permalink / raw)
  To: u-boot

On Sun, 7 Jun 2020 at 01:28, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Compiling drivers/mtd/spi/sandbox.c fails when compiled with
> CONFIG_LOG=n:
>
> In file included from include/common.h:20,
>                  from drivers/mtd/spi/sandbox.c:13:
> drivers/mtd/spi/sandbox.c:295:15: error: format ?%s? expects argument of
> type ?char *?, but argument 7 has type ?int? [-Werror=format=]
>   295 |   log_content(" cmd: transition to %s state\n",
>       |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/printk.h:37:21: note: in definition of macro ?pr_fmt?
>    37 | #define pr_fmt(fmt) fmt
>       |                     ^~~
> include/log.h:128:30: note: in expansion of macro ?log_nop?
>   128 | #define log_content(_fmt...) log_nop(LOG_CATEGORY, \
>       |                              ^~~~~~~
> drivers/mtd/spi/sandbox.c:295:3: note: in expansion of macro
> ?log_content?
>   295 |   log_content(" cmd: transition to %s state\n",
>       |   ^~~~~~~~~~~
> drivers/mtd/spi/sandbox.c:295:37: note: format string is defined here
>   295 |   log_content(" cmd: transition to %s state\n",
>       |                                    ~^
>       |                                     |
>       |                                     char *
>       |                                    %d
>
> Supply function sandbox_sf_state_name() independent of CONFIG_LOG.
>
> Fixes: c3aed5db591e ("sandbox: spi: Add more logging")
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/mtd/spi/sandbox.c | 2 --
>  1 file changed, 2 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

We probably need to update test/run and CI config with a test that
builds sandbox with this CONFIG_LOG=n

Applied to u-boot-dm/next, thanks!
Applied to u-boot-dm/next, thanks!

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

end of thread, other threads:[~2020-07-06  1:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-07  7:27 [PATCH 1/1] sandbox: spi: sandbox_sf_state_name() is required Heinrich Schuchardt
2020-06-07 13:45 ` Simon Glass
2020-07-06  1:34 ` Simon Glass
2020-07-06  1:37 ` Simon Glass

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.