Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp549594iog; Thu, 30 Jun 2022 06:00:51 -0700 (PDT) X-Google-Smtp-Source: AGRyM1txGO0YelLnJlQun42ljCFm8VwrKZJ9y+LiJCza4IpZHpvyIcDRAuG50n0S8Kvilintp7A4 X-Received: by 2002:a63:1809:0:b0:408:417a:6fa5 with SMTP id y9-20020a631809000000b00408417a6fa5mr7693463pgl.228.1656594050900; Thu, 30 Jun 2022 06:00:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656594050; cv=none; d=google.com; s=arc-20160816; b=d9twbG6MSMy6ddQJgho8BD4VSPTqyAY58Ko3Sf2BCGFiYcl0SrSf34siVgrB/U453J CxWbkVXYbfJO41mjdlZEaSqu8e73HChbApk+rxZwiY8WfoosqMLTNvapt1NuNn2pUYRi EtPob4vl/3/8q/hXX2cW2KTT+1P9cu8RKc28R4TKTxHXz1kZaRBkbna7WTy/UsyZ3stN aDNuSesnXrFmBuo6aCwcKgIQyoSBxibG9rtBl/LnZfkjeSAWKqyzKE0QczOfEuvmozaE OXAhm4hMJ/FB3ielf/e5WP+2wMjkscJszzlfPgpZNpWjVm0T/EwT+bPSRP8gc40wev7I 0nXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=DC6B9gxZrXWOJDXJL/u/oj64EsUlKTd3TS5PAcGvQS8=; b=MMA/wBwIutmarFtN/bsCzjOZBB2pn5x5PM/p/lnt3UnZZxsx6gBMOjF3ugFUpj0dCW 9rZ99YIpH78tAJba9NLCLKyBJNu7UV3UX/kNKhhbqEaA4eNgIm1+plr7oY1L3FnZDRCC hcYgRWhf4LIK3K5ivzgbdO8noZxmXGuNTTUhRCckVfMfZDOJUEPwtn+yBUBRuqYAizuR iqTB28hcWZxFXZVTOmYgHgs8O+H8h3127IHc0K0NUq8IX55skqAUicYQFbgb6ga3m9Ye 86vMrsEjV9DQIJoR9EW9qTR65vGyvVu7rVZNNzV3TMMfe7JDLYBQXoVwHz/ZVELzW6RP s/Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g12-20020a056a000b8c00b005181059a510si28357199pfj.314.2022.06.30.06.00.33; Thu, 30 Jun 2022 06:00:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234351AbiF3MhV (ORCPT + 99 others); Thu, 30 Jun 2022 08:37:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231910AbiF3MhU (ORCPT ); Thu, 30 Jun 2022 08:37:20 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECBC33AA5A for ; Thu, 30 Jun 2022 05:37:18 -0700 (PDT) Received: from dggpeml500024.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LYd9v112wz9smf; Thu, 30 Jun 2022 20:36:35 +0800 (CST) Received: from dggpeml500008.china.huawei.com (7.185.36.147) by dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 30 Jun 2022 20:37:16 +0800 Received: from huawei.com (10.67.175.34) by dggpeml500008.china.huawei.com (7.185.36.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 30 Jun 2022 20:37:16 +0800 From: Ren Zhijie To: , , , , CC: , , , Ren Zhijie Subject: [PATCH -next] dma-mapping: Fix build error unused-value Date: Thu, 30 Jun 2022 20:35:28 +0800 Message-ID: <20220630123528.251181-1-renzhijie2@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.175.34] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500008.china.huawei.com (7.185.36.147) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_DMA_DECLARE_COHERENT is not set, make ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- will be failed, like this: drivers/remoteproc/remoteproc_core.c: In function ‘rproc_rvdev_release’: ./include/linux/dma-map-ops.h:182:42: error: statement with no effect [-Werror=unused-value] #define dma_release_coherent_memory(dev) (0) ^ drivers/remoteproc/remoteproc_core.c:464:2: note: in expansion of macro ‘dma_release_coherent_memory’ dma_release_coherent_memory(dev); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors The return type of function dma_release_coherent_memory in CONFIG_DMA_DECLARE_COHERENT area is void, so in !CONFIG_DMA_DECLARE_COHERENT area it should neither return any value nor be defined as zero. Reported-by: Hulk Robot Fixes: e61c451476e6("dma-mapping: Add dma_release_coherent_memory to DMA API") Signed-off-by: Ren Zhijie --- include/linux/dma-map-ops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h index 53db9655efe9..bfffe494356a 100644 --- a/include/linux/dma-map-ops.h +++ b/include/linux/dma-map-ops.h @@ -179,10 +179,10 @@ static inline int dma_declare_coherent_memory(struct device *dev, return -ENOSYS; } -#define dma_release_coherent_memory(dev) (0) #define dma_alloc_from_dev_coherent(dev, size, handle, ret) (0) #define dma_release_from_dev_coherent(dev, order, vaddr) (0) #define dma_mmap_from_dev_coherent(dev, vma, vaddr, order, ret) (0) +static inline void dma_release_coherent_memory(struct device *dev) { } #endif /* CONFIG_DMA_DECLARE_COHERENT */ #ifdef CONFIG_DMA_GLOBAL_POOL -- 2.17.1