Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp309894imm; Tue, 18 Sep 2018 22:29:15 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbkZcKjXMTjASurmNlZ3CzJm94hyLHzq3+WkErMIcmI3rxYHh8ozhrCe0hf52Jf24AyPTdR X-Received: by 2002:a62:2744:: with SMTP id n65-v6mr34578010pfn.125.1537334955692; Tue, 18 Sep 2018 22:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537334955; cv=none; d=google.com; s=arc-20160816; b=oAcJ2iWzoVq2pe9FfU++omjg0lQc/1DO8w7Rmnn7vBN80CqVdVV6oBjTIArnSi1awh M5CycBrZGkbB6Q9Kx+ObLZLsuiInJmeHwHSeYdAElUMOvOyvca0c8/ZxnlNrzuX3ktgO y+/T47gy5WRAj6gjqSE3mpI8Y8mHl92qac7OxUqGBBtkFEN/BFD9dOPfw7rTgr0qGC6l THPliy07124CMvWJroQT31infqEiddcfoE8LnUJSTwlKNIQn/iO/kHPxiSTLhmsx/I6w ybPYj7Xr0W2UGXdb6INOcyiUkuyG6wlS9xQ6XEkiEWHnXSJla8g94cRuK5lYoXUBDa1b HxCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=lKrkxLzwOX0HKnESbNDoAVDDrXjfXHORwfacs11B7lU=; b=uoOrBSgRM/5cfihMqkcgw3yhMwql7WBdPx5daDML9AJi4phn8AbPAmMm+hkhL3AHkR TIJwn9ESfjLmr51ZTJSq7UZxiB9PHWZNWM7Ta8urpr3qAkLiCnMxdFCmUIdqF88yHY6S UpfC3BPoNC+Omir58aZfkGoehGC9YcROljHVpJMePWUFAbGs6ftAMWurhcvgUwMosHBg v37fjUp7Jj+uWRNrlrpHU+oEXBjxnehmE05EQOglcL1CrJaBMtXzJ3rYO1wcFEyRNmH/ CoI7Ku322ScJAvJmykYYgeAoGE1+2pMeOpzh6IgPfin2FLHFg1xRMg4YzCf7ibAvECak adCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s13-v6si24149250pfs.330.2018.09.18.22.28.58; Tue, 18 Sep 2018 22:29:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730392AbeISLFH (ORCPT + 99 others); Wed, 19 Sep 2018 07:05:07 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:12186 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726827AbeISLFH (ORCPT ); Wed, 19 Sep 2018 07:05:07 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5A9475D9F4987; Wed, 19 Sep 2018 13:28:46 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.399.0; Wed, 19 Sep 2018 13:28:41 +0800 From: zhong jiang To: CC: , Subject: [PATCH] sched: psi: Fix a GCC uninitialized warning Date: Wed, 19 Sep 2018 13:16:20 +0800 Message-ID: <1537334180-31870-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I find the following warning when compiling the kernel. kernel/sched/psi.c:639:13: warning: 'rq' may be used uninitialized in this function [-Wmaybe-uninitialized] struct rq *rq; Signed-off-by: zhong jiang --- kernel/sched/psi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 7cdecfc..2d8a1f2 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -636,7 +636,7 @@ void cgroup_move_task(struct task_struct *task, struct css_set *to) bool move_psi = !psi_disabled; unsigned int task_flags = 0; struct rq_flags rf; - struct rq *rq; + struct rq *rq = NULL; if (move_psi) { rq = task_rq_lock(task, &rf); -- 1.7.12.4