[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJKgH8BkV0iRH8DN8-Y=LqvY90DHFOT_iqjTx1szgssPriThdg@mail.gmail.com>
Date: Wed, 5 Sep 2012 13:57:07 +0530
From: Manavendra Nath Manav <mnm.kernel@...il.com>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: kernelnewbies@...nelnewbies.org, devel@...verdev.osuosl.org,
Greg KH <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: Why exported const value modified by another driver not updated
in original driver
On Tue, Sep 4, 2012 at 5:55 PM, Dan Carpenter <dan.carpenter@...cle.com> wrote:
> On Tue, Sep 04, 2012 at 03:58:20PM +0530, Manavendra Nath Manav wrote:
>> Is the above a genuine kernel bug, or i am missing something out here. Pls help.
>>
>
> When you declare something as const then the compiler assumes it
> really is const and uses a literal instead of reading from memory.
> I'm surprised the compiler doesn't print a warning message.
>
> It has to do with compilers, nothing to do with kernels.
>
> regards,
> dan carpenter
Thanks All,
I understood the problem and current gcc behaviour after looking at
output of objdump of driver.ko file when the variable is declared as
"const" and in second case as "const volatile". The compiler optimises
by directly passing the value in first case and the address of
variable in second case. Thanks for all the help and clarification.
push $0x7b // 123 in decimal
push $0x0
--
Manavendra Nath Manav
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists