From patchwork Fri Nov 27 19:58:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 11937157 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 7D2E1C5519F for ; Fri, 27 Nov 2020 19:58:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2EE4A21D46 for ; Fri, 27 Nov 2020 19:58:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rtFG8lhg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EE4A21D46 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 731836F3C9; Fri, 27 Nov 2020 19:58:56 +0000 (UTC) Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by gabe.freedesktop.org (Postfix) with ESMTPS id C89306F3BE for ; Fri, 27 Nov 2020 19:58:48 +0000 (UTC) Received: by mail-lf1-x144.google.com with SMTP id z21so8528797lfe.12 for ; Fri, 27 Nov 2020 11:58:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n7AUSPOHxh+ROspnXmAGmt29lw2/92P6Xx7q8Q73sVQ=; b=rtFG8lhgrSILnbwb3Lrt+6OpeHbZNZZZ0Hk1Pq3EWdYR4I2S5LnrPrBzUfYZdnhLbD NvK9RUJ9xGorG4tNxoKdBJ82XL2i8RQ04daPP5LdoFpZ5lZhxqs6KOh1eSj0w9JDaEWs kxhsYH47ImmndKEPH6OoKLEcPH0Ei1WHeekziKNNKCbiBTWrB4dPDNM659FywgbWkLjL syfH61UpKOOV4ilWc+dl+pdPB9hiUwUvphw+JRZZbGoS1fet27fx8K5LZezyUNZWqGpH oKkfek3UuGGeZo3m4GxX3ZegpL4xG8XJIvJLoC53LI2iYHIw0aLB76MnGLTcyklWZdf6 Ig2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=n7AUSPOHxh+ROspnXmAGmt29lw2/92P6Xx7q8Q73sVQ=; b=EN2PgcH6Foeny/8h0p574ZnECdwL72RDsZWJdu4Ng0SCYIdZr+SGs+COEAGlr2QGPl II1sLhKVx0ytBLII9iSa+jM0RR9vkbo8Eh84Ss/hWgxPee2hiMiCujiTsoXyAfp4tNz6 PmgxjaPw5t8bFvHyocEIpkLQI5oy2drUvTgu0UpAEu+lLhERKGKqKY/rf4d1N+EKCSwj Wytja8U0wNeTTqvibOwCPaJAK3trvj3igkanhPGXwKUDICiSoMYfz0TxfH2/LIhi3gRx 6+t3IV1mW/h6IYoasR0Usxxb9FYogZCwNFbYwbKaa+i/G/oi89e9Nhp90EDcvQU5vqGK Ba1g== X-Gm-Message-State: AOAM532z6mokIiyzJXbFdKhzD3GBptgbVAmDJ+6lvlqLG3eTIc7EUPzJ Y0DsPBIfbuEBhmhVPJHX2eg= X-Google-Smtp-Source: ABdhPJwT6Vp8ufL83Vnm7rhaXWMBXozvqUMkmLlmRs0l1JHZOollRcQVcjhC7wW8zOiKw6exXOpPFA== X-Received: by 2002:a05:6512:358d:: with SMTP id m13mr4193587lfr.435.1606507127242; Fri, 27 Nov 2020 11:58:47 -0800 (PST) Received: from saturn.localdomain ([2a00:fd00:8060:1c00:9d62:990:4557:451]) by smtp.gmail.com with ESMTPSA id c6sm1070415ljj.140.2020.11.27.11.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 11:58:46 -0800 (PST) From: Sam Ravnborg To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Lee Jones Subject: [PATCH v1 05/28] video: fbdev: aty: Fix W=1 warnings in atyfb_base Date: Fri, 27 Nov 2020 20:58:02 +0100 Message-Id: <20201127195825.858960-6-sam@ravnborg.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201127195825.858960-1-sam@ravnborg.org> References: <20201127195825.858960-1-sam@ravnborg.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vaibhav Gupta , Tetsuo Handa , Peter Rosin , Michal Januszewski , Laurent Pinchart , linux-nvidia@lists.surfsouth.com, Jiri Slaby , Arnd Bergmann , Florian Tobias Schandinat , Evgeny Novikov , Sam Ravnborg , Saeed Mirzamohammadi , Daniel Vetter , Thomas Winischhofer , Thomas Zimemrmann , Bartlomiej Zolnierkiewicz , Jani Nikula , Aditya Pakki , Xiaofei Tan , Nathan Chancellor , Alex Dewar , Jason Yan , Greg Kroah-Hartman , Qilong Zhang , Randy Dunlap , Gustavo Silva , Ferenc Bakonyi , George Kennedy , Kristoffer Ericson , Alexander Klimov , Jingoo Han , Joe Perches , Peilin Ye , Mike Rapoport Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Fix W=1 warnings about variables assigned but never used. - Drop variables that was never used - Avoid using a local variable by moving the expression to an if condition Signed-off-by: Sam Ravnborg Cc: Bartlomiej Zolnierkiewicz Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Joe Perches Cc: Vaibhav Gupta Cc: Jason Yan Cc: Randy Dunlap Cc: Jani Nikula Reported-by: kernel test robot --- drivers/video/fbdev/aty/atyfb_base.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index c8feff0ee8da..d1eb9218debb 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -2360,22 +2360,20 @@ static int aty_init(struct fb_info *info) #ifdef CONFIG_FB_ATY_GX if (!M64_HAS(INTEGRATED)) { u32 stat0; - u8 dac_type, dac_subtype, clk_type; + u8 dac_subtype, clk_type; stat0 = aty_ld_le32(CNFG_STAT0, par); par->bus_type = (stat0 >> 0) & 0x07; par->ram_type = (stat0 >> 3) & 0x07; ramname = aty_gx_ram[par->ram_type]; /* FIXME: clockchip/RAMDAC probing? */ - dac_type = (aty_ld_le32(DAC_CNTL, par) >> 16) & 0x07; + aty_ld_le32(DAC_CNTL, par); #ifdef CONFIG_ATARI clk_type = CLK_ATI18818_1; - dac_type = (stat0 >> 9) & 0x07; - if (dac_type == 0x07) + if (((stat0 >> 9) & 0x07) == 0x07) dac_subtype = DAC_ATT20C408; else dac_subtype = (aty_ld_8(SCRATCH_REG1 + 1, par) & 0xF0) | dac_type; #else - dac_type = DAC_IBMRGB514; dac_subtype = DAC_IBMRGB514; clk_type = CLK_IBMRGB514; #endif @@ -3062,7 +3060,6 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info, if (dp == of_console_device) { struct fb_var_screeninfo *var = &default_var; unsigned int N, P, Q, M, T, R; - u32 v_total, h_total; struct crtc crtc; u8 pll_regs[16]; u8 clock_cntl; @@ -3078,9 +3075,6 @@ static int atyfb_setup_sparc(struct pci_dev *pdev, struct fb_info *info, crtc.gen_cntl = aty_ld_le32(CRTC_GEN_CNTL, par); aty_crtc_to_var(&crtc, var); - h_total = var->xres + var->right_margin + var->hsync_len + var->left_margin; - v_total = var->yres + var->lower_margin + var->vsync_len + var->upper_margin; - /* * Read the PLL to figure actual Refresh Rate. */