From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9824DC433F5 for ; Fri, 18 Mar 2022 05:58:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232613AbiCRF7s (ORCPT ); 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 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