diff mbox series

[v4,3/4] OPP: Add api to retrieve opps which is at most the provided level

Message ID 1692717141-32743-4-git-send-email-quic_krichai@quicinc.com (mailing list archive)
State Superseded
Delegated to: Krzysztof Wilczyński
Headers show
Series PCI: qcom: Add support for OPP | expand

Commit Message

Krishna Chaitanya Chundru Aug. 22, 2023, 3:12 p.m. UTC
Add dev_pm_opp_find_level_floor() for searching a lesser match or
operating on OPP in the order of decreasing level.

Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
---
 drivers/opp/core.c     | 26 ++++++++++++++++++++++++++
 include/linux/pm_opp.h |  4 ++++
 2 files changed, 30 insertions(+)

Comments

kernel test robot Aug. 22, 2023, 9:33 p.m. UTC | #1
Hi Krishna,

kernel test robot noticed the following build warnings:

[auto build test WARNING on pci/for-linus]
[also build test WARNING on robh/for-next rafael-pm/linux-next linus/master v6.5-rc7 next-20230822]
[cannot apply to pci/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krishna-chaitanya-chundru/dt-bindings-pci-qcom-Add-opp-table/20230822-232104
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git for-linus
patch link:    https://lore.kernel.org/r/1692717141-32743-4-git-send-email-quic_krichai%40quicinc.com
patch subject: [PATCH v4 3/4] OPP: Add api to retrieve opps which is at most the provided level
config: parisc-randconfig-r081-20230823 (https://download.01.org/0day-ci/archive/20230823/202308230526.RjJmRzFy-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230823/202308230526.RjJmRzFy-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308230526.RjJmRzFy-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/opp/core.c:756: warning: Function parameter or member 'level' not described in 'dev_pm_opp_find_level_floor'
>> drivers/opp/core.c:756: warning: Excess function parameter 'freq' description in 'dev_pm_opp_find_level_floor'
   drivers/opp/core.c:2025: warning: Function parameter or member 'opp_table' not described in '_opp_set_supported_hw'
   drivers/opp/core.c:2025: warning: Excess function parameter 'dev' description in '_opp_set_supported_hw'
   drivers/opp/core.c:2068: warning: Function parameter or member 'opp_table' not described in '_opp_set_prop_name'
   drivers/opp/core.c:2068: warning: Excess function parameter 'dev' description in '_opp_set_prop_name'
   drivers/opp/core.c:2109: warning: Function parameter or member 'opp_table' not described in '_opp_set_regulators'
   drivers/opp/core.c:2109: warning: Excess function parameter 'count' description in '_opp_set_regulators'
   drivers/opp/core.c:2213: warning: Function parameter or member 'opp_table' not described in '_opp_set_clknames'
   drivers/opp/core.c:2213: warning: Function parameter or member 'config_clks' not described in '_opp_set_clknames'
   drivers/opp/core.c:2311: warning: Function parameter or member 'opp_table' not described in '_opp_set_config_regulators_helper'
   drivers/opp/core.c:2375: warning: Function parameter or member 'opp_table' not described in '_opp_attach_genpd'
   drivers/opp/core.c:2602: warning: Function parameter or member 'token' not described in 'dev_pm_opp_clear_config'
   drivers/opp/core.c:2602: warning: Excess function parameter 'opp_table' description in 'dev_pm_opp_clear_config'


vim +756 drivers/opp/core.c

   734	
   735	
   736	/**
   737	 * dev_pm_opp_find_level_floor() - Search for a rounded floor freq
   738	 * @dev:	device for which we do this operation
   739	 * @freq:	Start level
   740	 *
   741	 * Search for the matching floor *available* OPP from a starting level
   742	 * for a device.
   743	 *
   744	 * Return: matching *opp and refreshes *level accordingly, else returns
   745	 * ERR_PTR in case of error and should be handled using IS_ERR. Error return
   746	 * values can be:
   747	 * EINVAL:	for bad pointer
   748	 * ERANGE:	no match found for search
   749	 * ENODEV:	if device not found in list of registered devices
   750	 *
   751	 * The callers are required to call dev_pm_opp_put() for the returned OPP after
   752	 * use.
   753	 */
   754	struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
   755						      unsigned long *level)
 > 756	{
   757		return _find_key_floor(dev, level, 0, true, _read_level, NULL);
   758	}
   759	EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_floor);
   760
kernel test robot Aug. 22, 2023, 11:10 p.m. UTC | #2
Hi Krishna,

kernel test robot noticed the following build warnings:

[auto build test WARNING on pci/for-linus]
[also build test WARNING on robh/for-next rafael-pm/linux-next linus/master v6.5-rc7 next-20230822]
[cannot apply to pci/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krishna-chaitanya-chundru/dt-bindings-pci-qcom-Add-opp-table/20230822-232104
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git for-linus
patch link:    https://lore.kernel.org/r/1692717141-32743-4-git-send-email-quic_krichai%40quicinc.com
patch subject: [PATCH v4 3/4] OPP: Add api to retrieve opps which is at most the provided level
config: x86_64-randconfig-073-20230823 (https://download.01.org/0day-ci/archive/20230823/202308230637.gz3wmjrT-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce: (https://download.01.org/0day-ci/archive/20230823/202308230637.gz3wmjrT-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308230637.gz3wmjrT-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/opp/core.c:756: warning: Function parameter or member 'level' not described in 'dev_pm_opp_find_level_floor'
>> drivers/opp/core.c:756: warning: Excess function parameter 'freq' description in 'dev_pm_opp_find_level_floor'
   drivers/opp/core.c:2025: warning: Function parameter or member 'opp_table' not described in '_opp_set_supported_hw'
   drivers/opp/core.c:2025: warning: Excess function parameter 'dev' description in '_opp_set_supported_hw'
   drivers/opp/core.c:2068: warning: Function parameter or member 'opp_table' not described in '_opp_set_prop_name'
   drivers/opp/core.c:2068: warning: Excess function parameter 'dev' description in '_opp_set_prop_name'
   drivers/opp/core.c:2109: warning: Function parameter or member 'opp_table' not described in '_opp_set_regulators'
   drivers/opp/core.c:2109: warning: Excess function parameter 'count' description in '_opp_set_regulators'
   drivers/opp/core.c:2213: warning: Function parameter or member 'opp_table' not described in '_opp_set_clknames'
   drivers/opp/core.c:2213: warning: Function parameter or member 'config_clks' not described in '_opp_set_clknames'
   drivers/opp/core.c:2311: warning: Function parameter or member 'opp_table' not described in '_opp_set_config_regulators_helper'
   drivers/opp/core.c:2375: warning: Function parameter or member 'opp_table' not described in '_opp_attach_genpd'
   drivers/opp/core.c:2602: warning: Function parameter or member 'token' not described in 'dev_pm_opp_clear_config'
   drivers/opp/core.c:2602: warning: Excess function parameter 'opp_table' description in 'dev_pm_opp_clear_config'


vim +756 drivers/opp/core.c

   734	
   735	
   736	/**
   737	 * dev_pm_opp_find_level_floor() - Search for a rounded floor freq
   738	 * @dev:	device for which we do this operation
   739	 * @freq:	Start level
   740	 *
   741	 * Search for the matching floor *available* OPP from a starting level
   742	 * for a device.
   743	 *
   744	 * Return: matching *opp and refreshes *level accordingly, else returns
   745	 * ERR_PTR in case of error and should be handled using IS_ERR. Error return
   746	 * values can be:
   747	 * EINVAL:	for bad pointer
   748	 * ERANGE:	no match found for search
   749	 * ENODEV:	if device not found in list of registered devices
   750	 *
   751	 * The callers are required to call dev_pm_opp_put() for the returned OPP after
   752	 * use.
   753	 */
   754	struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
   755						      unsigned long *level)
 > 756	{
   757		return _find_key_floor(dev, level, 0, true, _read_level, NULL);
   758	}
   759	EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_floor);
   760
kernel test robot Aug. 22, 2023, 11:42 p.m. UTC | #3
Hi Krishna,

kernel test robot noticed the following build errors:

[auto build test ERROR on pci/for-linus]
[also build test ERROR on robh/for-next rafael-pm/linux-next linus/master v6.5-rc7 next-20230822]
[cannot apply to pci/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krishna-chaitanya-chundru/dt-bindings-pci-qcom-Add-opp-table/20230822-232104
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git for-linus
patch link:    https://lore.kernel.org/r/1692717141-32743-4-git-send-email-quic_krichai%40quicinc.com
patch subject: [PATCH v4 3/4] OPP: Add api to retrieve opps which is at most the provided level
config: um-allnoconfig (https://download.01.org/0day-ci/archive/20230823/202308230750.JgHxIvTb-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230823/202308230750.JgHxIvTb-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308230750.JgHxIvTb-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from kernel/cpu.c:13:
   In file included from include/linux/sched/isolation.h:6:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:22:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     547 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from kernel/cpu.c:13:
   In file included from include/linux/sched/isolation.h:6:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:22:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from kernel/cpu.c:13:
   In file included from include/linux/sched/isolation.h:6:
   In file included from include/linux/tick.h:8:
   In file included from include/linux/clockchips.h:14:
   In file included from include/linux/clocksource.h:22:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     584 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     692 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     700 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     708 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     717 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     726 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     735 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   In file included from kernel/cpu.c:41:
   In file included from include/trace/events/power.h:8:
   In file included from include/linux/cpufreq.h:18:
>> include/linux/pm_opp.h:289:34: error: expected ';' after top level declarator
     289 |                                         unsigned int *bw, int index)
         |                                                                     ^
         |                                                                     ;
   12 warnings and 1 error generated.
--
   In file included from drivers/base/core.c:12:
   In file included from include/linux/cpufreq.h:18:
>> include/linux/pm_opp.h:289:34: error: expected ';' after top level declarator
     289 |                                         unsigned int *bw, int index)
         |                                                                     ^
         |                                                                     ;
   In file included from drivers/base/core.c:25:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:5:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:97:11: warning: array index 3 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      97 |                 return (set->sig[3] | set->sig[2] |
         |                         ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/base/core.c:25:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:5:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:97:25: warning: array index 2 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      97 |                 return (set->sig[3] | set->sig[2] |
         |                                       ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/base/core.c:25:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:5:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:98:4: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      98 |                         set->sig[1] | set->sig[0]) == 0;
         |                         ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/base/core.c:25:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:5:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:100:11: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
     100 |                 return (set->sig[1] | set->sig[0]) == 0;
         |                         ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/base/core.c:25:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:5:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:113:11: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     113 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/base/core.c:25:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:5:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:113:27: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     113 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from drivers/base/core.c:25:
   In file included from include/linux/blkdev.h:9:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:5:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
--
   In file included from kernel/power/qos.c:40:
   In file included from include/trace/events/power.h:8:
   In file included from include/linux/cpufreq.h:18:
>> include/linux/pm_opp.h:289:34: error: expected ';' after top level declarator
     289 |                                         unsigned int *bw, int index)
         |                                                                     ^
         |                                                                     ;
   In file included from kernel/power/qos.c:40:
   In file included from include/trace/events/power.h:12:
   In file included from include/linux/trace_events.h:9:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     547 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from kernel/power/qos.c:40:
   In file included from include/trace/events/power.h:12:
   In file included from include/linux/trace_events.h:9:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from kernel/power/qos.c:40:
   In file included from include/trace/events/power.h:12:
   In file included from include/linux/trace_events.h:9:
   In file included from include/linux/hardirq.h:11:
   In file included from arch/um/include/asm/hardirq.h:5:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/um/include/asm/io.h:24:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     584 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     692 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     700 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     708 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     717 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     726 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     735 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   12 warnings and 1 error generated.
--
   In file included from fs/proc/cpuinfo.c:2:
   In file included from include/linux/cpufreq.h:18:
>> include/linux/pm_opp.h:289:34: error: expected ';' after top level declarator
     289 |                                         unsigned int *bw, int index)
         |                                                                     ^
         |                                                                     ;
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:97:11: warning: array index 3 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      97 |                 return (set->sig[3] | set->sig[2] |
         |                         ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:97:25: warning: array index 2 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      97 |                 return (set->sig[3] | set->sig[2] |
         |                                       ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:98:4: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
      98 |                         set->sig[1] | set->sig[0]) == 0;
         |                         ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:100:11: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
     100 |                 return (set->sig[1] | set->sig[0]) == 0;
         |                         ^        ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:113:11: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     113 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:113:27: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     113 |                 return  (set1->sig[3] == set2->sig[3]) &&
         |                                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:114:5: warning: array index 2 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     114 |                         (set1->sig[2] == set2->sig[2]) &&
         |                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:114:21: warning: array index 2 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     114 |                         (set1->sig[2] == set2->sig[2]) &&
         |                                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
      24 |         unsigned long sig[_NSIG_WORDS];
         |         ^
   In file included from fs/proc/cpuinfo.c:3:
   In file included from include/linux/fs.h:33:
   In file included from include/linux/percpu-rwsem.h:7:
   In file included from include/linux/rcuwait.h:6:
   In file included from include/linux/sched/signal.h:6:
   include/linux/signal.h:115:5: warning: array index 1 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
     115 |                         (set1->sig[1] == set2->sig[1]) &&
         |                          ^         ~
   arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
..


vim +289 include/linux/pm_opp.h

00ce3873f730fb Krzysztof Kozlowski       2022-05-04  287  
00ce3873f730fb Krzysztof Kozlowski       2022-05-04  288  static inline struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
00ce3873f730fb Krzysztof Kozlowski       2022-05-04 @289  					unsigned int *bw, int index)
f220ddccf1afc8 Krishna chaitanya chundru 2023-08-22  290  static inline struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
f220ddccf1afc8 Krishna chaitanya chundru 2023-08-22  291  					unsigned long *level)
00ce3873f730fb Krzysztof Kozlowski       2022-05-04  292  {
00ce3873f730fb Krzysztof Kozlowski       2022-05-04  293  	return ERR_PTR(-EOPNOTSUPP);
00ce3873f730fb Krzysztof Kozlowski       2022-05-04  294  }
00ce3873f730fb Krzysztof Kozlowski       2022-05-04  295
kernel test robot Aug. 23, 2023, 12:48 a.m. UTC | #4
Hi Krishna,

kernel test robot noticed the following build warnings:

[auto build test WARNING on pci/for-linus]
[also build test WARNING on robh/for-next rafael-pm/linux-next linus/master v6.5-rc7 next-20230822]
[cannot apply to pci/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krishna-chaitanya-chundru/dt-bindings-pci-qcom-Add-opp-table/20230822-232104
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git for-linus
patch link:    https://lore.kernel.org/r/1692717141-32743-4-git-send-email-quic_krichai%40quicinc.com
patch subject: [PATCH v4 3/4] OPP: Add api to retrieve opps which is at most the provided level
config: um-defconfig (https://download.01.org/0day-ci/archive/20230823/202308230848.SzyPhc6B-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230823/202308230848.SzyPhc6B-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308230848.SzyPhc6B-lkp@intel.com/

All warnings (new ones prefixed by >>):

         | ^
   include/linux/unaligned/packed_struct.h:17:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      17 | {
         | ^
   include/linux/unaligned/packed_struct.h:23:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      23 | {
         | ^
   include/linux/unaligned/packed_struct.h:29:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      29 | {
         | ^
   include/linux/unaligned/packed_struct.h:35:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      35 | {
         | ^
   include/linux/unaligned/packed_struct.h:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      41 | {
         | ^
   include/asm-generic/unaligned.h:26:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      26 | {
         | ^
   include/asm-generic/unaligned.h:31:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      31 | {
         | ^
   include/asm-generic/unaligned.h:36:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      36 | {
         | ^
   include/asm-generic/unaligned.h:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      41 | {
         | ^
   include/asm-generic/unaligned.h:46:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      46 | {
         | ^
   include/asm-generic/unaligned.h:51:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      51 | {
         | ^
   include/asm-generic/unaligned.h:56:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      56 | {
         | ^
   include/asm-generic/unaligned.h:61:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      61 | {
         | ^
   include/asm-generic/unaligned.h:66:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      66 | {
         | ^
   include/asm-generic/unaligned.h:71:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      71 | {
         | ^
   include/asm-generic/unaligned.h:76:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      76 | {
         | ^
   include/asm-generic/unaligned.h:81:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      81 | {
         | ^
   include/asm-generic/unaligned.h:86:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 | {
         | ^
   include/asm-generic/unaligned.h:91:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      91 | {
         | ^
   include/asm-generic/unaligned.h:96:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      96 | {
         | ^
   include/asm-generic/unaligned.h:101:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     101 | {
         | ^
   include/asm-generic/unaligned.h:106:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     106 | {
         | ^
   include/asm-generic/unaligned.h:113:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     113 | {
         | ^
   include/asm-generic/unaligned.h:118:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     118 | {
         | ^
   include/asm-generic/unaligned.h:125:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     125 | {
         | ^
   include/asm-generic/unaligned.h:130:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     130 | {
         | ^
   include/asm-generic/unaligned.h:140:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     140 | {
         | ^
   include/asm-generic/unaligned.h:145:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     145 | {
         | ^
   include/asm-generic/unaligned.h:151:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     151 | {
         | ^
   arch/um/include/asm/uaccess.h:25:22: error: storage class specified for parameter 'raw_copy_from_user'
      25 | extern unsigned long raw_copy_from_user(void *to, const void __user *from, unsigned long n);
         |                      ^~~~~~~~~~~~~~~~~~
   arch/um/include/asm/uaccess.h:26:22: error: storage class specified for parameter 'raw_copy_to_user'
      26 | extern unsigned long raw_copy_to_user(void __user *to, const void *from, unsigned long n);
         |                      ^~~~~~~~~~~~~~~~
   arch/um/include/asm/uaccess.h:27:22: error: storage class specified for parameter '__clear_user'
      27 | extern unsigned long __clear_user(void __user *mem, unsigned long len);
         |                      ^~~~~~~~~~~~
   arch/um/include/asm/uaccess.h:28:19: error: storage class specified for parameter '__access_ok'
      28 | static inline int __access_ok(const void __user *ptr, unsigned long size);
         |                   ^~~~~~~~~~~
>> arch/um/include/asm/uaccess.h:28:19: warning: parameter '__access_ok' declared 'inline'
>> arch/um/include/asm/uaccess.h:28:1: warning: 'gnu_inline' attribute ignored [-Wattributes]
      28 | static inline int __access_ok(const void __user *ptr, unsigned long size);
         | ^~~~~~
   arch/um/include/asm/uaccess.h:28:19: error: 'no_instrument_function' attribute applies only to functions
      28 | static inline int __access_ok(const void __user *ptr, unsigned long size);
         |                   ^~~~~~~~~~~
   In file included from arch/um/include/asm/uaccess.h:37:
   include/asm-generic/uaccess.h:136:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     136 | {
         | ^
   include/asm-generic/uaccess.h:144:12: error: storage class specified for parameter '__put_user_bad'
     144 | extern int __put_user_bad(void) __attribute__((noreturn));
         |            ^~~~~~~~~~~~~~
   include/asm-generic/uaccess.h:197:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     197 | {
         | ^
   include/asm-generic/uaccess.h:205:12: error: storage class specified for parameter '__get_user_bad'
     205 | extern int __get_user_bad(void) __attribute__((noreturn));
         |            ^~~~~~~~~~~~~~
   include/asm-generic/uaccess.h:221:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     221 | {
         | ^
   In file included from ./arch/um/include/generated/asm/extable.h:1,
                    from include/asm-generic/uaccess.h:229:
   include/asm-generic/extable.h:18:1: warning: empty declaration
      18 | struct exception_table_entry
         | ^~~~~~
   include/asm-generic/extable.h:24:1: warning: empty declaration
      24 | struct pt_regs;
         | ^~~~~~
   include/asm-generic/extable.h:25:12: error: storage class specified for parameter 'fixup_exception'
      25 | extern int fixup_exception(struct pt_regs *regs);
         |            ^~~~~~~~~~~~~~~
   In file included from include/linux/compiler_types.h:80,
                    from <command-line>:
   include/linux/compiler_attributes.h:356:41: error: expected declaration specifiers before '__attribute__'
     356 | #define __must_check                    __attribute__((__warn_unused_result__))
         |                                         ^~~~~~~~~~~~~
   include/asm-generic/uaccess.h:231:1: note: in expansion of macro '__must_check'
     231 | __must_check long strncpy_from_user(char *dst, const char __user *src,
         | ^~~~~~~~~~~~
   include/linux/compiler_attributes.h:356:41: error: expected declaration specifiers before '__attribute__'
     356 | #define __must_check                    __attribute__((__warn_unused_result__))
         |                                         ^~~~~~~~~~~~~
   include/asm-generic/uaccess.h:233:1: note: in expansion of macro '__must_check'
     233 | __must_check long strnlen_user(const char __user *src, long n);
         | ^~~~~~~~~~~~
   arch/um/include/asm/uaccess.h:40:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      40 | {
         | ^
   include/linux/uaccess.h:82:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      82 | {
         | ^
   include/linux/uaccess.h:94:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      94 | {
         | ^
   include/linux/uaccess.h:122:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     122 | {
         | ^
   include/linux/uaccess.h:132:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     132 | {
         | ^
   include/linux/uaccess.h:144:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     144 | {
         | ^
   include/linux/uaccess.h:164:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     164 | {
         | ^
   include/linux/uaccess.h:181:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     181 | {
         | ^
   include/linux/uaccess.h:189:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     189 | {
         | ^
   include/linux/uaccess.h:202:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     202 | {
         | ^
   include/linux/uaccess.h:209:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     209 | {
         | ^
   include/linux/uaccess.h:214:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     214 | {
         | ^
   include/linux/uaccess.h:226:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     226 | {
         | ^
   include/linux/uaccess.h:236:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     236 | {
         | ^
   include/linux/uaccess.h:249:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     249 | {
         | ^
   include/linux/uaccess.h:281:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     281 | {
         | ^
   include/linux/uaccess.h:292:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     292 | {
         | ^
   include/linux/uaccess.h:298:25: error: storage class specified for parameter 'check_zeroed_user'
     298 | extern __must_check int check_zeroed_user(const void __user *from, size_t size);
         |                         ^~~~~~~~~~~~~~~~~
--
         | ^
   include/linux/page_ref.h:88:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      88 | {
         | ^
   include/linux/page_ref.h:93:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      93 | {
         | ^
   include/linux/page_ref.h:98:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      98 | {
         | ^
   include/linux/page_ref.h:105:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     105 | {
         | ^
   include/linux/page_ref.h:114:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     114 | {
         | ^
   include/linux/page_ref.h:119:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     119 | {
         | ^
   include/linux/page_ref.h:126:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     126 | {
         | ^
   include/linux/page_ref.h:131:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     131 | {
         | ^
   include/linux/page_ref.h:138:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     138 | {
         | ^
   include/linux/page_ref.h:143:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     143 | {
         | ^
   include/linux/page_ref.h:152:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     152 | {
         | ^
   include/linux/page_ref.h:157:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     157 | {
         | ^
   include/linux/page_ref.h:164:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     164 | {
         | ^
   include/linux/page_ref.h:169:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     169 | {
         | ^
   include/linux/page_ref.h:176:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     176 | {
         | ^
   include/linux/page_ref.h:181:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     181 | {
         | ^
   include/linux/page_ref.h:190:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     190 | {
         | ^
   include/linux/page_ref.h:195:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     195 | {
         | ^
   include/linux/page_ref.h:204:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     204 | {
         | ^
   include/linux/page_ref.h:209:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     209 | {
         | ^
   include/linux/page_ref.h:218:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     218 | {
         | ^
   include/linux/page_ref.h:223:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     223 | {
         | ^
   include/linux/page_ref.h:232:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     232 | {
         | ^
   include/linux/page_ref.h:237:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     237 | {
         | ^
   include/linux/page_ref.h:246:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     246 | {
         | ^
   include/linux/page_ref.h:262:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     262 | {
         | ^
   include/linux/page_ref.h:267:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     267 | {
         | ^
   include/linux/page_ref.h:312:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     312 | {
         | ^
   include/linux/page_ref.h:317:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     317 | {
         | ^
   include/linux/page_ref.h:326:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     326 | {
         | ^
   include/linux/page_ref.h:331:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     331 | {
         | ^
   include/linux/page_ref.h:341:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     341 | {
         | ^
   In file included from arch/um/include/asm/pgtable.h:11,
                    from include/linux/pgtable.h:6,
                    from include/linux/mm.h:29:
>> arch/um/include/asm/fixmap.h:35:1: warning: empty declaration
      35 | enum fixed_addresses {
         | ^~~~
   arch/um/include/asm/fixmap.h:39:13: error: storage class specified for parameter '__set_fixmap'
      39 | extern void __set_fixmap (enum fixed_addresses idx,
         |             ^~~~~~~~~~~~
   In file included from arch/um/include/asm/fixmap.h:54:
   include/asm-generic/fixmap.h:31:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      31 | {
         | ^
   include/asm-generic/fixmap.h:37:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      37 | {
         | ^
   In file included from include/asm-generic/pgtable-nopud.h:7,
                    from arch/um/include/asm/pgtable-3level.h:10,
                    from arch/um/include/asm/pgtable.h:28:
   include/asm-generic/pgtable-nop4d.h:9:31: error: storage class specified for parameter 'p4d_t'
       9 | typedef struct { pgd_t pgd; } p4d_t;
         |                               ^~~~~
   include/asm-generic/pgtable-nop4d.h:21:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      21 | static inline int pgd_none(pgd_t pgd)           { return 0; }
         |                                                 ^
   include/asm-generic/pgtable-nop4d.h:22:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      22 | static inline int pgd_bad(pgd_t pgd)            { return 0; }
         |                                                 ^
   include/asm-generic/pgtable-nop4d.h:23:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      23 | static inline int pgd_present(pgd_t pgd)        { return 1; }
         |                                                 ^
   include/asm-generic/pgtable-nop4d.h:24:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      24 | static inline void pgd_clear(pgd_t *pgd)        { }
         |                                                 ^
   include/asm-generic/pgtable-nop4d.h:35:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
      35 | static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
         |                     ^
   include/asm-generic/pgtable-nopud.h:16:18: error: expected specifier-qualifier-list before 'p4d_t'
      16 | typedef struct { p4d_t p4d; } pud_t;
         |                  ^~~~~
   include/asm-generic/pgtable-nopud.h:16:31: error: storage class specified for parameter 'pud_t'
      16 | typedef struct { p4d_t p4d; } pud_t;
         |                               ^~~~~
   include/asm-generic/pgtable-nopud.h:28:28: error: expected declaration specifiers or '...' before 'p4d_t'
      28 | static inline int p4d_none(p4d_t p4d)           { return 0; }
         |                            ^~~~~
   include/asm-generic/pgtable-nopud.h:29:27: error: expected declaration specifiers or '...' before 'p4d_t'
      29 | static inline int p4d_bad(p4d_t p4d)            { return 0; }
         |                           ^~~~~
   include/asm-generic/pgtable-nopud.h:30:31: error: expected declaration specifiers or '...' before 'p4d_t'
      30 | static inline int p4d_present(p4d_t p4d)        { return 1; }
         |                               ^~~~~
   include/asm-generic/pgtable-nopud.h:31:30: error: expected declaration specifiers or '...' before 'p4d_t'
      31 | static inline void p4d_clear(p4d_t *p4d)        { }
         |                              ^~~~~
   include/asm-generic/pgtable-nopud.h:42:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
      42 | static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
         |                     ^
   arch/um/include/asm/pgtable-3level.h:64:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      64 | {
         | ^
   arch/um/include/asm/pgtable-3level.h:68:46: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      68 | static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; }
         |                                              ^
   arch/um/include/asm/pgtable-3level.h:72:31: error: expected declaration specifiers or '...' before 'pud_t'
      72 | static inline void pud_clear (pud_t *pud)
         |                               ^~~~~
   arch/um/include/asm/pgtable-3level.h:81:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      81 | {
         | ^
   arch/um/include/asm/pgtable-3level.h:86:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 | {
         | ^
   arch/um/include/asm/pgtable-3level.h:95:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      95 | {
         | ^
   arch/um/include/asm/pgtable.h:33:14: error: storage class specified for parameter 'swapper_pg_dir'
      33 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD];
         |              ^~~~~~~~~~~~~~
   arch/um/include/asm/pgtable.h:36:23: error: storage class specified for parameter 'empty_zero_page'
      36 | extern unsigned long *empty_zero_page;
         |                       ^~~~~~~~~~~~~~~
   arch/um/include/asm/pgtable.h:46:22: error: storage class specified for parameter 'end_iomem'
      46 | extern unsigned long end_iomem;
         |                      ^~~~~~~~~
   arch/um/include/asm/pgtable.h:112:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     112 | {
         | ^
   arch/um/include/asm/pgtable.h:121:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     121 | {
         | ^
   arch/um/include/asm/pgtable.h:126:38: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     126 | static inline int pte_exec(pte_t pte){
         |                                      ^
   arch/um/include/asm/pgtable.h:132:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     132 | {
         | ^
   arch/um/include/asm/pgtable.h:138:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     138 | {
         | ^
   arch/um/include/asm/pgtable.h:143:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     143 | {
         | ^
   arch/um/include/asm/pgtable.h:148:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     148 | {
         | ^
   arch/um/include/asm/pgtable.h:153:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     153 | {
         | ^
   arch/um/include/asm/pgtable.h:164:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     164 | {
         | ^
   arch/um/include/asm/pgtable.h:170:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     170 | {
         | ^
   arch/um/include/asm/pgtable.h:176:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     176 | {
         | ^
   arch/um/include/asm/pgtable.h:182:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     182 | {
         | ^
   arch/um/include/asm/pgtable.h:191:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     191 | {
         | ^
   arch/um/include/asm/pgtable.h:199:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     199 | {
         | ^
   arch/um/include/asm/pgtable.h:205:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     205 | {
         | ^
   arch/um/include/asm/pgtable.h:211:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     211 | {
         | ^
   arch/um/include/asm/pgtable.h:219:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     219 | {
         | ^
   arch/um/include/asm/pgtable.h:227:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     227 | {
         | ^
   arch/um/include/asm/pgtable.h:233:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     233 | {
         | ^
   arch/um/include/asm/pgtable.h:247:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     247 | {
         | ^
   arch/um/include/asm/pgtable.h:253:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     253 | {
         | ^
   arch/um/include/asm/pgtable.h:276:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     276 | {
         | ^
>> arch/um/include/asm/pgtable.h:289:1: warning: empty declaration
     289 | struct mm_struct;
         | ^~~~~~
   arch/um/include/asm/pgtable.h:290:15: error: storage class specified for parameter 'virt_to_pte'
     290 | extern pte_t *virt_to_pte(struct mm_struct *mm, unsigned long addr);
         |               ^~~~~~~~~~~
   arch/um/include/asm/pgtable.h:317:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     317 | {
         | ^
   arch/um/include/asm/pgtable.h:322:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     322 | {
         | ^
   arch/um/include/asm/pgtable.h:328:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     328 | {
         | ^
   In file included from include/linux/pgtable.h:14:
   include/asm-generic/pgtable_uffd.h:6:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
       6 | {
         | ^
   include/asm-generic/pgtable_uffd.h:11:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      11 | {
         | ^
   include/asm-generic/pgtable_uffd.h:16:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      16 | {
         | ^
   include/asm-generic/pgtable_uffd.h:21:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      21 | {
         | ^
   include/asm-generic/pgtable_uffd.h:26:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      26 | {
         | ^
   include/asm-generic/pgtable_uffd.h:31:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      31 | {
         | ^
   include/asm-generic/pgtable_uffd.h:36:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      36 | {
         | ^
   include/asm-generic/pgtable_uffd.h:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      41 | {
         | ^
   include/asm-generic/pgtable_uffd.h:46:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      46 | {
         | ^
   include/asm-generic/pgtable_uffd.h:51:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      51 | {
         | ^
   include/asm-generic/pgtable_uffd.h:56:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      56 | {
         | ^
   include/asm-generic/pgtable_uffd.h:61:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      61 | {
         | ^
   In file included from include/linux/pgtable.h:15:
   include/linux/page_table_check.h:119:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     119 | {
         | ^
   include/linux/page_table_check.h:123:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     123 | {
         | ^
   include/linux/page_table_check.h:128:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     128 | {
         | ^
   include/linux/page_table_check.h:133:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     133 | {
         | ^
   include/linux/page_table_check.h:137:67: error: expected declaration specifiers or '...' before 'pud_t'
     137 |                                               unsigned long addr, pud_t pud)
         |                                                                   ^~~~~
   include/linux/page_table_check.h:144:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     144 | {
         | ^
   include/linux/page_table_check.h:150:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     150 | {
         | ^
   include/linux/page_table_check.h:154:65: error: expected declaration specifiers or '...' before 'pud_t'
     154 |                                             unsigned long addr, pud_t *pudp,
         |                                                                 ^~~~~
   include/linux/page_table_check.h:155:45: error: expected declaration specifiers or '...' before 'pud_t'
     155 |                                             pud_t pud)
         |                                             ^~~~~
   include/linux/page_table_check.h:162:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     162 | {
         | ^
   include/linux/pgtable.h:63:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      63 | {
         | ^
   include/linux/pgtable.h:70:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      70 | {
         | ^
   include/linux/pgtable.h:78:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      78 | {
         | ^
   include/linux/pgtable.h:91:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      91 | {
         | ^
   include/linux/pgtable.h:106:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     106 | {
         | ^
   include/linux/pgtable.h:110:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     110 | {
         | ^
..


vim +28 arch/um/include/asm/uaccess.h

^1da177e4c3f41 include/asm-um/uaccess.h      Linus Torvalds     2005-04-16  12  
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  13  #define __under_task_size(addr, size) \
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  14  	(((unsigned long) (addr) < TASK_SIZE) && \
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  15  	 (((unsigned long) (addr) + (size)) < TASK_SIZE))
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  16  
f8d65d27e677da arch/um/include/asm/uaccess.h Richard Weinberger 2015-05-12  17  #define __access_ok_vsyscall(addr, size) \
f8d65d27e677da arch/um/include/asm/uaccess.h Richard Weinberger 2015-05-12  18  	  (((unsigned long) (addr) >= FIXADDR_USER_START) && \
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  19  	  ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  20  	  ((unsigned long) (addr) + (size) >= (unsigned long)(addr)))
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  21  
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  22  #define __addr_range_nowrap(addr, size) \
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  23  	((unsigned long) (addr) <= ((unsigned long) (addr) + (size)))
fced95cacfc21b arch/um/include/asm/uaccess.h Al Viro            2011-08-18  24  
a668ce3a001fe0 arch/um/include/asm/uaccess.h Al Viro            2017-03-28  25  extern unsigned long raw_copy_from_user(void *to, const void __user *from, unsigned long n);
a668ce3a001fe0 arch/um/include/asm/uaccess.h Al Viro            2017-03-28 @26  extern unsigned long raw_copy_to_user(void __user *to, const void *from, unsigned long n);
f8d65d27e677da arch/um/include/asm/uaccess.h Richard Weinberger 2015-05-12 @27  extern unsigned long __clear_user(void __user *mem, unsigned long len);
12700c17fc2861 arch/um/include/asm/uaccess.h Arnd Bergmann      2022-02-15 @28  static inline int __access_ok(const void __user *ptr, unsigned long size);
f8d65d27e677da arch/um/include/asm/uaccess.h Richard Weinberger 2015-05-12  29
Pavan Kondeti Aug. 23, 2023, 1:05 a.m. UTC | #5
On Tue, Aug 22, 2023 at 08:42:20PM +0530, Krishna chaitanya chundru wrote:
> Add dev_pm_opp_find_level_floor() for searching a lesser match or
> operating on OPP in the order of decreasing level.
> 

"OPP: Add api to retrieve opps which is at most the provided level". Pls
change this to "opp: Add dev_pm_opp_find_level_floor()". The API name
conveys the message.

In the description, you can give a use case. i.e voting for the max
level during initialization of a driver.


> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
> ---
>  drivers/opp/core.c     | 26 ++++++++++++++++++++++++++
>  include/linux/pm_opp.h |  4 ++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 954c948..e668cf2 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -727,6 +727,32 @@ struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
>  }
>  EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_ceil);
>  
> +
> +/**
> + * dev_pm_opp_find_level_floor() - Search for a rounded floor freq
> + * @dev:	device for which we do this operation
> + * @freq:	Start level
> + *

%s/freq/level

Run make W=1 so that kerneldoc is tested.

> + * Search for the matching floor *available* OPP from a starting level
> + * for a device.
> + *
> + * Return: matching *opp and refreshes *level accordingly, else returns
> + * ERR_PTR in case of error and should be handled using IS_ERR. Error return
> + * values can be:

What do you mean by refresh here?

> + * EINVAL:	for bad pointer
> + * ERANGE:	no match found for search
> + * ENODEV:	if device not found in list of registered devices
> + *
> + * The callers are required to call dev_pm_opp_put() for the returned OPP after
> + * use.
> + */
> +struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
> +					      unsigned long *level)
> +{
> +	return _find_key_floor(dev, level, 0, true, _read_level, NULL);
> +}
> +EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_floor);
> +
>  /**
>   * dev_pm_opp_find_bw_ceil() - Search for a rounded ceil bandwidth
>   * @dev:	device for which we do this operation
> diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
> index dc1fb58..a3bc386 100644
> --- a/include/linux/pm_opp.h
> +++ b/include/linux/pm_opp.h
> @@ -128,6 +128,8 @@ struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
>  					       unsigned int level);
>  struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
>  					      unsigned int *level);
> +struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
> +					      unsigned long *level);
>  
>  struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
>  					     unsigned long *freq);
> @@ -285,6 +287,8 @@ static inline struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev,
>  
>  static inline struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
>  					unsigned int *bw, int index)
> +static inline struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
> +					unsigned long *level)
>  {
>  	return ERR_PTR(-EOPNOTSUPP);
>  }
> 
Please run ./scripts/checkpatch.pl --strict <your patch> and fix the
indentation warnings from this patch.

Thanks,
Pavan
kernel test robot Aug. 23, 2023, 1:13 a.m. UTC | #6
Hi Krishna,

kernel test robot noticed the following build errors:

[auto build test ERROR on pci/for-linus]
[also build test ERROR on robh/for-next rafael-pm/linux-next linus/master v6.5-rc7 next-20230822]
[cannot apply to pci/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Krishna-chaitanya-chundru/dt-bindings-pci-qcom-Add-opp-table/20230822-232104
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git for-linus
patch link:    https://lore.kernel.org/r/1692717141-32743-4-git-send-email-quic_krichai%40quicinc.com
patch subject: [PATCH v4 3/4] OPP: Add api to retrieve opps which is at most the provided level
config: arc-allnoconfig (https://download.01.org/0day-ci/archive/20230823/202308230954.jyXY61U7-lkp@intel.com/config)
compiler: arc-elf-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230823/202308230954.jyXY61U7-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308230954.jyXY61U7-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

     263 | {
         | ^
   include/linux/signal.h:268:13: error: storage class specified for parameter 'flush_sigqueue'
     268 | extern void flush_sigqueue(struct sigpending *queue);
         |             ^~~~~~~~~~~~~~
   include/linux/signal.h:272:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     272 | {
         | ^
   include/linux/signal.h:276:1: warning: empty declaration
     276 | struct timespec;
         | ^~~~~~
   include/linux/signal.h:277:1: warning: empty declaration
     277 | struct pt_regs;
         | ^~~~~~
   include/linux/signal.h:278:1: warning: empty declaration
     278 | enum pid_type;
         | ^~~~
   include/linux/signal.h:280:12: error: storage class specified for parameter 'next_signal'
     280 | extern int next_signal(struct sigpending *pending, sigset_t *mask);
         |            ^~~~~~~~~~~
   include/linux/signal.h:281:12: error: storage class specified for parameter 'do_send_sig_info'
     281 | extern int do_send_sig_info(int sig, struct kernel_siginfo *info,
         |            ^~~~~~~~~~~~~~~~
   include/linux/signal.h:283:12: error: storage class specified for parameter 'group_send_sig_info'
     283 | extern int group_send_sig_info(int sig, struct kernel_siginfo *info,
         |            ^~~~~~~~~~~~~~~~~~~
   include/linux/signal.h:285:12: error: storage class specified for parameter 'send_signal_locked'
     285 | extern int send_signal_locked(int sig, struct kernel_siginfo *info,
         |            ^~~~~~~~~~~~~~~~~~
   include/linux/signal.h:287:12: error: storage class specified for parameter 'sigprocmask'
     287 | extern int sigprocmask(int, sigset_t *, sigset_t *);
         |            ^~~~~~~~~~~
   include/linux/signal.h:288:13: error: storage class specified for parameter 'set_current_blocked'
     288 | extern void set_current_blocked(sigset_t *);
         |             ^~~~~~~~~~~~~~~~~~~
   include/linux/signal.h:289:13: error: storage class specified for parameter '__set_current_blocked'
     289 | extern void __set_current_blocked(const sigset_t *);
         |             ^~~~~~~~~~~~~~~~~~~~~
   include/linux/signal.h:290:12: error: storage class specified for parameter 'show_unhandled_signals'
     290 | extern int show_unhandled_signals;
         |            ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/signal.h:292:13: error: storage class specified for parameter 'get_signal'
     292 | extern bool get_signal(struct ksignal *ksig);
         |             ^~~~~~~~~~
   include/linux/signal.h:293:13: error: storage class specified for parameter 'signal_setup_done'
     293 | extern void signal_setup_done(int failed, struct ksignal *ksig, int stepping);
         |             ^~~~~~~~~~~~~~~~~
   include/linux/signal.h:294:13: error: storage class specified for parameter 'exit_signals'
     294 | extern void exit_signals(struct task_struct *tsk);
         |             ^~~~~~~~~~~~
   include/linux/signal.h:295:13: error: storage class specified for parameter 'kernel_sigaction'
     295 | extern void kernel_sigaction(int, __sighandler_t);
         |             ^~~~~~~~~~~~~~~~
   include/linux/signal.h:301:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     301 | {
         | ^
   include/linux/signal.h:311:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     311 | {
         | ^
   include/linux/signal.h:321:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     321 | {
         | ^
   include/linux/signal.h:325:27: error: storage class specified for parameter 'sighand_cachep'
     325 | extern struct kmem_cache *sighand_cachep;
         |                           ^~~~~~~~~~~~~~
   include/linux/signal.h:327:13: error: storage class specified for parameter 'unhandled_signal'
     327 | extern bool unhandled_signal(struct task_struct *tsk, int sig);
         |             ^~~~~~~~~~~~~~~~
   include/linux/signal.h:470:56: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     470 | static inline bool sigaltstack_size_valid(size_t size) { return true; }
         |                                                        ^
   include/linux/signal.h:474:1: warning: empty declaration
     474 | struct seq_file;
         | ^~~~~~
   include/linux/signal.h:475:13: error: storage class specified for parameter 'render_sigset_t'
     475 | extern void render_sigset_t(struct seq_file *, const char *, sigset_t *);
         |             ^~~~~~~~~~~~~~~
   include/linux/signal.h:487:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     487 | {
         | ^
   In file included from include/linux/sched/signal.h:8:
   include/linux/sched/jobctl.h:7:1: warning: empty declaration
       7 | struct task_struct;
         | ^~~~~~
   include/linux/sched/jobctl.h:43:13: error: storage class specified for parameter 'task_set_jobctl_pending'
      43 | extern bool task_set_jobctl_pending(struct task_struct *task, unsigned long mask);
         |             ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/sched/jobctl.h:44:13: error: storage class specified for parameter 'task_clear_jobctl_trapping'
      44 | extern void task_clear_jobctl_trapping(struct task_struct *task);
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/sched/jobctl.h:45:13: error: storage class specified for parameter 'task_clear_jobctl_pending'
      45 | extern void task_clear_jobctl_pending(struct task_struct *task, unsigned long mask);
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/uaccess.h:5,
                    from include/linux/sched/task.h:11,
                    from include/linux/sched/signal.h:9:
   include/linux/fault-inject-usercopy.h:18:47: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      18 | static inline bool should_fail_usercopy(void) { return false; }
         |                                               ^
   In file included from include/linux/uaccess.h:11:
>> arch/arc/include/asm/uaccess.h:140:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     140 | {
         | ^
   arch/arc/include/asm/uaccess.h:367:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     367 | {
         | ^
   arch/arc/include/asm/uaccess.h:588:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     588 | {
         | ^
   In file included from include/asm-generic/uaccess.h:11,
                    from arch/arc/include/asm/uaccess.h:641:
   include/asm-generic/access_ok.h:32:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      32 | {
         | ^
   include/asm-generic/uaccess.h:144:12: error: storage class specified for parameter '__put_user_bad'
     144 | extern int __put_user_bad(void) __attribute__((noreturn));
         |            ^~~~~~~~~~~~~~
   include/asm-generic/uaccess.h:205:12: error: storage class specified for parameter '__get_user_bad'
     205 | extern int __get_user_bad(void) __attribute__((noreturn));
         |            ^~~~~~~~~~~~~~
   include/asm-generic/uaccess.h:221:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     221 | {
         | ^
   In file included from ./arch/arc/include/generated/asm/extable.h:1,
                    from include/asm-generic/uaccess.h:229:
   include/asm-generic/extable.h:18:1: warning: empty declaration
      18 | struct exception_table_entry
         | ^~~~~~
   include/asm-generic/extable.h:24:1: warning: empty declaration
      24 | struct pt_regs;
         | ^~~~~~
   include/asm-generic/extable.h:25:12: error: storage class specified for parameter 'fixup_exception'
      25 | extern int fixup_exception(struct pt_regs *regs);
         |            ^~~~~~~~~~~~~~~
   In file included from include/linux/compiler_types.h:80,
                    from <command-line>:
   include/linux/compiler_attributes.h:356:41: error: expected declaration specifiers before '__attribute__'
     356 | #define __must_check                    __attribute__((__warn_unused_result__))
         |                                         ^~~~~~~~~~~~~
   include/asm-generic/uaccess.h:231:1: note: in expansion of macro '__must_check'
     231 | __must_check long strncpy_from_user(char *dst, const char __user *src,
         | ^~~~~~~~~~~~
   include/linux/compiler_attributes.h:356:41: error: expected declaration specifiers before '__attribute__'
     356 | #define __must_check                    __attribute__((__warn_unused_result__))
         |                                         ^~~~~~~~~~~~~
   include/asm-generic/uaccess.h:233:1: note: in expansion of macro '__must_check'
     233 | __must_check long strnlen_user(const char __user *src, long n);
         | ^~~~~~~~~~~~
   include/linux/uaccess.h:82:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      82 | {
         | ^
   include/linux/uaccess.h:94:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      94 | {
         | ^
   include/linux/uaccess.h:122:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     122 | {
         | ^
   include/linux/uaccess.h:132:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     132 | {
         | ^
   include/linux/uaccess.h:144:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     144 | {
         | ^
   include/linux/uaccess.h:164:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     164 | {
         | ^
   include/linux/uaccess.h:181:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     181 | {
         | ^
   include/linux/uaccess.h:189:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     189 | {
         | ^
   include/linux/uaccess.h:202:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     202 | {
         | ^
   include/linux/uaccess.h:209:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     209 | {
         | ^
   include/linux/uaccess.h:214:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     214 | {
         | ^
   include/linux/uaccess.h:226:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     226 | {
         | ^
   include/linux/uaccess.h:236:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     236 | {
         | ^
   include/linux/uaccess.h:249:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     249 | {
         | ^
   include/linux/uaccess.h:281:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     281 | {
         | ^
   include/linux/uaccess.h:292:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     292 | {
         | ^
   include/linux/uaccess.h:298:25: error: storage class specified for parameter 'check_zeroed_user'
     298 | extern __must_check int check_zeroed_user(const void __user *from, size_t size);
         |                         ^~~~~~~~~~~~~~~~~
   include/linux/uaccess.h:350:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     350 | {
--
   include/linux/page_ref.h:262:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     262 | {
         | ^
   include/linux/page_ref.h:267:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     267 | {
         | ^
   include/linux/page_ref.h:312:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     312 | {
         | ^
   include/linux/page_ref.h:317:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     317 | {
         | ^
   include/linux/page_ref.h:326:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     326 | {
         | ^
   include/linux/page_ref.h:331:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     331 | {
         | ^
   include/linux/page_ref.h:341:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     341 | {
         | ^
   In file included from include/asm-generic/pgtable-nopud.h:7,
                    from include/asm-generic/pgtable-nopmd.h:7,
                    from arch/arc/include/asm/pgtable-levels.h:95,
                    from arch/arc/include/asm/pgtable.h:11,
                    from include/linux/pgtable.h:6,
                    from include/linux/mm.h:29:
   include/asm-generic/pgtable-nop4d.h:9:31: error: storage class specified for parameter 'p4d_t'
       9 | typedef struct { pgd_t pgd; } p4d_t;
         |                               ^~~~~
   include/asm-generic/pgtable-nop4d.h:21:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      21 | static inline int pgd_none(pgd_t pgd)           { return 0; }
         |                                                 ^
   include/asm-generic/pgtable-nop4d.h:22:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      22 | static inline int pgd_bad(pgd_t pgd)            { return 0; }
         |                                                 ^
   include/asm-generic/pgtable-nop4d.h:23:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      23 | static inline int pgd_present(pgd_t pgd)        { return 1; }
         |                                                 ^
   include/asm-generic/pgtable-nop4d.h:24:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      24 | static inline void pgd_clear(pgd_t *pgd)        { }
         |                                                 ^
   include/asm-generic/pgtable-nop4d.h:35:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
      35 | static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
         |                     ^
   include/asm-generic/pgtable-nopud.h:16:18: error: expected specifier-qualifier-list before 'p4d_t'
      16 | typedef struct { p4d_t p4d; } pud_t;
         |                  ^~~~~
   include/asm-generic/pgtable-nopud.h:16:31: error: storage class specified for parameter 'pud_t'
      16 | typedef struct { p4d_t p4d; } pud_t;
         |                               ^~~~~
   include/asm-generic/pgtable-nopud.h:28:28: error: expected declaration specifiers or '...' before 'p4d_t'
      28 | static inline int p4d_none(p4d_t p4d)           { return 0; }
         |                            ^~~~~
   include/asm-generic/pgtable-nopud.h:29:27: error: expected declaration specifiers or '...' before 'p4d_t'
      29 | static inline int p4d_bad(p4d_t p4d)            { return 0; }
         |                           ^~~~~
   include/asm-generic/pgtable-nopud.h:30:31: error: expected declaration specifiers or '...' before 'p4d_t'
      30 | static inline int p4d_present(p4d_t p4d)        { return 1; }
         |                               ^~~~~
   include/asm-generic/pgtable-nopud.h:31:30: error: expected declaration specifiers or '...' before 'p4d_t'
      31 | static inline void p4d_clear(p4d_t *p4d)        { }
         |                              ^~~~~
   include/asm-generic/pgtable-nopud.h:42:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
      42 | static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address)
         |                     ^
   include/asm-generic/pgtable-nopmd.h:9:1: warning: empty declaration
       9 | struct mm_struct;
         | ^~~~~~
   include/asm-generic/pgtable-nopmd.h:18:18: error: expected specifier-qualifier-list before 'pud_t'
      18 | typedef struct { pud_t pud; } pmd_t;
         |                  ^~~~~
   include/asm-generic/pgtable-nopmd.h:18:31: error: storage class specified for parameter 'pmd_t'
      18 | typedef struct { pud_t pud; } pmd_t;
         |                               ^~~~~
   include/asm-generic/pgtable-nopmd.h:30:28: error: expected declaration specifiers or '...' before 'pud_t'
      30 | static inline int pud_none(pud_t pud)           { return 0; }
         |                            ^~~~~
   include/asm-generic/pgtable-nopmd.h:31:27: error: expected declaration specifiers or '...' before 'pud_t'
      31 | static inline int pud_bad(pud_t pud)            { return 0; }
         |                           ^~~~~
   include/asm-generic/pgtable-nopmd.h:32:31: error: expected declaration specifiers or '...' before 'pud_t'
      32 | static inline int pud_present(pud_t pud)        { return 1; }
         |                               ^~~~~
   include/asm-generic/pgtable-nopmd.h:33:28: error: expected declaration specifiers or '...' before 'pud_t'
      33 | static inline int pud_user(pud_t pud)           { return 0; }
         |                            ^~~~~
   include/asm-generic/pgtable-nopmd.h:34:28: error: expected declaration specifiers or '...' before 'pud_t'
      34 | static inline int pud_leaf(pud_t pud)           { return 0; }
         |                            ^~~~~
   include/asm-generic/pgtable-nopmd.h:35:30: error: expected declaration specifiers or '...' before 'pud_t'
      35 | static inline void pud_clear(pud_t *pud)        { }
         |                              ^~~~~
   include/asm-generic/pgtable-nopmd.h:46:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
      46 | static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address)
         |                     ^
   include/asm-generic/pgtable-nopmd.h:63:51: error: expected declaration specifiers or '...' before 'pmd_t'
      63 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
         |                                                   ^~~~~
   In file included from arch/arc/include/asm/pgtable.h:12:
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:88:1: note: in expansion of macro 'PTE_BIT_FUNC'
      88 | PTE_BIT_FUNC(mknotpresent,     &= ~(_PAGE_PRESENT));
         | ^~~~~~~~~~~~
>> arch/arc/include/asm/pgtable-bits-arcv2.h:88:52: error: expected declaration specifiers before ';' token
      88 | PTE_BIT_FUNC(mknotpresent,     &= ~(_PAGE_PRESENT));
         |                                                    ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:89:1: note: in expansion of macro 'PTE_BIT_FUNC'
      89 | PTE_BIT_FUNC(wrprotect, &= ~(_PAGE_WRITE));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:89:43: error: expected declaration specifiers before ';' token
      89 | PTE_BIT_FUNC(wrprotect, &= ~(_PAGE_WRITE));
         |                                           ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:90:1: note: in expansion of macro 'PTE_BIT_FUNC'
      90 | PTE_BIT_FUNC(mkwrite,   |= (_PAGE_WRITE));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:90:42: error: expected declaration specifiers before ';' token
      90 | PTE_BIT_FUNC(mkwrite,   |= (_PAGE_WRITE));
         |                                          ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:91:1: note: in expansion of macro 'PTE_BIT_FUNC'
      91 | PTE_BIT_FUNC(mkclean,   &= ~(_PAGE_DIRTY));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:91:43: error: expected declaration specifiers before ';' token
      91 | PTE_BIT_FUNC(mkclean,   &= ~(_PAGE_DIRTY));
         |                                           ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:92:1: note: in expansion of macro 'PTE_BIT_FUNC'
      92 | PTE_BIT_FUNC(mkdirty,   |= (_PAGE_DIRTY));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:92:42: error: expected declaration specifiers before ';' token
      92 | PTE_BIT_FUNC(mkdirty,   |= (_PAGE_DIRTY));
         |                                          ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:93:1: note: in expansion of macro 'PTE_BIT_FUNC'
      93 | PTE_BIT_FUNC(mkold,     &= ~(_PAGE_ACCESSED));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:93:46: error: expected declaration specifiers before ';' token
      93 | PTE_BIT_FUNC(mkold,     &= ~(_PAGE_ACCESSED));
         |                                              ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:94:1: note: in expansion of macro 'PTE_BIT_FUNC'
      94 | PTE_BIT_FUNC(mkyoung,   |= (_PAGE_ACCESSED));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:94:45: error: expected declaration specifiers before ';' token
      94 | PTE_BIT_FUNC(mkyoung,   |= (_PAGE_ACCESSED));
         |                                             ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:95:1: note: in expansion of macro 'PTE_BIT_FUNC'
      95 | PTE_BIT_FUNC(mkspecial, |= (_PAGE_SPECIAL));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:95:44: error: expected declaration specifiers before ';' token
      95 | PTE_BIT_FUNC(mkspecial, |= (_PAGE_SPECIAL));
         |                                            ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:96:1: note: in expansion of macro 'PTE_BIT_FUNC'
      96 | PTE_BIT_FUNC(mkhuge,    |= (_PAGE_HW_SZ));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:96:42: error: expected declaration specifiers before ';' token
      96 | PTE_BIT_FUNC(mkhuge,    |= (_PAGE_HW_SZ));
         |                                          ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:99:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      99 | {
         | ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:105:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     105 | {
         | ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:136:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     136 | {
         | ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:140:1: note: in expansion of macro 'PTE_BIT_FUNC'
     140 | PTE_BIT_FUNC(swp_mkexclusive, |= (_PAGE_SWP_EXCLUSIVE));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:140:56: error: expected declaration specifiers before ';' token
     140 | PTE_BIT_FUNC(swp_mkexclusive, |= (_PAGE_SWP_EXCLUSIVE));
         |                                                        ^
>> arch/arc/include/asm/pgtable-bits-arcv2.h:86:49: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      86 |         static inline pte_t pte_##fn(pte_t pte) { pte_val(pte) op; return pte; }
         |                                                 ^
   arch/arc/include/asm/pgtable-bits-arcv2.h:141:1: note: in expansion of macro 'PTE_BIT_FUNC'
     141 | PTE_BIT_FUNC(swp_clear_exclusive, &= ~(_PAGE_SWP_EXCLUSIVE));
         | ^~~~~~~~~~~~
   arch/arc/include/asm/pgtable-bits-arcv2.h:141:61: error: expected declaration specifiers before ';' token
     141 | PTE_BIT_FUNC(swp_clear_exclusive, &= ~(_PAGE_SWP_EXCLUSIVE));
         |                                                             ^
>> arch/arc/include/asm/pgtable.h:24:13: error: storage class specified for parameter 'empty_zero_page'
      24 | extern char empty_zero_page[PAGE_SIZE];
         |             ^~~~~~~~~~~~~~~
>> arch/arc/include/asm/pgtable.h:27:14: error: storage class specified for parameter 'swapper_pg_dir'
      27 | extern pgd_t swapper_pg_dir[] __aligned(PAGE_SIZE);
         |              ^~~~~~~~~~~~~~
>> arch/arc/include/asm/pgtable.h:27:14: error: alignment may not be specified for 'swapper_pg_dir'
   In file included from include/linux/pgtable.h:14:
   include/asm-generic/pgtable_uffd.h:6:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
       6 | {
         | ^
   include/asm-generic/pgtable_uffd.h:10:40: error: expected declaration specifiers or '...' before 'pmd_t'
      10 | static __always_inline int pmd_uffd_wp(pmd_t pmd)
         |                                        ^~~~~
   include/asm-generic/pgtable_uffd.h:16:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      16 | {
         | ^
   include/asm-generic/pgtable_uffd.h:20:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pmd_mkuffd_wp'
      20 | static __always_inline pmd_t pmd_mkuffd_wp(pmd_t pmd)
         |                              ^~~~~~~~~~~~~
   include/asm-generic/pgtable_uffd.h:26:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      26 | {
         | ^
   include/asm-generic/pgtable_uffd.h:30:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pmd_clear_uffd_wp'
      30 | static __always_inline pmd_t pmd_clear_uffd_wp(pmd_t pmd)
         |                              ^~~~~~~~~~~~~~~~~
   include/asm-generic/pgtable_uffd.h:36:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      36 | {
         | ^
   include/asm-generic/pgtable_uffd.h:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      41 | {
         | ^
   include/asm-generic/pgtable_uffd.h:46:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      46 | {
         | ^
   include/asm-generic/pgtable_uffd.h:50:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pmd_swp_mkuffd_wp'
      50 | static inline pmd_t pmd_swp_mkuffd_wp(pmd_t pmd)
         |                     ^~~~~~~~~~~~~~~~~
   include/asm-generic/pgtable_uffd.h:55:35: error: expected declaration specifiers or '...' before 'pmd_t'
      55 | static inline int pmd_swp_uffd_wp(pmd_t pmd)
         |                                   ^~~~~
   include/asm-generic/pgtable_uffd.h:60:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pmd_swp_clear_uffd_wp'
      60 | static inline pmd_t pmd_swp_clear_uffd_wp(pmd_t pmd)
         |                     ^~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/pgtable.h:15:
   include/linux/page_table_check.h:119:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     119 | {
         | ^
   include/linux/page_table_check.h:123:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     123 | {
         | ^
   include/linux/page_table_check.h:128:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     128 | {
         | ^
   include/linux/page_table_check.h:132:67: error: expected declaration specifiers or '...' before 'pmd_t'
     132 |                                               unsigned long addr, pmd_t pmd)
         |                                                                   ^~~~~
   include/linux/page_table_check.h:137:67: error: expected declaration specifiers or '...' before 'pud_t'
     137 |                                               unsigned long addr, pud_t pud)
         |                                                                   ^~~~~
   include/linux/page_table_check.h:144:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     144 | {
         | ^
   include/linux/page_table_check.h:148:65: error: expected declaration specifiers or '...' before 'pmd_t'
     148 |                                             unsigned long addr, pmd_t *pmdp,
         |                                                                 ^~~~~
   include/linux/page_table_check.h:149:45: error: expected declaration specifiers or '...' before 'pmd_t'
     149 |                                             pmd_t pmd)
         |                                             ^~~~~
   include/linux/page_table_check.h:154:65: error: expected declaration specifiers or '...' before 'pud_t'
     154 |                                             unsigned long addr, pud_t *pudp,
         |                                                                 ^~~~~
   include/linux/page_table_check.h:155:45: error: expected declaration specifiers or '...' before 'pud_t'
     155 |                                             pud_t pud)
         |                                             ^~~~~
   include/linux/page_table_check.h:161:53: error: expected declaration specifiers or '...' before 'pmd_t'
     161 |                                                     pmd_t pmd)
         |                                                     ^~~~~
   include/linux/pgtable.h:63:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      63 | {
         | ^
   include/linux/pgtable.h:70:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      70 | {
         | ^
   include/linux/pgtable.h:78:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
      78 | {
         | ^
   include/linux/pgtable.h:90:40: error: expected declaration specifiers or '...' before 'pmd_t'
      90 | static inline pte_t *pte_offset_kernel(pmd_t *pmd, unsigned long address)
         |                                        ^~~~~
   include/linux/pgtable.h:105:32: error: expected declaration specifiers or '...' before 'pmd_t'
     105 | static inline pte_t *__pte_map(pmd_t *pmd, unsigned long address)
         |                                ^~~~~
   include/linux/pgtable.h:110:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     110 | {
         | ^
   include/linux/pgtable.h:133:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
     133 | {
         | ^
   include/linux/pgtable.h:135:2: error: expected declaration specifiers before ';' token
     135 | };
         |  ^
   include/linux/pgtable.h:159:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
     159 | static inline pmd_t *pmd_off(struct mm_struct *mm, unsigned long va)
         |                     ^
   include/linux/pgtable.h:164:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
     164 | static inline pmd_t *pmd_off_k(unsigned long va)
..


vim +140 arch/arc/include/asm/uaccess.h

0a5eae458e923a Vineet Gupta 2013-01-18  100  
0a5eae458e923a Vineet Gupta 2013-01-18  101  #define __arc_put_user_one(src, dst, op, ret)	\
0a5eae458e923a Vineet Gupta 2013-01-18  102  	__asm__ __volatile__(                   \
0a5eae458e923a Vineet Gupta 2013-01-18  103  	"1:	"op"    %1,[%2]\n"		\
0a5eae458e923a Vineet Gupta 2013-01-18  104  	"2:	;nop\n"				\
0a5eae458e923a Vineet Gupta 2013-01-18  105  	"	.section .fixup, \"ax\"\n"	\
0a5eae458e923a Vineet Gupta 2013-01-18  106  	"	.align 4\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  107  	"3:	mov %0, %3\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  108  	"	j   2b\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  109  	"	.previous\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  110  	"	.section __ex_table, \"a\"\n"	\
0a5eae458e923a Vineet Gupta 2013-01-18  111  	"	.align 4\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  112  	"	.word 1b,3b\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  113  	"	.previous\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  114  						\
0a5eae458e923a Vineet Gupta 2013-01-18  115  	: "+r" (ret)				\
0a5eae458e923a Vineet Gupta 2013-01-18  116  	: "r" (src), "r" (dst), "ir" (-EFAULT))
0a5eae458e923a Vineet Gupta 2013-01-18  117  
0a5eae458e923a Vineet Gupta 2013-01-18  118  #define __arc_put_user_one_64(src, dst, ret)	\
0a5eae458e923a Vineet Gupta 2013-01-18  119  	__asm__ __volatile__(                   \
0a5eae458e923a Vineet Gupta 2013-01-18  120  	"1:	st   %1,[%2]\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  121  	"4:	st  %R1,[%2, 4]\n"		\
0a5eae458e923a Vineet Gupta 2013-01-18  122  	"2:	;nop\n"				\
0a5eae458e923a Vineet Gupta 2013-01-18  123  	"	.section .fixup, \"ax\"\n"	\
0a5eae458e923a Vineet Gupta 2013-01-18  124  	"	.align 4\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  125  	"3:	mov %0, %3\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  126  	"	j   2b\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  127  	"	.previous\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  128  	"	.section __ex_table, \"a\"\n"	\
0a5eae458e923a Vineet Gupta 2013-01-18  129  	"	.align 4\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  130  	"	.word 1b,3b\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  131  	"	.word 4b,3b\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  132  	"	.previous\n"			\
0a5eae458e923a Vineet Gupta 2013-01-18  133  						\
0a5eae458e923a Vineet Gupta 2013-01-18  134  	: "+r" (ret)				\
0a5eae458e923a Vineet Gupta 2013-01-18  135  	: "r" (src), "r" (dst), "ir" (-EFAULT))
0a5eae458e923a Vineet Gupta 2013-01-18  136  
0a5eae458e923a Vineet Gupta 2013-01-18  137  
43697cb0973da1 Vineet Gupta 2013-01-18  138  static inline unsigned long
e13909a4acc4b6 Vineet Gupta 2017-03-29  139  raw_copy_from_user(void *to, const void __user *from, unsigned long n)
43697cb0973da1 Vineet Gupta 2013-01-18 @140  {
43697cb0973da1 Vineet Gupta 2013-01-18  141  	long res = 0;
43697cb0973da1 Vineet Gupta 2013-01-18  142  	char val;
43697cb0973da1 Vineet Gupta 2013-01-18  143  	unsigned long tmp1, tmp2, tmp3, tmp4;
43697cb0973da1 Vineet Gupta 2013-01-18  144  	unsigned long orig_n = n;
43697cb0973da1 Vineet Gupta 2013-01-18  145  
43697cb0973da1 Vineet Gupta 2013-01-18  146  	if (n == 0)
43697cb0973da1 Vineet Gupta 2013-01-18  147  		return 0;
43697cb0973da1 Vineet Gupta 2013-01-18  148  
43697cb0973da1 Vineet Gupta 2013-01-18  149  	/* unaligned */
43697cb0973da1 Vineet Gupta 2013-01-18  150  	if (((unsigned long)to & 0x3) || ((unsigned long)from & 0x3)) {
43697cb0973da1 Vineet Gupta 2013-01-18  151  
43697cb0973da1 Vineet Gupta 2013-01-18  152  		unsigned char tmp;
43697cb0973da1 Vineet Gupta 2013-01-18  153  
43697cb0973da1 Vineet Gupta 2013-01-18  154  		__asm__ __volatile__ (
43697cb0973da1 Vineet Gupta 2013-01-18  155  		"	mov.f   lp_count, %0		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  156  		"	lpnz 2f				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  157  		"1:	ldb.ab  %1, [%3, 1]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  158  		"	stb.ab  %1, [%2, 1]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  159  		"	sub     %0,%0,1			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  160  		"2:	;nop				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  161  		"	.section .fixup, \"ax\"		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  162  		"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  163  		"3:	j   2b				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  164  		"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  165  		"	.section __ex_table, \"a\"	\n"
43697cb0973da1 Vineet Gupta 2013-01-18  166  		"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  167  		"	.word   1b, 3b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  168  		"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  169  
43697cb0973da1 Vineet Gupta 2013-01-18  170  		: "+r" (n),
43697cb0973da1 Vineet Gupta 2013-01-18  171  		/*
43697cb0973da1 Vineet Gupta 2013-01-18  172  		 * Note as an '&' earlyclobber operand to make sure the
43697cb0973da1 Vineet Gupta 2013-01-18  173  		 * temporary register inside the loop is not the same as
43697cb0973da1 Vineet Gupta 2013-01-18  174  		 *  FROM or TO.
43697cb0973da1 Vineet Gupta 2013-01-18  175  		*/
43697cb0973da1 Vineet Gupta 2013-01-18  176  		  "=&r" (tmp), "+r" (to), "+r" (from)
43697cb0973da1 Vineet Gupta 2013-01-18  177  		:
d5e3c55e01d8b1 Vineet Gupta 2019-02-05  178  		: "lp_count", "memory");
43697cb0973da1 Vineet Gupta 2013-01-18  179  
43697cb0973da1 Vineet Gupta 2013-01-18  180  		return n;
43697cb0973da1 Vineet Gupta 2013-01-18  181  	}
43697cb0973da1 Vineet Gupta 2013-01-18  182  
43697cb0973da1 Vineet Gupta 2013-01-18  183  	/*
43697cb0973da1 Vineet Gupta 2013-01-18  184  	 * Hand-crafted constant propagation to reduce code sz of the
43697cb0973da1 Vineet Gupta 2013-01-18  185  	 * laddered copy 16x,8,4,2,1
43697cb0973da1 Vineet Gupta 2013-01-18  186  	 */
43697cb0973da1 Vineet Gupta 2013-01-18  187  	if (__builtin_constant_p(orig_n)) {
43697cb0973da1 Vineet Gupta 2013-01-18  188  		res = orig_n;
43697cb0973da1 Vineet Gupta 2013-01-18  189  
43697cb0973da1 Vineet Gupta 2013-01-18  190  		if (orig_n / 16) {
43697cb0973da1 Vineet Gupta 2013-01-18  191  			orig_n = orig_n % 16;
43697cb0973da1 Vineet Gupta 2013-01-18  192  
43697cb0973da1 Vineet Gupta 2013-01-18  193  			__asm__ __volatile__(
43697cb0973da1 Vineet Gupta 2013-01-18  194  			"	lsr   lp_count, %7,4		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  195  			"	lp    3f			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  196  			"1:	ld.ab   %3, [%2, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  197  			"11:	ld.ab   %4, [%2, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  198  			"12:	ld.ab   %5, [%2, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  199  			"13:	ld.ab   %6, [%2, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  200  			"	st.ab   %3, [%1, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  201  			"	st.ab   %4, [%1, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  202  			"	st.ab   %5, [%1, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  203  			"	st.ab   %6, [%1, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  204  			"	sub     %0,%0,16		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  205  			"3:	;nop				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  206  			"	.section .fixup, \"ax\"		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  207  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  208  			"4:	j   3b				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  209  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  210  			"	.section __ex_table, \"a\"	\n"
43697cb0973da1 Vineet Gupta 2013-01-18  211  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  212  			"	.word   1b, 4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  213  			"	.word   11b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  214  			"	.word   12b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  215  			"	.word   13b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  216  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  217  			: "+r" (res), "+r"(to), "+r"(from),
43697cb0973da1 Vineet Gupta 2013-01-18  218  			  "=r"(tmp1), "=r"(tmp2), "=r"(tmp3), "=r"(tmp4)
43697cb0973da1 Vineet Gupta 2013-01-18  219  			: "ir"(n)
43697cb0973da1 Vineet Gupta 2013-01-18  220  			: "lp_count", "memory");
43697cb0973da1 Vineet Gupta 2013-01-18  221  		}
43697cb0973da1 Vineet Gupta 2013-01-18  222  		if (orig_n / 8) {
43697cb0973da1 Vineet Gupta 2013-01-18  223  			orig_n = orig_n % 8;
43697cb0973da1 Vineet Gupta 2013-01-18  224  
43697cb0973da1 Vineet Gupta 2013-01-18  225  			__asm__ __volatile__(
43697cb0973da1 Vineet Gupta 2013-01-18  226  			"14:	ld.ab   %3, [%2,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  227  			"15:	ld.ab   %4, [%2,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  228  			"	st.ab   %3, [%1,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  229  			"	st.ab   %4, [%1,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  230  			"	sub     %0,%0,8			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  231  			"31:	;nop				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  232  			"	.section .fixup, \"ax\"		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  233  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  234  			"4:	j   31b				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  235  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  236  			"	.section __ex_table, \"a\"	\n"
43697cb0973da1 Vineet Gupta 2013-01-18  237  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  238  			"	.word   14b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  239  			"	.word   15b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  240  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  241  			: "+r" (res), "+r"(to), "+r"(from),
43697cb0973da1 Vineet Gupta 2013-01-18  242  			  "=r"(tmp1), "=r"(tmp2)
43697cb0973da1 Vineet Gupta 2013-01-18  243  			:
43697cb0973da1 Vineet Gupta 2013-01-18  244  			: "memory");
43697cb0973da1 Vineet Gupta 2013-01-18  245  		}
43697cb0973da1 Vineet Gupta 2013-01-18  246  		if (orig_n / 4) {
43697cb0973da1 Vineet Gupta 2013-01-18  247  			orig_n = orig_n % 4;
43697cb0973da1 Vineet Gupta 2013-01-18  248  
43697cb0973da1 Vineet Gupta 2013-01-18  249  			__asm__ __volatile__(
43697cb0973da1 Vineet Gupta 2013-01-18  250  			"16:	ld.ab   %3, [%2,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  251  			"	st.ab   %3, [%1,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  252  			"	sub     %0,%0,4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  253  			"32:	;nop				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  254  			"	.section .fixup, \"ax\"		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  255  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  256  			"4:	j   32b				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  257  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  258  			"	.section __ex_table, \"a\"	\n"
43697cb0973da1 Vineet Gupta 2013-01-18  259  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  260  			"	.word   16b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  261  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  262  			: "+r" (res), "+r"(to), "+r"(from), "=r"(tmp1)
43697cb0973da1 Vineet Gupta 2013-01-18  263  			:
43697cb0973da1 Vineet Gupta 2013-01-18  264  			: "memory");
43697cb0973da1 Vineet Gupta 2013-01-18  265  		}
43697cb0973da1 Vineet Gupta 2013-01-18  266  		if (orig_n / 2) {
43697cb0973da1 Vineet Gupta 2013-01-18  267  			orig_n = orig_n % 2;
43697cb0973da1 Vineet Gupta 2013-01-18  268  
43697cb0973da1 Vineet Gupta 2013-01-18  269  			__asm__ __volatile__(
43697cb0973da1 Vineet Gupta 2013-01-18  270  			"17:	ldw.ab   %3, [%2,2]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  271  			"	stw.ab   %3, [%1,2]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  272  			"	sub      %0,%0,2		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  273  			"33:	;nop				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  274  			"	.section .fixup, \"ax\"		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  275  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  276  			"4:	j   33b				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  277  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  278  			"	.section __ex_table, \"a\"	\n"
43697cb0973da1 Vineet Gupta 2013-01-18  279  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  280  			"	.word   17b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  281  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  282  			: "+r" (res), "+r"(to), "+r"(from), "=r"(tmp1)
43697cb0973da1 Vineet Gupta 2013-01-18  283  			:
43697cb0973da1 Vineet Gupta 2013-01-18  284  			: "memory");
43697cb0973da1 Vineet Gupta 2013-01-18  285  		}
43697cb0973da1 Vineet Gupta 2013-01-18  286  		if (orig_n & 1) {
43697cb0973da1 Vineet Gupta 2013-01-18  287  			__asm__ __volatile__(
43697cb0973da1 Vineet Gupta 2013-01-18  288  			"18:	ldb.ab   %3, [%2,2]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  289  			"	stb.ab   %3, [%1,2]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  290  			"	sub      %0,%0,1		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  291  			"34:	; nop				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  292  			"	.section .fixup, \"ax\"		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  293  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  294  			"4:	j   34b				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  295  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  296  			"	.section __ex_table, \"a\"	\n"
43697cb0973da1 Vineet Gupta 2013-01-18  297  			"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  298  			"	.word   18b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  299  			"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  300  			: "+r" (res), "+r"(to), "+r"(from), "=r"(tmp1)
43697cb0973da1 Vineet Gupta 2013-01-18  301  			:
43697cb0973da1 Vineet Gupta 2013-01-18  302  			: "memory");
43697cb0973da1 Vineet Gupta 2013-01-18  303  		}
43697cb0973da1 Vineet Gupta 2013-01-18  304  	} else {  /* n is NOT constant, so laddered copy of 16x,8,4,2,1  */
43697cb0973da1 Vineet Gupta 2013-01-18  305  
43697cb0973da1 Vineet Gupta 2013-01-18  306  		__asm__ __volatile__(
43697cb0973da1 Vineet Gupta 2013-01-18  307  		"	mov %0,%3			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  308  		"	lsr.f   lp_count, %3,4		\n"  /* 16x bytes */
43697cb0973da1 Vineet Gupta 2013-01-18  309  		"	lpnz    3f			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  310  		"1:	ld.ab   %5, [%2, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  311  		"11:	ld.ab   %6, [%2, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  312  		"12:	ld.ab   %7, [%2, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  313  		"13:	ld.ab   %8, [%2, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  314  		"	st.ab   %5, [%1, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  315  		"	st.ab   %6, [%1, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  316  		"	st.ab   %7, [%1, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  317  		"	st.ab   %8, [%1, 4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  318  		"	sub     %0,%0,16		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  319  		"3:	and.f   %3,%3,0xf		\n"  /* stragglers */
43697cb0973da1 Vineet Gupta 2013-01-18  320  		"	bz      34f			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  321  		"	bbit0   %3,3,31f		\n"  /* 8 bytes left */
43697cb0973da1 Vineet Gupta 2013-01-18  322  		"14:	ld.ab   %5, [%2,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  323  		"15:	ld.ab   %6, [%2,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  324  		"	st.ab   %5, [%1,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  325  		"	st.ab   %6, [%1,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  326  		"	sub.f   %0,%0,8			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  327  		"31:	bbit0   %3,2,32f		\n"  /* 4 bytes left */
43697cb0973da1 Vineet Gupta 2013-01-18  328  		"16:	ld.ab   %5, [%2,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  329  		"	st.ab   %5, [%1,4]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  330  		"	sub.f   %0,%0,4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  331  		"32:	bbit0   %3,1,33f		\n"  /* 2 bytes left */
43697cb0973da1 Vineet Gupta 2013-01-18  332  		"17:	ldw.ab  %5, [%2,2]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  333  		"	stw.ab  %5, [%1,2]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  334  		"	sub.f   %0,%0,2			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  335  		"33:	bbit0   %3,0,34f		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  336  		"18:	ldb.ab  %5, [%2,1]		\n"  /* 1 byte left */
43697cb0973da1 Vineet Gupta 2013-01-18  337  		"	stb.ab  %5, [%1,1]		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  338  		"	sub.f   %0,%0,1			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  339  		"34:	;nop				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  340  		"	.section .fixup, \"ax\"		\n"
43697cb0973da1 Vineet Gupta 2013-01-18  341  		"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  342  		"4:	j   34b				\n"
43697cb0973da1 Vineet Gupta 2013-01-18  343  		"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  344  		"	.section __ex_table, \"a\"	\n"
43697cb0973da1 Vineet Gupta 2013-01-18  345  		"	.align 4			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  346  		"	.word   1b, 4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  347  		"	.word   11b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  348  		"	.word   12b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  349  		"	.word   13b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  350  		"	.word   14b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  351  		"	.word   15b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  352  		"	.word   16b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  353  		"	.word   17b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  354  		"	.word   18b,4b			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  355  		"	.previous			\n"
43697cb0973da1 Vineet Gupta 2013-01-18  356  		: "=r" (res), "+r"(to), "+r"(from), "+r"(n), "=r"(val),
43697cb0973da1 Vineet Gupta 2013-01-18  357  		  "=r"(tmp1), "=r"(tmp2), "=r"(tmp3), "=r"(tmp4)
43697cb0973da1 Vineet Gupta 2013-01-18  358  		:
43697cb0973da1 Vineet Gupta 2013-01-18  359  		: "lp_count", "memory");
43697cb0973da1 Vineet Gupta 2013-01-18  360  	}
43697cb0973da1 Vineet Gupta 2013-01-18  361  
43697cb0973da1 Vineet Gupta 2013-01-18  362  	return res;
43697cb0973da1 Vineet Gupta 2013-01-18  363  }
43697cb0973da1 Vineet Gupta 2013-01-18  364
Krishna Chaitanya Chundru Sept. 7, 2023, 6:04 a.m. UTC | #7
On 8/23/2023 6:35 AM, Pavan Kondeti wrote:
> On Tue, Aug 22, 2023 at 08:42:20PM +0530, Krishna chaitanya chundru wrote:
>> Add dev_pm_opp_find_level_floor() for searching a lesser match or
>> operating on OPP in the order of decreasing level.
>>
> "OPP: Add api to retrieve opps which is at most the provided level". Pls
> change this to "opp: Add dev_pm_opp_find_level_floor()". The API name
> conveys the message.
>
> In the description, you can give a use case. i.e voting for the max
> level during initialization of a driver.
>
Done
>> Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
>> ---
>>   drivers/opp/core.c     | 26 ++++++++++++++++++++++++++
>>   include/linux/pm_opp.h |  4 ++++
>>   2 files changed, 30 insertions(+)
>>
>> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
>> index 954c948..e668cf2 100644
>> --- a/drivers/opp/core.c
>> +++ b/drivers/opp/core.c
>> @@ -727,6 +727,32 @@ struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
>>   }
>>   EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_ceil);
>>   
>> +
>> +/**
>> + * dev_pm_opp_find_level_floor() - Search for a rounded floor freq
>> + * @dev:	device for which we do this operation
>> + * @freq:	Start level
>> + *
> %s/freq/level
>
> Run make W=1 so that kerneldoc is tested.
Done
>> + * Search for the matching floor *available* OPP from a starting level
>> + * for a device.
>> + *
>> + * Return: matching *opp and refreshes *level accordingly, else returns
>> + * ERR_PTR in case of error and should be handled using IS_ERR. Error return
>> + * values can be:
> What do you mean by refresh here?

Level  argument will be updated by this API with the opp level being 
returned here,

I was trying to use same terminology used in other API's

>> + * EINVAL:	for bad pointer
>> + * ERANGE:	no match found for search
>> + * ENODEV:	if device not found in list of registered devices
>> + *
>> + * The callers are required to call dev_pm_opp_put() for the returned OPP after
>> + * use.
>> + */
>> +struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
>> +					      unsigned long *level)
>> +{
>> +	return _find_key_floor(dev, level, 0, true, _read_level, NULL);
>> +}
>> +EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_floor);
>> +
>>   /**
>>    * dev_pm_opp_find_bw_ceil() - Search for a rounded ceil bandwidth
>>    * @dev:	device for which we do this operation
>> diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
>> index dc1fb58..a3bc386 100644
>> --- a/include/linux/pm_opp.h
>> +++ b/include/linux/pm_opp.h
>> @@ -128,6 +128,8 @@ struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
>>   					       unsigned int level);
>>   struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
>>   					      unsigned int *level);
>> +struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
>> +					      unsigned long *level);
>>   
>>   struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
>>   					     unsigned long *freq);
>> @@ -285,6 +287,8 @@ static inline struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev,
>>   
>>   static inline struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
>>   					unsigned int *bw, int index)
>> +static inline struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
>> +					unsigned long *level)
>>   {
>>   	return ERR_PTR(-EOPNOTSUPP);
>>   }
>>
> Please run ./scripts/checkpatch.pl --strict <your patch> and fix the
> indentation warnings from this patch.
>
> Thanks,
> Pavan

Done

- KC
diff mbox series

Patch

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 954c948..e668cf2 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -727,6 +727,32 @@  struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
 }
 EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_ceil);
 
+
+/**
+ * dev_pm_opp_find_level_floor() - Search for a rounded floor freq
+ * @dev:	device for which we do this operation
+ * @freq:	Start level
+ *
+ * Search for the matching floor *available* OPP from a starting level
+ * for a device.
+ *
+ * Return: matching *opp and refreshes *level accordingly, else returns
+ * ERR_PTR in case of error and should be handled using IS_ERR. Error return
+ * values can be:
+ * EINVAL:	for bad pointer
+ * ERANGE:	no match found for search
+ * ENODEV:	if device not found in list of registered devices
+ *
+ * The callers are required to call dev_pm_opp_put() for the returned OPP after
+ * use.
+ */
+struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
+					      unsigned long *level)
+{
+	return _find_key_floor(dev, level, 0, true, _read_level, NULL);
+}
+EXPORT_SYMBOL_GPL(dev_pm_opp_find_level_floor);
+
 /**
  * dev_pm_opp_find_bw_ceil() - Search for a rounded ceil bandwidth
  * @dev:	device for which we do this operation
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index dc1fb58..a3bc386 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -128,6 +128,8 @@  struct dev_pm_opp *dev_pm_opp_find_level_exact(struct device *dev,
 					       unsigned int level);
 struct dev_pm_opp *dev_pm_opp_find_level_ceil(struct device *dev,
 					      unsigned int *level);
+struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
+					      unsigned long *level);
 
 struct dev_pm_opp *dev_pm_opp_find_freq_ceil(struct device *dev,
 					     unsigned long *freq);
@@ -285,6 +287,8 @@  static inline struct dev_pm_opp *dev_pm_opp_find_bw_ceil(struct device *dev,
 
 static inline struct dev_pm_opp *dev_pm_opp_find_bw_floor(struct device *dev,
 					unsigned int *bw, int index)
+static inline struct dev_pm_opp *dev_pm_opp_find_level_floor(struct device *dev,
+					unsigned long *level)
 {
 	return ERR_PTR(-EOPNOTSUPP);
 }