lkml.org 
[lkml]   [2016]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] EDAC, mpc85xx: fix build warning
On Tue, Feb 02, 2016 at 04:09:50PM +0100, Borislav Petkov wrote:
> On Tue, Feb 02, 2016 at 08:25:54PM +0530, Sudip Mukherjee wrote:
> > oops... i just sent the v2 while removing pvr. Which is the better way
> > then?
> > Personally, I donot like __maybe_unused, it is telling gcc that this
> > variable is unused so donot give any warning for it. But in reality it
> > is being used in some cases.
>
> And? You want to shut up the warning, right?
>
> Adding __maybe_unused is the simplest variant without disadvantages. Or
> are there any?

another way might be:

diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index b7139c1..968c0c0 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -1244,7 +1244,9 @@ static struct platform_driver * const drivers[] = {
static int __init mpc85xx_mc_init(void)
{
int res = 0;
+#ifdef CONFIG_FSL_SOC_BOOKE
u32 pvr = 0;
+#endif

printk(KERN_INFO "Freescale(R) MPC85xx EDAC driver, "
"(C) 2006 Montavista Software\n");
regards
sudip

\
 
 \ /
  Last update: 2016-02-02 16:21    [W:0.091 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site