diff mbox

[v1,3/4] dmaengine: hidma: Constify returned by device_get_match_data() value

Message ID 20180131212758.68587-3-andriy.shevchenko@linux.intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Andy Shevchenko Jan. 31, 2018, 9:27 p.m. UTC
The value under the hood is constant in any case.
It makes sense to show this explicitly.

Fixes: 95fbfb7aa28d ("dmaengine: qcom_hidma: Add support for the new revision")
Cc: Sinan Kaya <okaya@codeaurora.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/qcom/hidma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

kernel test robot Feb. 11, 2018, 3:48 a.m. UTC | #1
Hi Andy,

I love your patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on next-20180209]
[cannot apply to pm/linux-next v4.15]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Andy-Shevchenko/ACPI-bus-Remove-checks-in-acpi_get_match_data/20180204-003119
config: x86_64-randconfig-u0-02111037 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/dma/qcom/hidma.c: In function 'hidma_test_capability':
>> drivers/dma/qcom/hidma.c:748:6: error: assignment of read-only variable 'cap'
     cap = (const enum hidma_cap) device_get_match_data(dev);
         ^

vim +/cap +748 drivers/dma/qcom/hidma.c

   743	
   744	static bool hidma_test_capability(struct device *dev, enum hidma_cap test_cap)
   745	{
   746		const enum hidma_cap cap;
   747	
 > 748		cap = (const enum hidma_cap) device_get_match_data(dev);
   749		return cap ? ((cap & test_cap) > 0) : 0;
   750	}
   751	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 963cc5228d05..24e163cefb7c 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -743,9 +743,9 @@  static int hidma_request_msi(struct hidma_dev *dmadev,
 
 static bool hidma_test_capability(struct device *dev, enum hidma_cap test_cap)
 {
-	enum hidma_cap cap;
+	const enum hidma_cap cap;
 
-	cap = (enum hidma_cap) device_get_match_data(dev);
+	cap = (const enum hidma_cap) device_get_match_data(dev);
 	return cap ? ((cap & test_cap) > 0) : 0;
 }