Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1654146pxp; Thu, 17 Mar 2022 13:42:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySbUKuxzz8GiE01JhwNBO3jtua4PeYMGiduxbxQbR5QJqJ4Rx7GJo/ffp0vLGYYNI0gf2f X-Received: by 2002:a17:902:8c81:b0:153:4a6a:52c8 with SMTP id t1-20020a1709028c8100b001534a6a52c8mr7367741plo.120.1647549756425; Thu, 17 Mar 2022 13:42:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647549756; cv=none; d=google.com; s=arc-20160816; b=EMPEPoVGYF8z6nMgH4KcwT/2aCkOiFVi6W/xPjtgj/k81oGsEHd6R9506ELzas7LJ7 dRKS3g2T2SihRfSbCa2IlebDPBCAtLf3+WKNLeGTsG2LcTapca6PY1mLuSU58mahP2tr bDorlyK1KNhh21PdmdXGUznnOLhaIaxANcDQLJ5cGOSKIICVDX6iyjcCJcdp0VnUpjwC x/vKYhBuViMA2NfjdrnWnoTjVb4dzPCzf+g+TZp1WxVAFFMQO/TvtSG3V3IXDik5LV+N m7vPuxujNs/87Tzu/kefaoZNilQbiyRWQn0/UzKFc2uzSJ0RUz7tbgnamWKi0WgA00Hx 1Ydg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vckV0ZlF5pMU5EOclP3oYh1APp1+Oy/OTUafdY9W0U0=; b=gNaQtIMDBDRb9bIcLuWY0QIDALoE8pRePK+gDyahHL8BnO1j5SeRoZ80+VCZBi602I WWoZiDVgnlt4zfDKefGhodR42RyFkmVHvZ5XxL8g76nwVAzfx9Cg3BnBVcjZBehA4OJW I83NvulkHCk8W+3PVl1yJeBc3ebzt8ARuIVnDXNTc10g8yGja7ydL12l2xxPmQccnLWT KXLSLGIErmiIb255qz/OrBdt7oFeFfPsNs92jnqPtTnkGuCsPSEng4JtMvy8HRdUiEho jESvJnHp3iPiF0sCOyXupBKWWdD8uqbVoJqSPDatmtblvk9OXAD1hDTTU9hK3S+uT1Yu Ny7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ElG57lX2; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r14-20020a63ce4e000000b003816043efadsi2915566pgi.418.2022.03.17.13.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:42:36 -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; dkim=pass header.i=@google.com header.s=20210112 header.b=ElG57lX2; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 513282ED2E3; Thu, 17 Mar 2022 13:10:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235084AbiCQO1D (ORCPT + 99 others); Thu, 17 Mar 2022 10:27:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231530AbiCQO1C (ORCPT ); Thu, 17 Mar 2022 10:27:02 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAEAE194A80 for ; Thu, 17 Mar 2022 07:25:45 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id d10so11042079eje.10 for ; Thu, 17 Mar 2022 07:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vckV0ZlF5pMU5EOclP3oYh1APp1+Oy/OTUafdY9W0U0=; b=ElG57lX2M22jXW1614RoNU9sFuWlREI++GMdCXHsLsj2BBm34g8Dijq+uyt4VMOqPS jIPyiECtHE23o92fQCogKBNeqrdHbXvRmY7juhlGVe2IR9Qpd0vHZRYO41F+cmJpF8vS 20z9bui8gwU5XmpwKvriWPh70C8sd47qi3nHdOW5EjNMkAOnWhaobCfkxCQhLmw417Gr q11yrzxYQBTuNOUk2uVPIu0O8TPpbJRF4UtW3eiWLPSLJvbiPdQjc54izEJOQIa447t6 SvFmt9LbwzLzyGLpFVXMyoC/Irh7j2MAxnVx9inhaG07T9OG4Q6jwSD1lKI1+Q5sooPQ jWzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vckV0ZlF5pMU5EOclP3oYh1APp1+Oy/OTUafdY9W0U0=; b=hwOsokPl7Nofo/6Azf4bzZbpEQpx5hsA7qXJybaY3+MRYDrs0xzDDm3s3qEd+Upn+9 dz3Bumu/41eMiPXon+A/UFOcvjgCrvGwfrU4dmrNIKnOfmvsYhIQL1YAN/Q/q0jIq+Tm SsxSC80jZ9K8Qm6YjyaicJNWEd6vpfMNP6/YZAV5Qim0aVfvC8Mv04JhJAL8IQIv8q3+ VOQiYGLm7MM6m8S519kmldOfED7GdwcbK0LExlkQrH2MHektlY/LA4nvK+j4BZTH/5de hTgnvJzeXhkmnKVuxe2MVVh9r6wyUMS9zm5Pj2ei2mCnO2aSOKVlmLckKxaKeHl6kZrw JAqw== X-Gm-Message-State: AOAM533qqVSG2mIAo+jkuceaSPbfzqmkxNqhzBHTV8Yf6iMICbijwcHr TnlUm7EJZJcwj5t8gsOzGgX+Fp+rMbowfqkFeeSf+Q== X-Received: by 2002:a17:906:d554:b0:6df:a6f8:799a with SMTP id cr20-20020a170906d55400b006dfa6f8799amr1274844ejc.492.1647527136467; Thu, 17 Mar 2022 07:25:36 -0700 (PDT) MIME-Version: 1.0 References: <20220317140115.541007-1-shraash@google.com> In-Reply-To: <20220317140115.541007-1-shraash@google.com> From: Guenter Roeck Date: Thu, 17 Mar 2022 07:25:25 -0700 Message-ID: Subject: Re: [PATCH] drm/amd/display: Fixed the unused-but-set-variable warning To: Aashish Sharma Cc: Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , Pan Xinhui , David Airlie , Nicholas Kazlauskas , Meenakshikumar Somasundaram , Jake Wang , Anson Jacob , Guenter Roeck , Daniel Vetter , Anthony Koo , Wayne Lin , linux-kernel , amd-gfx list , Maling list - DRI developers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 On Thu, Mar 17, 2022 at 7:01 AM Aashish Sharma wrote: > > Fixed this kernel test robot warning: > > drivers/gpu/drm/amd/amdgpu/../display/dmub/inc/dmub_cmd.h:2893:12: > warning: variable 'temp' set but not used [-Wunused-but-set-variable] > > Replaced the assignment to the unused temp variable with READ_ONCE() > macro to flush the writes. > > Signed-off-by: Aashish Sharma > --- > drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h > index 873ecd04e01d..b7981a781701 100644 > --- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h > +++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h > @@ -2913,13 +2913,12 @@ static inline void dmub_rb_flush_pending(const struct dmub_rb *rb) > uint32_t wptr = rb->wrpt; > > while (rptr != wptr) { > - uint64_t volatile *data = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rptr); > + uint64_t *data = (uint64_t volatile *)((uint8_t *)(rb->base_address) + rptr); also drop the volatile in the typecast > //uint64_t volatile *p = (uint64_t volatile *)data; The above commented out code serves no purpose and should be removed as well. Thanks, Guenter > - uint64_t temp; > uint8_t i; > > for (i = 0; i < DMUB_RB_CMD_SIZE / sizeof(uint64_t); i++) > - temp = *data++; > + (void)READ_ONCE(*data++); > > rptr += DMUB_RB_CMD_SIZE; > if (rptr >= rb->capacity) > -- > 2.35.1.723.g4982287a31-goog >