qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] s390: fix clang warnings
@ 2015-01-26 16:28 Peter Maydell
  2015-01-26 16:28 ` [Qemu-devel] [PATCH v2 1/2] target-s390x: Mark check_privileged() as !CONFIG_USER_ONLY Peter Maydell
  2015-01-26 16:28 ` [Qemu-devel] [PATCH v2 2/2] disas/s390.c: Remove unused variables Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2015-01-26 16:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: patches, Stefan Weil, Alexander Graf, Christian Borntraeger,
	Cornelia Huck, Richard Henderson

These two patches fix warnings generated by clang; I'm hoping we can
clear up the handful of remaining clang warnings so I can turn on
warnings-as-errors for my builds I do before applying pullreqs, and
then we can keep the clang builds warning-free.

For the disassembler code, I opted to simply delete the unused
data tables. The other thing we've done in some of the disassemblers
is to just #if-0 out the code, but that's mostly been where it's
something we might use in future, and I think this table is for
the benefit of the assembler, not the disassembler.

I sent these patches out just before Christmas; Stefan pointed
out a minor error in the commit message of patch 1, but they
are otherwise unchanged from v1.

Peter Maydell (2):
  target-s390x: Mark check_privileged() as !CONFIG_USER_ONLY
  disas/s390.c: Remove unused variables

 disas/s390.c             | 35 -----------------------------------
 target-s390x/translate.c |  2 ++
 2 files changed, 2 insertions(+), 35 deletions(-)

-- 
1.9.1

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

* [Qemu-devel] [PATCH v2 1/2] target-s390x: Mark check_privileged() as !CONFIG_USER_ONLY
  2015-01-26 16:28 [Qemu-devel] [PATCH v2 0/2] s390: fix clang warnings Peter Maydell
@ 2015-01-26 16:28 ` Peter Maydell
  2015-01-26 16:28 ` [Qemu-devel] [PATCH v2 2/2] disas/s390.c: Remove unused variables Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-01-26 16:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: patches, Stefan Weil, Alexander Graf, Christian Borntraeger,
	Cornelia Huck, Richard Henderson

The function check_privileged() is only used in the softmmu configs;
wrap it in an #ifndef CONFIG_USER_ONLY to avoid clang warnings on the
linux-user builds.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1419373100-17690-2-git-send-email-peter.maydell@linaro.org
---
 target-s390x/translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index ab01bc0..1c3a8e8 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -317,12 +317,14 @@ static inline void gen_illegal_opcode(DisasContext *s)
     gen_program_exception(s, PGM_SPECIFICATION);
 }
 
+#ifndef CONFIG_USER_ONLY
 static inline void check_privileged(DisasContext *s)
 {
     if (s->tb->flags & (PSW_MASK_PSTATE >> 32)) {
         gen_program_exception(s, PGM_PRIVILEGED);
     }
 }
+#endif
 
 static TCGv_i64 get_address(DisasContext *s, int x2, int b2, int d2)
 {
-- 
1.9.1

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

* [Qemu-devel] [PATCH v2 2/2] disas/s390.c: Remove unused variables
  2015-01-26 16:28 [Qemu-devel] [PATCH v2 0/2] s390: fix clang warnings Peter Maydell
  2015-01-26 16:28 ` [Qemu-devel] [PATCH v2 1/2] target-s390x: Mark check_privileged() as !CONFIG_USER_ONLY Peter Maydell
@ 2015-01-26 16:28 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-01-26 16:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: patches, Stefan Weil, Alexander Graf, Christian Borntraeger,
	Cornelia Huck, Richard Henderson

The variables s390_opformats and s390_num_opformats are unused and
provoke clang warnings:

disas/s390.c:849:33: warning: variable 's390_opformats' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static const struct s390_opcode s390_opformats[] =
                                ^
disas/s390.c:875:18: warning: unused variable 's390_num_opformats' [-Wunused-const-variable]
static const int s390_num_opformats =
                 ^

Delete them, since QEMU doesn't use them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-id: 1419373100-17690-3-git-send-email-peter.maydell@linaro.org
---
 disas/s390.c | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/disas/s390.c b/disas/s390.c
index 25499ba..974460c 100644
--- a/disas/s390.c
+++ b/disas/s390.c
@@ -106,10 +106,6 @@ struct s390_opcode
 static const struct s390_opcode s390_opcodes[];
 static const int                s390_num_opcodes;
 
-/* A opcode format table for the .insn pseudo mnemonic.  */
-static const struct s390_opcode s390_opformats[];
-static const int                s390_num_opformats;
-
 /* Values defined for the flags field of a struct powerpc_opcode.  */
 
 /* The operands table is an array of struct s390_operand.  */
@@ -844,37 +840,6 @@ static const struct s390_operand s390_operands[] =
 #define MASK_SIY_DRI     { 0xff, 0x00, 0x00, 0x00, 0x00, 0xff }
 /* QEMU-END */
 
-/* The opcode formats table (blueprints for .insn pseudo mnemonic).  */
-
-static const struct s390_opcode s390_opformats[] =
-  {
-  { "e",	OP8(0x00LL),	MASK_E,		INSTR_E,	3, 0 },
-  { "ri",	OP8(0x00LL),	MASK_RI_RI,	INSTR_RI_RI,	3, 0 },
-  { "rie",	OP8(0x00LL),	MASK_RIE_RRP,	INSTR_RIE_RRP,	3, 0 },
-  { "ril",	OP8(0x00LL),	MASK_RIL_RP,	INSTR_RIL_RP,	3, 0 },
-  { "rilu",	OP8(0x00LL),	MASK_RIL_RU,	INSTR_RIL_RU,	3, 0 },
-  { "rr",	OP8(0x00LL),	MASK_RR_RR,	INSTR_RR_RR,	3, 0 },
-  { "rre",	OP8(0x00LL),	MASK_RRE_RR,	INSTR_RRE_RR,	3, 0 },
-  { "rrf",	OP8(0x00LL),	MASK_RRF_RURR,	INSTR_RRF_RURR,	3, 0 },
-  { "rs",	OP8(0x00LL),	MASK_RS_RRRD,	INSTR_RS_RRRD,	3, 0 },
-  { "rse",	OP8(0x00LL),	MASK_RSE_RRRD,	INSTR_RSE_RRRD,	3, 0 },
-  { "rsi",	OP8(0x00LL),	MASK_RSI_RRP,	INSTR_RSI_RRP,	3, 0 },
-  { "rsy",	OP8(0x00LL),	MASK_RSY_RRRD,	INSTR_RSY_RRRD,	3, 3 },
-  { "rx",	OP8(0x00LL),	MASK_RX_RRRD,	INSTR_RX_RRRD,	3, 0 },
-  { "rxe",	OP8(0x00LL),	MASK_RXE_RRRD,	INSTR_RXE_RRRD,	3, 0 },
-  { "rxf",	OP8(0x00LL),	MASK_RXF_RRRDR,	INSTR_RXF_RRRDR,3, 0 },
-  { "rxy",	OP8(0x00LL),	MASK_RXY_RRRD,	INSTR_RXY_RRRD,	3, 3 },
-  { "s",	OP8(0x00LL),	MASK_S_RD,	INSTR_S_RD,	3, 0 },
-  { "si",	OP8(0x00LL),	MASK_SI_URD,	INSTR_SI_URD,	3, 0 },
-  { "siy",	OP8(0x00LL),	MASK_SIY_URD,	INSTR_SIY_URD,	3, 3 },
-  { "ss",	OP8(0x00LL),	MASK_SS_RRRDRD,	INSTR_SS_RRRDRD,3, 0 },
-  { "sse",	OP8(0x00LL),	MASK_SSE_RDRD,	INSTR_SSE_RDRD,	3, 0 },
-  { "ssf",	OP8(0x00LL),	MASK_SSF_RRDRD,	INSTR_SSF_RRDRD,3, 0 },
-};
-
-static const int s390_num_opformats =
-  sizeof (s390_opformats) / sizeof (s390_opformats[0]);
-
 /* include "s390-opc.tab" generated from opcodes/s390-opc.txt rev 1.17 */
 /* The opcode table. This file was generated by s390-mkopc.
 
-- 
1.9.1

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

end of thread, other threads:[~2015-01-26 16:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-26 16:28 [Qemu-devel] [PATCH v2 0/2] s390: fix clang warnings Peter Maydell
2015-01-26 16:28 ` [Qemu-devel] [PATCH v2 1/2] target-s390x: Mark check_privileged() as !CONFIG_USER_ONLY Peter Maydell
2015-01-26 16:28 ` [Qemu-devel] [PATCH v2 2/2] disas/s390.c: Remove unused variables Peter Maydell

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