传递'crypto_compress_setup'的参数2时出错,从指针目标类型中丢弃'const'限定符

时间:2015-10-26 21:03:30

标签: android c gcc linux-kernel gcc5.2

我尝试用gcc 5.2编译一个android内核,我修复了所有错误,除了这个:

crypto/testmgr.c:1112:36: warning: passing argument 2 of 'crypto_compress_setup' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
error, forbidden warning: testmgr.c:1112

以下是代码:

static int test_pcomp(struct crypto_pcomp *tfm,
                      struct pcomp_testvec *ctemplate,
                      struct pcomp_testvec *dtemplate, int ctcount,
                      int dtcount)
{
    const char *algo = crypto_tfm_alg_driver_name(crypto_pcomp_tfm(tfm));
    unsigned int i;
    char result[COMP_BUF_SIZE];
    int res;

    for (i = 0; i < ctcount; i++) {
        struct comp_request req;
        unsigned int produced = 0;

        res = crypto_compress_setup(tfm, ctemplate[i].params,
                        ctemplate[i].paramsize);
        if (res) {
            pr_err("alg: pcomp: compression setup failed on test "
                   "%d for %s: error=%d\n", i + 1, algo, res);
            return res;

0 个答案:

没有答案