[Sound-open-firmware] [PATCH] scripts: checkpatch: don't complain about volatile

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Fri Apr 13 17:04:56 CEST 2018


On 4/13/18 9:55 AM, Liam Girdwood wrote:
> On Thu, 2018-04-12 at 20:58 -0700, Ranjani Sridharan wrote:
>> On Fri, 2018-04-13 at 00:20 +0800, Pan, Xiuli wrote:
>>>
>>> On 4/13/2018 00:06, Liam Girdwood wrote:
>>>> On Thu, 2018-04-12 at 23:30 +0800, Xiuli Pan wrote:
>>>>> From: Pan Xiuli <xiuli.pan at linux.intel.com>
>>>>>
>>>>> Signed-off-by: Pan Xiuli <xiuli.pan at linux.intel.com>
>>>>> ---
>>>>>     scripts/checkpatch.pl | 7 -------
>>>>>     1 file changed, 7 deletions(-)
>>>>>
>>>>>
>>>>
>>>> Where is this being flagged up ?
>>
>> I had similar warnings with trace.h as well but I ignored them.
>>>
>>> I am fix some bug related to the panic, and these is related to the
>>> sw_reg_write
>>> src/platform/apollolake/include/platform/shim.h
>>>
>>> static inline void sw_reg_write(uint32_t reg, uint32_t val)
>>> {
>>>            *((volatile uint32_t*)(SRAM_SW_REG_BASE + reg)) = val;
>>> }
>>>
>>> I found in some case the SW_REG it not updated and the panic states
>>> if
>>> not sync with the IPC REGS.
>>> I would like to move SW_REG into mailbox.h and here is the volatile i
>>> hit.
> 
> I think we should leave this warning intact as it's obvious we need to it
> register IO, but serves as a warning in other places.

Agree. You can ignore specific warnings with the -n option if the tool 
is wrong in some cases. The idea is to bring your attention to the code 
and make an educated decision on whether the use of volatile is really 
needed.


More information about the Sound-open-firmware mailing list