Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp427391iog; Wed, 29 Jun 2022 03:11:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vG9KckuVj/GIlxMmec7TP4SYR+xK+Rsz9x8t8NJDPjy6nLyGhRCDIcpYpnyJpor4ux+7VX X-Received: by 2002:aa7:d353:0:b0:435:6a15:139f with SMTP id m19-20020aa7d353000000b004356a15139fmr3206989edr.19.1656497495988; Wed, 29 Jun 2022 03:11:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656497495; cv=none; d=google.com; s=arc-20160816; b=YKaHP5kIfoBtpR1QXy1E/nRggfGCYukmUn8wTDnjgBYkSBB1QjsOxtp7HtDrJLR+5P 2uecuk/lxU4PXWanHiuW4nbBFLrzcvsqi5DDChPtlstUMNlwN5V2H8Z/RJPKwgf1JUgq Fq9ZHchS2rU/JHw6yFyE+hFtGalS0UtByqZ7wB5Cp5tXyZgmvIw9xiS8HF5YOZNwpNKy /rma3g7WC7hQ7nm0aa+lSWKSCpgNvKvF4rkAdiv5oyj3CH8EmsBP7LT4go4lyAgEtMjZ IZxB8qQi06AhVb4+rAercfsAjSOM60UeVFMxIgRWyxBQiPtM1J7nh5dFu8K/7R50lavI Nv5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=T8IeWj4uNjUUqkuBXOxF7neMRNbWdtth9uhk2UmziMw=; b=CStkDDe60HhnxdEgOM/KHkIzFkRMO5LyMncp/y/DfGWtt6ahP6raoBM08X/hi+s1nY LqD87+Ly5SholjmuRukDaxEFaTZCWi2TfbsDd4ULKP79BfEYUehR0iowgQfi4sHsIMbG KbTS9KlvqJkdmWwnGt5p/gOuSY4JEEK5LgPHHhAzjyXZQL62Cmpb9x0JU8MCIgllFv4e N63Pna18ToJt/w/qS37FdIDDu3Rx6IVvYtveiCVsyMAcucbRFdBgt8K7pR5ZY/7jzKtw kWlccZSU2v6nfxj49Z/cI9WePlnivVdldJjGFtOQHQBs84AvT9G0GweOJsk/wZMbZ7xz eRGA== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs7-20020a1709072d0700b00726efe2dac9si2868374ejc.610.2022.06.29.03.11.10; Wed, 29 Jun 2022 03:11:35 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232745AbiF2JYw (ORCPT + 99 others); Wed, 29 Jun 2022 05:24:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232345AbiF2JYv (ORCPT ); Wed, 29 Jun 2022 05:24:51 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1355F369FB; Wed, 29 Jun 2022 02:24:49 -0700 (PDT) Received: from fraeml745-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LXwwM4l7mz686b6; Wed, 29 Jun 2022 17:22:27 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml745-chm.china.huawei.com (10.206.15.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 29 Jun 2022 11:24:47 +0200 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 29 Jun 2022 10:24:45 +0100 From: John Garry To: , CC: , , John Garry Subject: [PATCH v2] ata: pata_cs5535: Fix W=1 warnings Date: Wed, 29 Jun 2022 17:18:44 +0800 Message-ID: <1656494324-101603-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,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 x86_64 allmodconfig build with W=1 gives these warnings: drivers/ata/pata_cs5535.c: In function ‘cs5535_set_piomode’: drivers/ata/pata_cs5535.c:93:11: error: variable ‘dummy’ set but not used [-Werror=unused-but-set-variable] u32 reg, dummy; ^~~~~ drivers/ata/pata_cs5535.c: In function ‘cs5535_set_dmamode’: drivers/ata/pata_cs5535.c:132:11: error: variable ‘dummy’ set but not used [-Werror=unused-but-set-variable] u32 reg, dummy; ^~~~~ cc1: all warnings being treated as errors Mark variables 'dummy' as "maybe unused" as they are only ever written in rdmsr() calls. Signed-off-by: John Garry Reviewed-by: Sergey Shtylyov --- Differences to v1: - Add RB tag (thanks!) - Fix commit message diff --git a/drivers/ata/pata_cs5535.c b/drivers/ata/pata_cs5535.c index 6725931f3c35..c2c3238ff84b 100644 --- a/drivers/ata/pata_cs5535.c +++ b/drivers/ata/pata_cs5535.c @@ -90,7 +90,7 @@ static void cs5535_set_piomode(struct ata_port *ap, struct ata_device *adev) static const u16 pio_cmd_timings[5] = { 0xF7F4, 0x53F3, 0x13F1, 0x5131, 0x1131 }; - u32 reg, dummy; + u32 reg, __maybe_unused dummy; struct ata_device *pair = ata_dev_pair(adev); int mode = adev->pio_mode - XFER_PIO_0; @@ -129,7 +129,7 @@ static void cs5535_set_dmamode(struct ata_port *ap, struct ata_device *adev) static const u32 mwdma_timings[3] = { 0x7F0FFFF3, 0x7F035352, 0x7F024241 }; - u32 reg, dummy; + u32 reg, __maybe_unused dummy; int mode = adev->dma_mode; rdmsr(ATAC_CH0D0_DMA + 2 * adev->devno, reg, dummy); -- 2.35.3