[Sound-open-firmware] [PATCH] scripts: checkpatch: don't complain about volatile
From: Pan Xiuli xiuli.pan@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- scripts/checkpatch.pl | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 16d035e..6afecfe 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5189,13 +5189,6 @@ sub process { } }
-# no volatiles please - my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b}; - if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) { - WARN("VOLATILE", - "Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst\n" . $herecurr); - } - # Check for user-visible strings broken across lines, which breaks the ability # to grep for the string. Make exceptions when the previous string ends in a # newline (multiple lines in one string constant) or '\t', '\r', ';', or '{'
On Thu, 2018-04-12 at 23:30 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
scripts/checkpatch.pl | 7 ------- 1 file changed, 7 deletions(-)
Where is this being flagged up ?
Liam
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@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
scripts/checkpatch.pl | 7 ------- 1 file changed, 7 deletions(-)
Where is this being flagged up ?
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.
Thanks Xiuli
Liam
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@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@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.
Thanks Xiuli
Liam
Sound-open-firmware mailing list Sound-open-firmware@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
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@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@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.
Thanks
Liam
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@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@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.
participants (5)
-
Liam Girdwood
-
Pan, Xiuli
-
Pierre-Louis Bossart
-
Ranjani Sridharan
-
Xiuli Pan