diff mbox series

MIPS: Loongson64: Remove a "set but not used" variable

Message ID 20210514103217.2051315-1-chenhuacai@loongson.cn (mailing list archive)
State Accepted
Commit 4f5d31ce099ddc7f40c5537a680b91ea87a6c5d4
Headers show
Series MIPS: Loongson64: Remove a "set but not used" variable | expand

Commit Message

Huacai Chen May 14, 2021, 10:32 a.m. UTC
This fix build warning:

   arch/mips/loongson64/env.c: In function 'prom_init_env':
>> arch/mips/loongson64/env.c:50:14: warning: variable 'device' set but not used [-Wunused-but-set-variable]
      50 |  u16 vendor, device;
         |              ^~~~~~
   {standard input}: Assembler messages:
   {standard input}:788: Error: found '(', expected: ')'
   {standard input}:788: Error: found '(', expected: ')'
   {standard input}:788: Error: non-constant expression in ".if" statement
   {standard input}:788: Error: junk at end of line, first unrecognized character is `('
   {standard input}:801: Error: found '(', expected: ')'
   {standard input}:801: Error: found '(', expected: ')'
   {standard input}:801: Error: non-constant expression in ".if" statement
   {standard input}:801: Error: junk at end of line, first unrecognized character is `('

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
---
 arch/mips/loongson64/env.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Thomas Bogendoerfer May 27, 2021, 11:44 a.m. UTC | #1
On Fri, May 14, 2021 at 06:32:17PM +0800, Huacai Chen wrote:
> This fix build warning:
> 
>    arch/mips/loongson64/env.c: In function 'prom_init_env':
> >> arch/mips/loongson64/env.c:50:14: warning: variable 'device' set but not used [-Wunused-but-set-variable]
>       50 |  u16 vendor, device;
>          |              ^~~~~~
>    {standard input}: Assembler messages:
>    {standard input}:788: Error: found '(', expected: ')'
>    {standard input}:788: Error: found '(', expected: ')'
>    {standard input}:788: Error: non-constant expression in ".if" statement
>    {standard input}:788: Error: junk at end of line, first unrecognized character is `('
>    {standard input}:801: Error: found '(', expected: ')'
>    {standard input}:801: Error: found '(', expected: ')'
>    {standard input}:801: Error: non-constant expression in ".if" statement
>    {standard input}:801: Error: junk at end of line, first unrecognized character is `('
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> ---
>  arch/mips/loongson64/env.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

applied to mips-next.

Thomas.
Maciej W. Rozycki June 14, 2021, 2:03 a.m. UTC | #2
On Fri, 14 May 2021, Huacai Chen wrote:

> This fix build warning:
> 
>    arch/mips/loongson64/env.c: In function 'prom_init_env':
> >> arch/mips/loongson64/env.c:50:14: warning: variable 'device' set but not used [-Wunused-but-set-variable]
>       50 |  u16 vendor, device;
>          |              ^~~~~~
>    {standard input}: Assembler messages:
>    {standard input}:788: Error: found '(', expected: ')'
>    {standard input}:788: Error: found '(', expected: ')'
>    {standard input}:788: Error: non-constant expression in ".if" statement
>    {standard input}:788: Error: junk at end of line, first unrecognized character is `('
>    {standard input}:801: Error: found '(', expected: ')'
>    {standard input}:801: Error: found '(', expected: ')'
>    {standard input}:801: Error: non-constant expression in ".if" statement
>    {standard input}:801: Error: junk at end of line, first unrecognized character is `('

 What's this chain of assembler error messages doing here?  Surely it does 
not come from the compiler warning and is not related to the patch posted, 
and therefore it has no place in the commit description.  Have you checked 
where it's actually coming from?

  Maciej
diff mbox series

Patch

diff --git a/arch/mips/loongson64/env.c b/arch/mips/loongson64/env.c
index c8bb75d58f17..c961e2999f15 100644
--- a/arch/mips/loongson64/env.c
+++ b/arch/mips/loongson64/env.c
@@ -62,7 +62,7 @@  void __init prom_lefi_init_env(void)
 	struct efi_cpuinfo_loongson *ecpu;
 	struct irq_source_routing_table *eirq_source;
 	u32 id;
-	u16 vendor, device;
+	u16 vendor;
 
 	/* firmware arguments are initialized in head.S */
 	boot_p = (struct boot_params *)fw_arg2;
@@ -166,7 +166,6 @@  void __init prom_lefi_init_env(void)
 	/* Read the ID of PCI host bridge to detect bridge type */
 	id = readl(HOST_BRIDGE_CONFIG_ADDR);
 	vendor = id & 0xffff;
-	device = (id >> 16) & 0xffff;
 
 	switch (vendor) {
 	case PCI_VENDOR_ID_LOONGSON: