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 X-Spam-Level: X-Spam-Status: No, score=-7.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D354C433E0 for ; Sun, 21 Feb 2021 23:46:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1847260C3E for ; Sun, 21 Feb 2021 23:46:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234191AbhBUXqd (ORCPT ); Sun, 21 Feb 2021 18:46:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:45930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234183AbhBUXqc (ORCPT ); Sun, 21 Feb 2021 18:46:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8991A64E08; Sun, 21 Feb 2021 23:45:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1613951150; bh=bebfcHSPVvXAYvSMBqmKSl9MQHrfaWf+ddsQTWVnsP0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U+qZdAvWGGzflMb7opbdSoC7Sd06+LtwJ0WiGDZXCes31Fxte79PKif/tNpQAB9y6 jNUcDXDUaWfYuu+Qt1ny4IIwhiEZnlA9AC7PtffscBbYOU811l/v7qfRj2qJpEyxnE LI0tjBFekHXpJLTUOykMlY8AwtpEtMLhBRRBbu5UT1YLjGvrGNWkh9eSgXX8Rxs/ms ZeSIesCt9Ci0CJJC0GqJJLItYOUgGxhIHfIlg20crWaH0rKbpJXBtzUjc8kX6HIqFF hVHdsZ5YNX0vmUiqnKOqkCpOan7FKYt5V7rOiW2QRH9R3aHAiqB9PPBqqn/e6ul7aT lqG3ofxbrAoOQ== Date: Sun, 21 Feb 2021 16:45:49 -0700 From: Nathan Chancellor To: Linus Torvalds Cc: Dave Airlie , Kevin Wang , Alex Deucher , Daniel Vetter , dri-devel , LKML Subject: Re: [git pull] drm for 5.12-rc1 Message-ID: <20210221234549.GA21254@24bbad8f3778> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 21, 2021 at 03:07:17PM -0800, Linus Torvalds wrote: > On Thu, Feb 18, 2021 at 10:06 PM Dave Airlie wrote: > > > > Let me know if there are any issues, > > gcc was happy, and I obviously already pushed out my merge, but then > when I did my clang build afterwards, it reports: > > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:764:2: warning: > variable 'structure_size' is used uninitialized whenever switch > default is taken [-Wsometimes-uninitialized] > default: > ^~~~~~~ > drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu_cmn.c:770:23: note: > uninitialized use occurs here > memset(header, 0xFF, structure_size); > ^~~~~~~~~~~~~~ > > and clang is very very right. That "default" case is completely > broken, and will generate a randomly sized memset. Not good. > > Presumably that default case never happens, but if so it shouldn't exist. > > Perhaps better yet, make the "default" case just do a "return" instead > of a break. Breaking out of the switch statement to code that cannot > possibly work is all kinds of mindless. > > Kevin/Alex? This was introduced by commit de4b7cd8cb87 > ("drm/amd/pm/swsmu: unify the init soft gpu metrics function") > > Linus I sent https://lore.kernel.org/r/20210218224849.5591-1-nathan@kernel.org/ a few days ago and Kevin reviewed it, just seems like Alex needs to pick it up. Cheers, Nathan