Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4483065imm; Tue, 7 Aug 2018 02:11:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpezCjA0PLdn7kxFNAJ7VSI4SrHZzD2bEb6kTDquzF/1v4I574vpo2YVubBY2rwfFPzQxF+i X-Received: by 2002:a62:455b:: with SMTP id s88-v6mr20902430pfa.203.1533633087714; Tue, 07 Aug 2018 02:11:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533633087; cv=none; d=google.com; s=arc-20160816; b=MqPdHMGBl+JTCt/SejUGrq0hklOdLh9j6tCUtkTWneaDzi+S4ATW0CzYJeGKsikyJ3 zOiCcQsov4sP2giFw7uTPKjSntgS0tXp6oCHf7mQ4C1AwHX6tfOXZSQgr80It3eTkGRr 53ewJBvCXlO3tNP+tXczZo4x8sxKNeovjpWk046xL3OgWMvruBZvIF6TJnMIB70VMmMb k8z9mz4lFIZ5s2orMC84lOsRZqJm3jEclfD2AQJXK4fxKXmB1J/13g3auuvekvxA0xJa jSIXzCbisRxJWGXA0Za1WTtviXU6DSrSJbALZ10/GOqDDnmo9dZca8PtkBsOnSxRGhSR Wo/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=1Z33Mt7YDSzF1DiGNCpvcIwzbGsmBj98N0x3mq4OwlI=; b=oAz7kUmQ3T3f4evaijF1ei4JepC+k6Qc6wL+reOvoge4xjMvBXEKSimabor2mAkWPe zNdJ0vJYBQg+/NCWEJ8EClX73hchNpMome90gG29yUv+75848hbf7R6eDxelEUZvbNew fJ4Ps6B0SfnHV0k/gFPe0lJie2YuhwUitXQ1Fe5+jPKdVA5v/vkQmY5nHf9gvyRPX6kG g7Zw/Q1uPZEvxpIgoNZ7kKmsAEDKaoFQIXmZH/OSII+Ht6GQJpJhPdXFM/MCR65B4nkC wwgD8xV7QwU87npw2IKJlrUv9WHBNW4su5BlySdvTRlLLfK1/zt3Sekk48MXw2xmByQJ nXqw== 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 z127-v6si971767pgb.455.2018.08.07.02.11.13; Tue, 07 Aug 2018 02:11:27 -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 S2388569AbeHGLNC (ORCPT + 99 others); Tue, 7 Aug 2018 07:13:02 -0400 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:47157 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbeHGLNC (ORCPT ); Tue, 7 Aug 2018 07:13:02 -0400 X-IronPort-AV: E=Sophos;i="5.51,454,1526335200"; d="scan'208";a="341629592" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2018 10:59:40 +0200 Date: Tue, 7 Aug 2018 10:59:35 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Mao Wenan cc: Peter Zijlstra , Ingo Molnar , Will Deacon , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] rtmutex: Drop pointless static qualifier in rt_mutex_adjust_prio_chain() In-Reply-To: <1533632163-93769-1-git-send-email-maowenan@huawei.com> Message-ID: References: <1533632163-93769-1-git-send-email-maowenan@huawei.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 Aug 2018, Mao Wenan wrote: > There is no need to have the 'T *v' variable static > since new value always be assigned before use it. The code is: static int prev_max; /* * Print this only once. If the admin changes the limit, * print a new message when reaching the limit again. */ if (prev_max != max_lock_depth) { So it is referenced before it is initialized. julia > > Signed-off-by: Mao Wenan > --- > kernel/locking/rtmutex.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c > index 2823d41..ba70db8 100644 > --- a/kernel/locking/rtmutex.c > +++ b/kernel/locking/rtmutex.c > @@ -472,7 +472,7 @@ static int rt_mutex_adjust_prio_chain(struct task_struct *task, > * We limit the lock chain length for each invocation. > */ > if (++depth > max_lock_depth) { > - static int prev_max; > + int prev_max; > > /* > * Print this only once. If the admin changes the limit, > > > > -- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >