[gabbayo:habanalabs-fixes 7/7] drivers/misc/habanalabs/goya/goya.c:3012:17: sparse: cast removes address space of expression
kbuild test robot
lkp at intel.com
Wed Mar 27 10:26:31 UTC 2019
tree: git://people.freedesktop.org/~gabbayo/linux habanalabs-fixes
head: 7c22278edd0a931c565a8511dfc1bc57ffbb9166
commit: 7c22278edd0a931c565a8511dfc1bc57ffbb9166 [7/7] habanalabs: cast to expected type
reproduce:
# apt-get install sparse
git checkout 7c22278edd0a931c565a8511dfc1bc57ffbb9166
make ARCH=x86_64 allmodconfig
make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
sparse warnings: (new ones prefixed by >>)
>> drivers/misc/habanalabs/goya/goya.c:3012:17: sparse: cast removes address space of expression
drivers/misc/habanalabs/goya/goya.c:5253:9: sparse: expression using sizeof(void)
drivers/misc/habanalabs/goya/goya.c:5253:9: sparse: expression using sizeof(void)
drivers/misc/habanalabs/goya/goya.c:609:44: sparse: cast truncates bits from constant value (7ff0000000 becomes f0000000)
drivers/misc/habanalabs/goya/goya.c:619:44: sparse: cast truncates bits from constant value (8000000000 becomes 0)
drivers/misc/habanalabs/goya/goya.c:622:17: sparse: cast truncates bits from constant value (1007fffffffff becomes ffffffff)
drivers/misc/habanalabs/goya/goya.c:985:23: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000)
drivers/misc/habanalabs/goya/goya.c:987:22: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000)
drivers/misc/habanalabs/goya/goya.c:991:17: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/goya/goya.c:1031:17: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/goya/goya.c:1709:23: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000)
drivers/misc/habanalabs/goya/goya.c:1711:22: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000)
drivers/misc/habanalabs/goya/goya.c:1715:17: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/goya/goya.c:1759:23: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000)
drivers/misc/habanalabs/goya/goya.c:1761:22: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000)
drivers/misc/habanalabs/goya/goya.c:1765:17: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/goya/goya.c:1800:22: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000)
drivers/misc/habanalabs/goya/goya.c:1820:23: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000)
drivers/misc/habanalabs/goya/goya.c:1822:22: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000)
drivers/misc/habanalabs/goya/goya.c:1826:17: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/goya/goya.c:1869:23: sparse: cast truncates bits from constant value (7ffc113000 becomes fc113000)
drivers/misc/habanalabs/goya/goya.c:1871:22: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000)
drivers/misc/habanalabs/goya/goya.c:1875:17: sparse: cast truncates bits from constant value (7ffc800040 becomes fc800040)
drivers/misc/habanalabs/goya/goya.c:1910:22: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000)
drivers/misc/habanalabs/goya/goya.c:2426:9: sparse: cast truncates bits from constant value (7ff0100000 becomes f0100000)
drivers/misc/habanalabs/goya/goya.c:2466:27: sparse: cast truncates bits from constant value (7ff0000000 becomes f0000000)
drivers/misc/habanalabs/goya/goya.c:3746:26: sparse: cast truncates bits from constant value (7ffc112000 becomes fc112000)
drivers/misc/habanalabs/goya/goya.c:3747:24: sparse: cast truncates bits from constant value (7ffc112ffc becomes fc112ffc)
drivers/misc/habanalabs/goya/goya.c:5191:13: sparse: context imbalance in 'goya_hw_queues_lock' - wrong count at exit
drivers/misc/habanalabs/goya/goya.c:5198:13: sparse: context imbalance in 'goya_hw_queues_unlock' - unexpected unlock
vim +3012 drivers/misc/habanalabs/goya/goya.c
3003
3004 void *goya_get_int_queue_base(struct hl_device *hdev, u32 queue_id,
3005 dma_addr_t *dma_handle, u16 *queue_len)
3006 {
3007 void *base;
3008 u32 offset;
3009
3010 *dma_handle = hdev->asic_prop.sram_base_address;
3011
> 3012 base = (void *) hdev->pcie_bar[SRAM_CFG_BAR_ID];
3013
3014 switch (queue_id) {
3015 case GOYA_QUEUE_ID_MME:
3016 offset = MME_QMAN_BASE_OFFSET;
3017 *queue_len = MME_QMAN_LENGTH;
3018 break;
3019 case GOYA_QUEUE_ID_TPC0:
3020 offset = TPC0_QMAN_BASE_OFFSET;
3021 *queue_len = TPC_QMAN_LENGTH;
3022 break;
3023 case GOYA_QUEUE_ID_TPC1:
3024 offset = TPC1_QMAN_BASE_OFFSET;
3025 *queue_len = TPC_QMAN_LENGTH;
3026 break;
3027 case GOYA_QUEUE_ID_TPC2:
3028 offset = TPC2_QMAN_BASE_OFFSET;
3029 *queue_len = TPC_QMAN_LENGTH;
3030 break;
3031 case GOYA_QUEUE_ID_TPC3:
3032 offset = TPC3_QMAN_BASE_OFFSET;
3033 *queue_len = TPC_QMAN_LENGTH;
3034 break;
3035 case GOYA_QUEUE_ID_TPC4:
3036 offset = TPC4_QMAN_BASE_OFFSET;
3037 *queue_len = TPC_QMAN_LENGTH;
3038 break;
3039 case GOYA_QUEUE_ID_TPC5:
3040 offset = TPC5_QMAN_BASE_OFFSET;
3041 *queue_len = TPC_QMAN_LENGTH;
3042 break;
3043 case GOYA_QUEUE_ID_TPC6:
3044 offset = TPC6_QMAN_BASE_OFFSET;
3045 *queue_len = TPC_QMAN_LENGTH;
3046 break;
3047 case GOYA_QUEUE_ID_TPC7:
3048 offset = TPC7_QMAN_BASE_OFFSET;
3049 *queue_len = TPC_QMAN_LENGTH;
3050 break;
3051 default:
3052 dev_err(hdev->dev, "Got invalid queue id %d\n", queue_id);
3053 return NULL;
3054 }
3055
3056 base += offset;
3057 *dma_handle += offset;
3058
3059 return base;
3060 }
3061
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
More information about the dri-devel
mailing list