Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5381494imw; Wed, 20 Jul 2022 04:48:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s8G/TkhqiiNnzoLSSyih8fLSFd7hF2jcwKOlnRY1DtsoC2URrj3f3aEU+DY8VBM9cgl0yG X-Received: by 2002:a17:902:9043:b0:16c:d862:fdf5 with SMTP id w3-20020a170902904300b0016cd862fdf5mr23306505plz.97.1658317686633; Wed, 20 Jul 2022 04:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658317686; cv=none; d=google.com; s=arc-20160816; b=lCW52nCKx1CvexW0l+JSc0EBak35YV0Lg3kU2sb3T9G6AxtS5Y6Eydv3cTrbZwJTJ2 c4mPHl7rbSTmJ9JV1G8Qv6QPOIhogN+gQ8Z9oGxSlyIK2u0t7s1O2u0f1GYtCF2oi2cr D7RchQYKqLoPNqLvwYdVjcMaXpxkxK14tvEYpjFsfi8NAocrnkzf3LMPLYgY5j2L3Eew 8AVYMz50rjYEOIQUqKb9tj8dazJNK0U80G8zejfBowmFePhyB6+RLUICzOzMR9fSdXhN hV1/znXikl4eULTb0C49xW2cZh5FSglxUdJtTudT54wHLFVie9cIEZu46s+W/jsSilw5 PLJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CRVWYeTJ3z1mATMRacXFgv811HEmLtg6owA+ofAMlOc=; b=oPuNFTxf/JVsnFM/s/07f6DsR74gCcPSUujiFP4io0PENUeJfgn73oOqxLMqakPRyW ZrQZu+PFA5QzHtYV/pwmXVQ2MGfK1KpRqkUNYMCcqtxWfX6C0kyQosGjIYjRfRoKWJgC MQtVchhKUQ26kLmrn9DEGSa7JryJa3FBxsIfuPKH6y9QMHx10I6lcd8mYbJPX1247b4R YZ0YOoG8SkSw7m95o8hD3cAjpfOKM7ziTyITgYxZbdvPzaq8iZMubky1/xHF0pVbvsUc JpzrBfQlKrIajS3THJIsysHln6EZM1fQ9VCSAnqGulb+2+CgE8sG58hEcwXh51Vd/r1O ebMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=rAWWhben; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w1-20020a170902e88100b0016c53c2a7a4si25398911plg.535.2022.07.20.04.47.52; Wed, 20 Jul 2022 04:48:06 -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; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=rAWWhben; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232916AbiGTLdw (ORCPT + 99 others); Wed, 20 Jul 2022 07:33:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231281AbiGTLdv (ORCPT ); Wed, 20 Jul 2022 07:33:51 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96FCC54073 for ; Wed, 20 Jul 2022 04:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=CRVWYeTJ3z1mATMRacXFgv811HEmLtg6owA+ofAMlOc=; b=rAWWhbenvX3lCYIk5peTZAJ91c jfmQGbHx/DYjr2zhJVthsEFIJNo8SWyFR0Xl9bU16xkBp7TafZCk6RxBgS9EVDyrSpNatHiFJr/xL oW0w7Wf0t4rxdm+iYzgHe3kDziaBWaz+ekFnGZkD3CGUisxV0hZqtZWkXX6bPNtaZAswx4rnElWmv dxUKwfH8BwtiGsh044imKptuS5RZGyZfhqOXEvoSIMMMKoRCjdqw/bwV8PSZiuQs2k37l0jng45mI 49FqRtpEYaswsu+kFq2mFew/Du+4nfbZVEpskiPsrblk/fPMoTthWv7LuvgTzPH44mWeOycI+zxpL 7EAvET9g==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oE7xI-005JX8-RB; Wed, 20 Jul 2022 11:33:29 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 6880C980BBE; Wed, 20 Jul 2022 13:33:28 +0200 (CEST) Date: Wed, 20 Jul 2022 13:33:28 +0200 From: Peter Zijlstra To: zengjx95@gmail.com Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, linux-kernel@vger.kernel.org, Zeng Jingxiang Subject: Re: [PATCH] kernel/sched/cputime: Fix unused value in cputime_adjust() Message-ID: References: <20220720102956.1141634-1-zengjx95@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220720102956.1141634-1-zengjx95@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 On Wed, Jul 20, 2022 at 06:29:56PM +0800, zengjx95@gmail.com wrote: > From: Zeng Jingxiang > > Coverity warns uf an unused value: > > assigned_value: Assign the value of the variable rtime to utime here, > but that stored value is overwritten before it can be used. > 568 if (stime == 0) { > 569 utime = rtime; > 570 goto update; > 571 } > > value_overwrite: Overwriting previous write to utime with > the value of expression rtime - stime. > 592 utime = rtime - stime; Coverity is being daft, the compiler has a dead-store-elimination pass. This way the code is more consistent / easier to ready.