Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35178218rwd; Mon, 10 Jul 2023 03:54:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlHlK24NK6/UBsOMgKa82TCmcyTjpzED5UyJ8cMUDy6uzDLpcSTGQPh0HZz8UDQ1W+Asjfc+ X-Received: by 2002:a17:907:2383:b0:98d:63c5:d132 with SMTP id vf3-20020a170907238300b0098d63c5d132mr11883932ejb.72.1688986463186; Mon, 10 Jul 2023 03:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688986463; cv=none; d=google.com; s=arc-20160816; b=miTZy5iwvC8FhNTKd5ApsaG+3n+qCyUgx2e8LhJJrWDFdTA36WoPo0SOgCm3D3P9Hj 6OF/AOi8wJ9qiHsRwXChDEYYjdzI+msM/bQ6p4hHyxK2nFDw514y5NJV3ZdaLbU8QPse 38r90rT47Vt88tL+Jn/UzrXYGteQpfpmPNV2ldV/JfJxtNA9RDShRz3YteBELnWyo0/6 PVK4l3zJq+z3gx3irXVu/qYCOxENeMN99q9/fxgpdK/WaWmiuQmIhhWj6FvXsA0ZN2+q UhinJD+3tbdp8JTFSfW3ksXWxbF8RnBvCl0/hc3GQcPqqAdPJARw3Z8dmF9QdUij01cn KCEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=VZdCz0l/jd9Ix6MtBC4RjW66zIfcYeKOyKdMEwUWkIw=; fh=c0DUkvnEtVads07vdUG4qIp+WkDdoF0u/u9axvNgwi0=; b=NDzs4Ask/klOYUVp6hjaaifdLdv/GGCQ5AI33BLcKiymjNrtOASqfuUn5fxeltz4S1 kbOdWwPjusZF+eLaP9M/R3hEjBOH9KVvFqK9IXQQY4zDR+Iiblpwh5ATekv5wAn3urva OhJIitbi5f0ssKFPGm1TAYLqaiUzEyjjixy4hXi4X204q8Nc7MsMGYnZX+0TIU0bcSXi wb6tu6BNvbYNsuw7SyPHSPU7ILJEcuyGhmgNa+AghU4/X7qWtOzY/BM7DPt1muAB90wJ uxuF9lAdz0WtMMS7QbvB8Z2rUly1JR+kqkRuETp86vBuijhYX6Ckj2iInbnEWqZ2Ovfn VJGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=cwMoUm3n; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k27-20020a17090646db00b0099248468c50si8468899ejs.296.2023.07.10.03.53.59; Mon, 10 Jul 2023 03:54:23 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=cwMoUm3n; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230457AbjGJK06 (ORCPT + 99 others); Mon, 10 Jul 2023 06:26:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229637AbjGJK04 (ORCPT ); Mon, 10 Jul 2023 06:26:56 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45224AF for ; Mon, 10 Jul 2023 03:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688984815; x=1720520815; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=lmv0G8hZetKfnEAWnNAaFa2Izy9izfDDhRQBoU/UakU=; b=cwMoUm3n85MykoFvLEL+NCP5TWFDEUe3kYnzAzwAMSYfN98QGp4wFygO mS08uUGR/9fseSp+qAMtpWJoqNt/pAHezx2F4jhZjmOhbz/pl9JdjIsuh 6dvLerbDJqcdPtnQkeQQWbGhrHxQksOahb6OOYAGWMYgdosaP1Scy9s3X oxARYBAoku2Su+rIzq4ex7yGLrUhAuRCnnXxO6sobz/5fTUKttKhlcqVE eKEn8CgJzddv6U/lWsq1qDIhS3iD28SyR7wKVPs6Pn9aNDqLU/yyEe8Cd ROHVgYmN3keCujpRjh9NJD8Av+XVaLBxzNzi6FV+l2UWy5qaz2UYffGqV w==; X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="344634881" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="344634881" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 03:26:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10766"; a="810771133" X-IronPort-AV: E=Sophos;i="6.01,194,1684825200"; d="scan'208";a="810771133" Received: from stoicaan-mobl.ger.corp.intel.com (HELO localhost) ([10.252.52.170]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2023 03:26:52 -0700 From: Jani Nikula To: Sui Jingfeng , Sui Jingfeng , David Airlie , Daniel Vetter , Thomas Zimmermann , Li Yi Cc: loongson-kernel@lists.loongnix.cn, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kernel test robot Subject: Re: [PATCH] drm/loongson: Fix two warnings because of passing wrong type In-Reply-To: <20230710100931.255234-1-suijingfeng@loongson.cn> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20230710100931.255234-1-suijingfeng@loongson.cn> Date: Mon, 10 Jul 2023 13:26:49 +0300 Message-ID: <87h6qcjc46.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,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 On Mon, 10 Jul 2023, Sui Jingfeng wrote: > When accessing I/O memory, we should pass '__iomem *' type instead of > 'void *' simply, otherwise sparse tests will complain. After applied > this patch, the following two sparse warnings got fixed. Usually the commit message should explain why it's okay to cast away the warning. Because realistically this doesn't "fix" the warning, this merely hides it. BR, Jani. > > 1) drivers/gpu/drm/loongson/lsdc_benchmark.c:27:35: > sparse: expected void volatile [noderef] __iomem * > sparse: got void *kptr > > 2) drivers/gpu/drm/loongson/lsdc_benchmark.c:42:51: > sparse: expected void const volatile [noderef] __iomem * > sparse: got void *kptr > > Reported-by: kernel test robot > Closes: https://lore.kernel.org/oe-kbuild-all/202307100243.v3hv6aes-lkp@intel.com/ > Signed-off-by: Sui Jingfeng > --- > drivers/gpu/drm/loongson/lsdc_benchmark.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/loongson/lsdc_benchmark.c b/drivers/gpu/drm/loongson/lsdc_benchmark.c > index b088646a2ff9..36e352820bdb 100644 > --- a/drivers/gpu/drm/loongson/lsdc_benchmark.c > +++ b/drivers/gpu/drm/loongson/lsdc_benchmark.c > @@ -24,7 +24,7 @@ static void lsdc_copy_gtt_to_vram_cpu(struct lsdc_bo *src_bo, > lsdc_bo_kmap(dst_bo); > > while (n--) > - memcpy_toio(dst_bo->kptr, src_bo->kptr, size); > + memcpy_toio((void __iomem *)dst_bo->kptr, src_bo->kptr, size); > > lsdc_bo_kunmap(src_bo); > lsdc_bo_kunmap(dst_bo); > @@ -39,7 +39,7 @@ static void lsdc_copy_vram_to_gtt_cpu(struct lsdc_bo *src_bo, > lsdc_bo_kmap(dst_bo); > > while (n--) > - memcpy_fromio(dst_bo->kptr, src_bo->kptr, size); > + memcpy_fromio(dst_bo->kptr, (void __iomem *)src_bo->kptr, size); > > lsdc_bo_kunmap(src_bo); > lsdc_bo_kunmap(dst_bo); -- Jani Nikula, Intel Open Source Graphics Center