X-Received: by 2002:a17:90a:280e:b0:1bc:3bb7:aa0a with SMTP id e14-20020a17090a280e00b001bc3bb7aa0amr5684560pjd.6.1645558344481; Tue, 22 Feb 2022 11:32:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645558344; cv=none; d=google.com; s=arc-20160816; b=skx97tiTpbrF5ca1mKLDrWkVquNjMa4RqrJXKpxvQH489mRk8wwHewAQLL7yLXazXD x4LjeMWKnYbWnIES9BXwqkeekHDXPHB7dHb7lNrqMRMym2oEhhpQu08Hk7e2/FSljm9u pN6za7dHpzYYtE+TniLDvNSFpKUgVDoyj0VZXtMc9IAaTC+Er5AIJzz9zjg3lWeC6nYT V2UBBzB7y+1bt7hnUlcFrXMe1Sj5oq+0uYu85RvCIRCyE9QluB12/LObnFO2ZFlPhCAi bg6O17K4N9zSik6WLdQDSJqqi9l56mZCC6L3rOleSpROIhEaKcvlenDarwkLI+it0j2y azww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=dtYXm2hT3lcm5wvRcUbNMDyXlIE45DADQhitf3Rlc88=; b=AC3itG3034IZseURS6UlG2NadDVhm6hSNbAAn7Zf6tYzI7GzAMEG33+oeHqWmDqZF/ C9mpHTNQJ4WlABp3wa/llYOxCVo/JYceyHWCON9bmFtVjhlg4M4ofrddrzURPbgnIy9g up5MMSb4zmpw+6+5HQu5oPJRBTHhaRYgq6AqexcVmcsI89M4C4kV2zHcNL+bwgPDWgRf 3O89nBOC1qXSdvFD85LMRiRVwT6rR5pfqYluHoAxPOs65GHWtw1uvPoxFkNg4C2wGeha SA6y7YbE3jNoeUk7j7sB5vTWChpl1j43zjZiBBK43Xv4Np6nhHx46MtxeX9WUS8yzSSy FtnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LLMAhUgw; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f188si21415612pgc.716.2022.02.22.11.31.52; Tue, 22 Feb 2022 11:32:24 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=LLMAhUgw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234037AbiBVQcF (ORCPT + 99 others); Tue, 22 Feb 2022 11:32:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiBVQb6 (ORCPT ); Tue, 22 Feb 2022 11:31:58 -0500 Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com [IPv6:2607:f8b0:4864:20::c2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8406C6266 for ; Tue, 22 Feb 2022 08:31:32 -0800 (PST) Received: by mail-oo1-xc2b.google.com with SMTP id p206-20020a4a2fd7000000b0031bfec11983so18276863oop.13 for ; Tue, 22 Feb 2022 08:31:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=dtYXm2hT3lcm5wvRcUbNMDyXlIE45DADQhitf3Rlc88=; b=LLMAhUgwrk/DYdWw6wgJuwrPS/o2NfgI10xeypJfrum8mmbBBX7d3r55885xcA0GSs N/0qnhPz6EDwjfCDK9EZLNApIQzBOjUAMTbhqcUrBws8r9XcYI+ZsjrQ1ackTdFYnXca KSe0mNO3CmeSvS7ItohT2P9sU7Dj+jbiFaynHZLO0MRk1EWBfi4n3U+MDt0xN/KgkRbR PUNRwRCH7/I5NqRt3zdTxI5yt4hkikKqm97sSwd5jrXi84dTOOy6v7mgYho9MtQZxmcW QzXsp71CoMubPYHdfyu53sEstrFfcN6QNLP2z/JN+YpWcau4FD4aw1cQMev20HollGSz gEvQ== 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:content-transfer-encoding; bh=dtYXm2hT3lcm5wvRcUbNMDyXlIE45DADQhitf3Rlc88=; b=AxD7P8Us1RDgjZ2bJ0k7dEIx7GY2dJE8oPP/MIdQfdUFM5UKzjNCR1gFHtLZRF+jGH QXgFqhzZPsSox/d1S8tLLqVxpZDr7Ibg34jnJKQ3nZ9VoUj9ysX883FRWfviD0R2+nKa 4VMcYEieGwvy+UY8o4rYBondwkXLef8DxWRTrsqTMJq7Zx+N18m5jtlvEGKceWfAcv8g iTy5yZwbtdNbNcizn6X7W+JgvhFSwg2ABvC3or9VZaWVKp96ORwFyxvSlfq1WPbeRLGK 0u9Ci9766W6jn5sZUxwqIjYh515kmIbZMWm/g9rIGq6BE2WfPoaIFkCqhykXAErWaG/e 3+dA== X-Gm-Message-State: AOAM530hLVWF8EKuxmyn2p0KVxYgMaw8sOkHaVY1YEl7paCzGNkMOvLK OvPfeLdjeTmT0WmA2X1SZQyam1mZg66BPZf08/A= X-Received: by 2002:a05:6870:3e0d:b0:d3:fe6d:57c3 with SMTP id lk13-20020a0568703e0d00b000d3fe6d57c3mr2020968oab.225.1645547491928; Tue, 22 Feb 2022 08:31:31 -0800 (PST) MIME-Version: 1.0 References: <20220222131701.356117-1-maira.canal@usp.br> <20220222131701.356117-5-maira.canal@usp.br> In-Reply-To: <20220222131701.356117-5-maira.canal@usp.br> From: Alex Deucher Date: Tue, 22 Feb 2022 11:31:20 -0500 Message-ID: Subject: Re: [PATCH 04/10] drm/amd/display: Remove unused temp variable To: =?UTF-8?B?TWHDrXJhIENhbmFs?= Cc: "Deucher, Alexander" , Christian Koenig , xinhui pan , Hawking Zhang , John Clements , Tao Zhou , "Chai, Thomas" , "Tuikov, Luben" , "Stanley.Yang" , Dennis Li , "Joshi, Mukul" , "Wentland, Harry" , "Leo (Sunpeng) Li" , "Siqueira, Rodrigo" , Anthony Koo , Magali Lemes , LKML , Maling list - DRI developers , mwen@igalia.com, amd-gfx list , Isabella Basso Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Applied. Thanks! Alex On Tue, Feb 22, 2022 at 8:18 AM Ma=C3=ADra Canal wrote= : > > Remove unused temp variable from the dmub_rb_flush_pending function by > using arithmetic to remove the loop. > > The -Wunused-but-set-variable warning was pointed out by Clang with the > following warning: > > drivers/gpu/drm/amd/amdgpu/../display/dmub/inc/dmub_cmd.h:2921:12: warnin= g: > variable 'temp' set but not used [-Wunused-but-set-variable] > uint64_t temp; > ^ > > Signed-off-by: Ma=C3=ADra Canal > --- > drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gp= u/drm/amd/display/dmub/inc/dmub_cmd.h > index fb01ff49e655..d3088836d4e4 100644 > --- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h > +++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h > @@ -2918,11 +2918,8 @@ static inline void dmub_rb_flush_pending(const str= uct dmub_rb *rb) > while (rptr !=3D wptr) { > uint64_t volatile *data =3D (uint64_t volatile *)((uint8_= t *)(rb->base_address) + rptr); > //uint64_t volatile *p =3D (uint64_t volatile *)data; > - uint64_t temp; > - uint8_t i; > > - for (i =3D 0; i < DMUB_RB_CMD_SIZE / sizeof(uint64_t); i+= +) > - temp =3D *data++; > + *data +=3D DMUB_RB_CMD_SIZE / sizeof(uint64_t); > > rptr +=3D DMUB_RB_CMD_SIZE; > if (rptr >=3D rb->capacity) > -- > 2.35.1 >