Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1374720ybt; Sun, 14 Jun 2020 21:04:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyseQ/ynbFxPIyGMz2uzO5TvbToQIdObb1ljuqOKEmKkLTeAuOXLAREIJcV6nho5xqI3+Wv X-Received: by 2002:aa7:c489:: with SMTP id m9mr23155849edq.102.1592193863155; Sun, 14 Jun 2020 21:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592193863; cv=none; d=google.com; s=arc-20160816; b=gQ/HAt/r2uEjMZ6HrwMyHk6ICNUpD1/B2aiB3zcBwJjLyfS4wNYXXR96hnqhtO7R/e NvR3IQMhMSLAdrmw51fzCH5IwvihOSV2Efk3bGCBa7C2X9tDJzplATXN16Nbz90058oB cHgwpHP2mYMBxGvXRqT3DfeBBWq3QzZKoQy1LD3tq0ItSCCAiQ8cwPRVwDuRsjBstZlh 8z334Z6goZ8I2129lKZdeWvZQDBkJbGXlJNf+ISABHQY/l845XT1f8AsxePOmyBNZ+YC t2h3ZKqb2X0IucZ6ZVMBAjyMUKDoCV6nzISXuQQop5wvtzYOve5z260J6aIlIK5HtTlr WPyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=/rfKQCJpRU7sNeN6yLaWQY+0W/Jj1bBZoWPykDO3i/s=; b=NIjahaKzZ/tkFTuTurmkCJiZFnrPpdL4B2I7qwYBrolhX4Hu+h21Y1StgTcVopS2Lz UyjQmvqBuMNSDc5nFJ9LS382G2H7xMcuFDDiw6yVJGRMBypeiVg8rGlWFkRzNjfyJrWR HE8fDIpoWnuZJzCAnP4i5E88HPYj6xnAUd0oqKL04Cue6iZuVK2+IZH7rauENNuhoe0A e33AvHUl7GdXnjr6F1qgM8m7XtcYdYe8hACjaPXVkGp5eW/y4bJy+VZ51Vv25jKEgYjT i2I57zx39MmzPgCBgkjduxas05lrVApZMvIWIEBadEJp4svF5VzLVpjRsCDj2sWjrEY+ HNDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm19si7894755edb.59.2020.06.14.21.04.00; Sun, 14 Jun 2020 21:04:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728172AbgFOEBb (ORCPT + 99 others); Mon, 15 Jun 2020 00:01:31 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:5887 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725294AbgFOEBa (ORCPT ); Mon, 15 Jun 2020 00:01:30 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 331B8FD817FCBAC1C319; Mon, 15 Jun 2020 12:01:27 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Mon, 15 Jun 2020 12:01:20 +0800 From: Jason Yan To: , , , CC: , Jason Yan , Kees Cook Subject: [PATCH] ata: Eliminate usage of uninitialized_var() macro Date: Mon, 15 Jun 2020 12:02:36 +0800 Message-ID: <20200615040236.3720734-1-yanaijie@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an effort to eliminate the uninitialized_var() macro[1]. The use of this macro is the wrong solution because it forces off ANY analysis by the compiler for a given variable. It even masks "unused variable" warnings. Quoted from Linus[2]: "It's a horrible thing to use, in that it adds extra cruft to the source code, and then shuts up a compiler warning (even the _reliable_ warnings from gcc)." The gcc option "-Wmaybe-uninitialized" has been disabled and this change will not produce any warnnings even with "make W=1". [1] https://github.com/KSPP/linux/issues/81 [2] https://lore.kernel.org/lkml/CA+55aFz2500WfbKXAx8s67wrm9=yVJu65TpLgN_ybYNv0VEOKA@mail.gmail.com/ Cc: Kees Cook Signed-off-by: Jason Yan --- drivers/ata/libata-scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 435781a16875..fcb00f2825fe 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -93,7 +93,7 @@ static ssize_t ata_scsi_park_show(struct device *device, struct ata_link *link; struct ata_device *dev; unsigned long now; - unsigned int uninitialized_var(msecs); + unsigned int msecs; int rc = 0; ap = ata_shost_to_port(sdev->host); -- 2.25.4