All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: "Tianjia Zhang" <tianjia.zhang@linux.alibaba.com>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Sasha Levin" <sashal@kernel.org>,
	ndesaulniers@google.com, freifunk@adrianschmutzler.de,
	linux-mips@vger.kernel.org, llvm@lists.linux.dev
Subject: [PATCH AUTOSEL 4.9 11/13] MIPS: Octeon: Fix build errors using clang
Date: Mon, 17 Jan 2022 12:07:19 -0500	[thread overview]
Message-ID: <20220117170722.1473137-11-sashal@kernel.org> (raw)
In-Reply-To: <20220117170722.1473137-1-sashal@kernel.org>

From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>

[ Upstream commit 95339b70677dc6f9a2d669c4716058e71b8dc1c7 ]

A large number of the following errors is reported when compiling
with clang:

  cvmx-bootinfo.h:326:3: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int]
                  ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL)
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  cvmx-bootinfo.h:321:20: note: expanded from macro 'ENUM_BRD_TYPE_CASE'
          case x: return(#x + 16);        /* Skip CVMX_BOARD_TYPE_ */
                         ~~~^~~~
  cvmx-bootinfo.h:326:3: note: use array indexing to silence this warning
  cvmx-bootinfo.h:321:20: note: expanded from macro 'ENUM_BRD_TYPE_CASE'
          case x: return(#x + 16);        /* Skip CVMX_BOARD_TYPE_ */
                          ^

Follow the prompts to use the address operator '&' to fix this error.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/mips/include/asm/octeon/cvmx-bootinfo.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
index 62787765575ef..ce6e5fddce0bf 100644
--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h
+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
@@ -315,7 +315,7 @@ enum cvmx_chip_types_enum {
 
 /* Functions to return string based on type */
 #define ENUM_BRD_TYPE_CASE(x) \
-	case x: return(#x + 16);	/* Skip CVMX_BOARD_TYPE_ */
+	case x: return (&#x[16]);	/* Skip CVMX_BOARD_TYPE_ */
 static inline const char *cvmx_board_type_to_string(enum
 						    cvmx_board_types_enum type)
 {
@@ -404,7 +404,7 @@ static inline const char *cvmx_board_type_to_string(enum
 }
 
 #define ENUM_CHIP_TYPE_CASE(x) \
-	case x: return(#x + 15);	/* Skip CVMX_CHIP_TYPE */
+	case x: return (&#x[15]);	/* Skip CVMX_CHIP_TYPE */
 static inline const char *cvmx_chip_type_to_string(enum
 						   cvmx_chip_types_enum type)
 {
-- 
2.34.1


  parent reply	other threads:[~2022-01-17 17:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-17 17:07 [PATCH AUTOSEL 4.9 01/13] powerpc/6xx: add missing of_node_put Sasha Levin
2022-01-17 17:07 ` Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 02/13] powerpc/powernv: " Sasha Levin
2022-01-17 17:07   ` Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 03/13] powerpc/cell: " Sasha Levin
2022-01-17 17:07   ` Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 04/13] powerpc/btext: " Sasha Levin
2022-01-17 17:07   ` Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 05/13] i2c: i801: Don't silently correct invalid transfer size Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 06/13] powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING Sasha Levin
2022-01-17 17:07   ` Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 07/13] i2c: mpc: Correct I2C reset procedure Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 08/13] w1: Misuse of get_user()/put_user() reported by sparse Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 09/13] ALSA: seq: Set upper limit of processed events Sasha Levin
2022-01-17 17:07   ` Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 10/13] i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters Sasha Levin
2022-01-17 17:07 ` Sasha Levin [this message]
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 12/13] scsi: sr: Don't use GFP_DMA Sasha Levin
2022-01-17 17:07 ` [PATCH AUTOSEL 4.9 13/13] ASoC: mediatek: mt8173: fix device_node leak Sasha Levin
2022-01-17 17:07   ` Sasha Levin
2022-01-17 17:07   ` Sasha Levin
2022-01-17 17:07   ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220117170722.1473137-11-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=f4bug@amsat.org \
    --cc=freifunk@adrianschmutzler.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tianjia.zhang@linux.alibaba.com \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.