qcacmn: Avoid compilation issue with kernel 4.19

There is a compilation issue if a variable is passed to
kernel api DECLARE_HASHTABLE.
TO resolve this issue, instead of passing a variable
pass a constant to DECLARE_HASHTABLE.

Change-Id: Ie9782af541bb34cc50f79060b0007dc73881e5f4
CRs-Fixed: 2386893
This commit is contained in:
Ashish Kumar Dhanotiya 2019-01-21 20:09:29 +05:30 • committed by nshrivas
commit 3be335ca19
2 changed files with 10 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@ -20,6 +20,9 @@
#include "qdf_hashtable_test.h"
#include "qdf_trace.h"
/* 16 buckets */
#define QDF_HT_HASH_BITS 4
struct qdf_ht_test_item {
struct qdf_ht_entry entry;
uintptr_t key;
@ -27,12 +30,12 @@ struct qdf_ht_test_item {
static uint32_t qdf_ht_test_single(void)
{
const int bits = 4; /* 16 buckets */
const int bits = QDF_HT_HASH_BITS;
struct qdf_ht_test_item item = { .key = (uintptr_t)&bits };
struct qdf_ht_test_item *cursor;
int i, count;
qdf_ht_declare(ht, bits);
qdf_ht_declare(ht, QDF_HT_HASH_BITS);
qdf_ht_init(ht);
qdf_ht_add(ht, &item.entry, item.key);