lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202209072048.JXgRFYbo-lkp@intel.com>
Date:   Wed, 7 Sep 2022 20:18:41 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jeff Johnson <quic_jjohnson@...cinc.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Manivannan Sadhasivam <mani@...nel.org>
Subject: [mani-mhi:mhi-next 2/3] drivers/bus/mhi/host/pci_generic.c:734:39:
 error: cannot assign to variable 'mhi_cntrl_config' with const-qualified
 type 'const struct mhi_controller_config *'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git mhi-next
head:   0a3b31f6259f4849e4e93731d4c8d7910be072a7
commit: 4a98958ca237a4b7974ea1ec2092b3666bdd26ab [2/3] bus: mhi: host: make mhi_controller_config::event_cfg const
config: arm64-randconfig-r036-20220906
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project c55b41d5199d2394dd6cdb8f52180d8b81d809d4)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git/commit/?id=4a98958ca237a4b7974ea1ec2092b3666bdd26ab
        git remote add mani-mhi https://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git
        git fetch --no-tags mani-mhi mhi-next
        git checkout 4a98958ca237a4b7974ea1ec2092b3666bdd26ab
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/bus/mhi/host/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

>> drivers/bus/mhi/host/pci_generic.c:734:39: error: cannot assign to variable 'mhi_cntrl_config' with const-qualified type 'const struct mhi_controller_config *'
                           mhi_cntrl_config->event_cfg[i].irq = 0;
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
   drivers/bus/mhi/host/pci_generic.c:710:44: note: variable 'mhi_cntrl_config' declared const here
                               const struct mhi_controller_config *mhi_cntrl_config)
                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
   1 error generated.


vim +734 drivers/bus/mhi/host/pci_generic.c

855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  708  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  709  static int mhi_pci_get_irqs(struct mhi_controller *mhi_cntrl,
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  710  			    const struct mhi_controller_config *mhi_cntrl_config)
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  711  {
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  712  	struct pci_dev *pdev = to_pci_dev(mhi_cntrl->cntrl_dev);
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  713  	int nr_vectors, i;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  714  	int *irq;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  715  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  716  	/*
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  717  	 * Alloc one MSI vector for BHI + one vector per event ring, ideally...
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  718  	 * No explicit pci_free_irq_vectors required, done by pcim_release.
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  719  	 */
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  720  	mhi_cntrl->nr_irqs = 1 + mhi_cntrl_config->num_events;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  721  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  722  	nr_vectors = pci_alloc_irq_vectors(pdev, 1, mhi_cntrl->nr_irqs, PCI_IRQ_MSI);
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  723  	if (nr_vectors < 0) {
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  724  		dev_err(&pdev->dev, "Error allocating MSI vectors %d\n",
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  725  			nr_vectors);
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  726  		return nr_vectors;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  727  	}
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  728  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  729  	if (nr_vectors < mhi_cntrl->nr_irqs) {
b91c3b30e22672 drivers/bus/mhi/pci_generic.c Loic Poulain 2021-01-05  730  		dev_warn(&pdev->dev, "using shared MSI\n");
b91c3b30e22672 drivers/bus/mhi/pci_generic.c Loic Poulain 2021-01-05  731  
b91c3b30e22672 drivers/bus/mhi/pci_generic.c Loic Poulain 2021-01-05  732  		/* Patch msi vectors, use only one (shared) */
b91c3b30e22672 drivers/bus/mhi/pci_generic.c Loic Poulain 2021-01-05  733  		for (i = 0; i < mhi_cntrl_config->num_events; i++)
b91c3b30e22672 drivers/bus/mhi/pci_generic.c Loic Poulain 2021-01-05 @734  			mhi_cntrl_config->event_cfg[i].irq = 0;
b91c3b30e22672 drivers/bus/mhi/pci_generic.c Loic Poulain 2021-01-05  735  		mhi_cntrl->nr_irqs = 1;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  736  	}
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  737  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  738  	irq = devm_kcalloc(&pdev->dev, mhi_cntrl->nr_irqs, sizeof(int), GFP_KERNEL);
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  739  	if (!irq)
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  740  		return -ENOMEM;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  741  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  742  	for (i = 0; i < mhi_cntrl->nr_irqs; i++) {
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  743  		int vector = i >= nr_vectors ? (nr_vectors - 1) : i;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  744  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  745  		irq[i] = pci_irq_vector(pdev, vector);
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  746  	}
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  747  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  748  	mhi_cntrl->irq = irq;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  749  
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  750  	return 0;
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  751  }
855a70c12021bd drivers/bus/mhi/pci_generic.c Loic Poulain 2020-10-21  752  

:::::: The code at line 734 was first introduced by commit
:::::: b91c3b30e2267265cd7e67cb3d0c99c48c02b001 mhi: pci_generic: Fix shared MSI vector support

:::::: TO: Loic Poulain <loic.poulain@...aro.org>
:::::: CC: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (186732 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ