Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2131700pxp; Fri, 18 Mar 2022 04:08:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqD/ksaxYXIzWoIXbTCFB6ejrBgevPocSTJbraO2KTZfASfG4yl7hRKkZ+pn96tFjZVsl+ X-Received: by 2002:a63:1c14:0:b0:36b:28ef:f8ce with SMTP id c20-20020a631c14000000b0036b28eff8cemr7509841pgc.96.1647601699698; Fri, 18 Mar 2022 04:08:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647601699; cv=none; d=google.com; s=arc-20160816; b=M9aOkU+0misRWhYUU+DpSjsSwr5/6dEqpC0iGbE8rXnkWPN9Id/jnY44UJZoauYz5T mXfUHkAvMtUVsFcTxCQtmMBAfXNP7069AWfMcQNyC+JaqrZwWh34pEuU2XaIVcEGs1wQ u88Tac7U612afGkAsY44aAEcRPmO19K7Aa/iktgbscQQWpNdOaETAN1PLFkQUQZb6WVi luQ40Jh6v5QeOdnEAdNQf+vP2r7KbEnUS4ehAmW7CZHvncZq1zrLV84aFkrt9Y+XFSz7 V092CexQQt5sulnRNIQUKQvV2i2fy6wa6um8k6ePvC0P0lqKxC1F27ck5XuIQxkLqIR+ 0JtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=v1ip3kSfDi0seq3nuI1G/U5GvPh4txAFvJvlUf1KMO4=; b=FgMBpaHC5QzP4pkKR4vGw0NAIiNn6mqyIlh6y0Mpex0m0q2WjuHJ/jwdSMu6LKLueZ xCLm5WJNrVBPeoHGWvG/6Js/np+lj/H4KXqCW+Gr3tz2g4MxFiUvhcbqNoMO9MoAlazD tO2GBcg0r9GUTjfRhKnl2IDmHcx/UMpcpTDpOzdOSs+RcJUvyA74vwTULwgyT96WCP27 QgGxXJOGqh0hIKY5tIEcd0wLy6YyiC9Dv3gqZG6Yf7Iy9r0Sp+Fue62cCMommLHgPrab yeT5Rr1N4qspwwSKtsAF+uoU4g2FtaFP4WJGydeoCScV75u+2zlqhL/iaIQeMgT9C1gn AP4w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q19-20020a631f53000000b003816043f0fbsi4455827pgm.752.2022.03.18.04.08.08; Fri, 18 Mar 2022 04:08:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232607AbiCRF7s (ORCPT + 99 others); Fri, 18 Mar 2022 01:59:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229912AbiCRF7q (ORCPT ); Fri, 18 Mar 2022 01:59:46 -0400 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2232C2E710D for ; Thu, 17 Mar 2022 22:58:28 -0700 (PDT) Received: from [192.168.0.3] (ip5f5aef49.dynamic.kabel-deutschland.de [95.90.239.73]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 5C8F161E6478B; Fri, 18 Mar 2022 06:58:26 +0100 (CET) Message-ID: Date: Fri, 18 Mar 2022 06:58:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] drm/amd/display: Fixed the unused-but-set-variable warning Content-Language: en-US To: Aashish Sharma , Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , Pan Xinhui , David Airlie , Nicholas Kazlauskas , Meenakshikumar Somasundaram , Jake Wang , Anson Jacob , Guenter Roeck Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Daniel Vetter , Wayne Lin , Anthony Koo References: <20220317140115.541007-1-shraash@google.com> From: Paul Menzel In-Reply-To: <20220317140115.541007-1-shraash@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, 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 Dear Aashish, Am 17.03.22 um 15:01 schrieb Aashish Sharma: Thank you for your patch. If you are going to send a v2, please use imperative mood. Maybe: drm/amd/display: Fix unused-but-set-variable warning > Fixed this kernel test robot warning: Maybe: Fix the kernel test robot warning below: > 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. Replace … Excuse my ignorance regarding `READ_ONCE()`, but is that the reason you remove the volatile qualifier? Some robots ask in their report to add a Found-by tag. If so, please add one. > 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); > //uint64_t volatile *p = (uint64_t volatile *)data; > - uint64_t temp; > uint8_t i; > > for (i = 0; i < DMUB_RB_CMD_SIZE / sizeof(uint64_t); i++) > - temp = *data++; > + (void)READ_ONCE(*data++); Did you verify, that the generated code is the same now, or what the differences are. If it’s different from before, you should document in the commit message, that it’s wanted, as otherwise, it’s an invasive change just to fix a warning. > rptr += DMUB_RB_CMD_SIZE; > if (rptr >= rb->capacity) Kind regards, Paul