Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3517516pxb; Mon, 4 Apr 2022 19:36:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYwmqLKtzrO5sSpjlJ022XycQoZqjt4SWcEqvltKuGJsR5t/n6x/3m20De4agMxEDBJoiF X-Received: by 2002:a65:4681:0:b0:382:b4f5:84c2 with SMTP id h1-20020a654681000000b00382b4f584c2mr1015952pgr.218.1649126186562; Mon, 04 Apr 2022 19:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649126186; cv=none; d=google.com; s=arc-20160816; b=X9c9/Y64Ojxbld/zjnhJmJkxU9bYyhDBa+jvEE9aeiLfKPWdU3TITQPVr/SnZnqQjp kJ0u65H9k/u+Q9JfgCPcZUrjD1j0FXq29cU3EZvnvfKTM6px9JsFV/sr4Ej9SCW8WYWs gev+OmSDKiXPHtPRzcw8Ww395zujJt10RiNtci6wyq0p6gX0EhGYYD2rlou+WUCDaEsV n5HCtGr7VdpkY5GWSHyQtefEPWn8LRW97Fla6V9TBnhIoIVemRbAEhiQFCim9ggoZmW+ QJ/3rGknvd1xnGJuAtcdPuARHy4fTVhj7kwduhw0FftRJDL0qgday4eg7qhSvl8F04yp b/Zw== 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=wvQN6+SfkSZk9aoVGGzju7dgWWAxqDwXcU21oRaCe8I=; b=beUjx4te+c6fk3Lj57KKKMkYqva848jpRUjX/uEf9GWgqy1Lz48l0X+rVKjHFd/6bp NRADNZ6u9DgQtiGXh1SRm5L5qLaZCXf/4yg8BedErq8qhvT0c3IfZ26NTWPMxHyk+wyl o5GA20Xe7CRQfagYARPJrWlMJg4ffuEN+yRS3xNQcuJ2aC8tWzkpo7jsN+aEFoq2M9aJ 9umldwHlVFwaENVNNtV2nRs89p/Qu3nDMn6F1a5cEYelrsG4ZWWu/0MtbXWBTkycB0zX IiqfBQCsO3coRcN7k8IABr1G9DN4NbihjwYCZNEp1PoKQ4G7ylBfURcd/fkBN9QQF43K kNbA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w15-20020a17090a15cf00b001ca9f3c1cc5si732163pjd.57.2022.04.04.19.36.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 19:36:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B96A737A1BA; Mon, 4 Apr 2022 18:00:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357533AbiDDK0f (ORCPT + 99 others); Mon, 4 Apr 2022 06:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237925AbiDDK0e (ORCPT ); Mon, 4 Apr 2022 06:26:34 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 488783C71E for ; Mon, 4 Apr 2022 03:24:37 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CF55E1FB; Mon, 4 Apr 2022 03:24:36 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id ECE1B3F718; Mon, 4 Apr 2022 03:24:35 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Sudeep Holla , Etienne Carriere , Cristian Marussi , kernel test robot Subject: [PATCH] firmware: arm_scmi: Fix sparse warnings in OPTEE transport driver Date: Mon, 4 Apr 2022 11:24:19 +0100 Message-Id: <20220404102419.1159705-1-sudeep.holla@arm.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 The sparse checker complains about converting pointers between address spaces. We correctly stored an __iomem pointer in struct scmi_optee_channel, but discarded the __iomem when returning it from get_channel_shm, causing one warning. Then we passed the non-__iomem pointer return from get_channel_shm at tow other places, where an __iomem pointer is expected, causing couple of other warnings Add the appropriate __iomem annotations at all places where it is missing. optee.c:414:20: warning: incorrect type in return expression (different address spaces) optee.c:414:20: expected struct scmi_shared_mem * optee.c:414:20: got struct scmi_shared_mem [noderef] __iomem *shmem optee.c:426:26: warning: incorrect type in argument 1 (different address spaces) optee.c:426:26: expected struct scmi_shared_mem [noderef] __iomem *shmem optee.c:426:26: got struct scmi_shared_mem *shmem optee.c:441:30: warning: incorrect type in argument 1 (different address spaces) optee.c:441:30: expected struct scmi_shared_mem [noderef] __iomem *shmem optee.c:441:30: got struct scmi_shared_mem *shmem Cc: Etienne Carriere Cc: Cristian Marussi Reported-by: kernel test robot Signed-off-by: Sudeep Holla --- drivers/firmware/arm_scmi/optee.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/firmware/arm_scmi/optee.c b/drivers/firmware/arm_scmi/optee.c index 734f1eeee161..8302a2b4aeeb 100644 --- a/drivers/firmware/arm_scmi/optee.c +++ b/drivers/firmware/arm_scmi/optee.c @@ -405,8 +405,8 @@ static int scmi_optee_chan_free(int id, void *p, void *data) return 0; } -static struct scmi_shared_mem *get_channel_shm(struct scmi_optee_channel *chan, - struct scmi_xfer *xfer) +static struct scmi_shared_mem __iomem * +get_channel_shm(struct scmi_optee_channel *chan, struct scmi_xfer *xfer) { if (!chan) return NULL; @@ -419,7 +419,7 @@ static int scmi_optee_send_message(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer) { struct scmi_optee_channel *channel = cinfo->transport_info; - struct scmi_shared_mem *shmem = get_channel_shm(channel, xfer); + struct scmi_shared_mem __iomem *shmem = get_channel_shm(channel, xfer); int ret; mutex_lock(&channel->mu); @@ -436,7 +436,7 @@ static void scmi_optee_fetch_response(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer) { struct scmi_optee_channel *channel = cinfo->transport_info; - struct scmi_shared_mem *shmem = get_channel_shm(channel, xfer); + struct scmi_shared_mem __iomem *shmem = get_channel_shm(channel, xfer); shmem_fetch_response(shmem, xfer); } -- 2.35.1