Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp5417327imw; Wed, 20 Jul 2022 05:29:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t7+VQP1N87Y3XU63wLlqNr+xg40f0vkHH/cpMxJPt7q0mQyrlM7dlehq1PHu4X74a1CjAE X-Received: by 2002:a17:902:cece:b0:16c:3683:8830 with SMTP id d14-20020a170902cece00b0016c36838830mr37770634plg.107.1658320150497; Wed, 20 Jul 2022 05:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658320150; cv=none; d=google.com; s=arc-20160816; b=fDpZvjg7Y4uKlTlDCcO/vORXf7rRcSS9M3XTFnokSzMa98n4zZAoFL1LWp9GU4mmP0 G1RlhF4Fk1EvNT73nEZCysjk/y6M3hHeMzlB1VGSed95pytisfWSrAm43YKjFzZ1nbpU CINyB9+oYtElZE8NYSVCaHTwYI3qD7S/s53z1OwPMzUv2muBi+zEHfKmJOC+HCC/uh8y F48LOq9XD/Jvsk1aXGpNaC5ZOPnBKIROLyXGCyrn4DI3/tF/Hb7jvwrYrF1u9WRZk1yo zhSOhK0fDcpm8nQJltI6Uao4jsHRplUVrKhvXDSSqS4ZTfL8j/3Tfdfh626u5acmhcHf vfxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=sjXwnWKyhBxBzBGiYMwLKosOzhlOCzMsptfg4c6EAuA=; b=hlpTs4/6SVgItqBmnCu28VcHS6jpJNQkdq2rDJTZGjpljkME6BixiqaaHx1TNzj9pX wO8VoV5unkBMyJjc/29qMoZYb1CQyD3zmRSjLMTj3ytoAbaUxYf8uRL+y+p1es2o7lHF pa818+robxoTwCUhx8Fp7PB1qbkII3qNIjxwDphwj7KrNS9DJmF8NG3oJoAPAo8vsJTa k2OWlYdF8YztoijP3vnkjTxu7LJ/ZpLDWtobC2TH0SkF5vRXE6SVMnFCWhubNTMoGaLk 1IFrGplreO8VcuKv9Urkj9bCUOkK0sU7wQAG86RACoeP+g1Jp4P6PhvPKjzKhTjjar1D Ajwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="m3O3x/f/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l63-20020a638842000000b00415d3a444e4si23174654pgd.404.2022.07.20.05.28.55; Wed, 20 Jul 2022 05:29:10 -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=@gmail.com header.s=20210112 header.b="m3O3x/f/"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234199AbiGTMZy (ORCPT + 99 others); Wed, 20 Jul 2022 08:25:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229514AbiGTMZw (ORCPT ); Wed, 20 Jul 2022 08:25:52 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2F5145F7A for ; Wed, 20 Jul 2022 05:25:49 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id z23so32765226eju.8 for ; Wed, 20 Jul 2022 05:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=sjXwnWKyhBxBzBGiYMwLKosOzhlOCzMsptfg4c6EAuA=; b=m3O3x/f/H+KcpJUYzGbLJBTX8HPfSoBlCJFZlh+08wzt5PkIJzmlPjpbk6TKK81DRM 5y2T+ReL7FEz4LrPHiY80haWkU3/rjzY+UGwt657KR6S2GtaeN1D6AsxCDh3n6GNNL5j YH3qfNBQeB+9KH7QiNntocpXkgXuWoRJ+MQFgUCxtux3JSxj0kzlw/VE8JBGWFQ/Fkhh XIDecStHjuG3YUXMLkZ2bGfhEy2qdHvA9d3MG+NFgmZgEt/Zc1IXctK7brKlZIlI450F 5yiSmoTUkMDh1oNVjZQ+8OqlhYZu2eWHypLzv+sYHltiAoGTpDZT5BWSrH9tz2vTs6uo r3fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sjXwnWKyhBxBzBGiYMwLKosOzhlOCzMsptfg4c6EAuA=; b=HHQAQR0nywXZ7CLhMOsRHqBt+VH98dT9nBOYtoZWmzWuJr4/K4Awei0sN6kEJPDlbm ET1KGcLfHgdDRK3pgQ3abTSC8S+mjs7fPA2wdhydq9xkGhqJ7a/uL3TZ+hguRAOI2bcH SkRcuoVHuls8MfzJ76jI5vL/sQHErGrrVp49W/Pr7mR0TDcn+ZndbpUN0RAwoYm0BgXq 40Gs9tBsGYvKFlU+o/ywKSQBcWYF4CHLSbSBXJ8ZytfXmNoqZeWdHvLsH3YDcZgYFIRz WYyWkXTxwMxJkOsEL8BxPg3BfQ1Zu1tR1teBWlWIQyw6YCynHO14NCotpQrbGgpRxZp5 IhZA== X-Gm-Message-State: AJIora+qEHkO8X2Kb7pQrM9OM1NEbz+8rCNC6DJ/XhjdwLTvFUc5HPnJ Xv4SWMf+6EbOS6AoS2sWEzDmPgNNCz5sGhL+aA4= X-Received: by 2002:a17:906:99c5:b0:6fe:b069:4ab6 with SMTP id s5-20020a17090699c500b006feb0694ab6mr34890132ejn.436.1658319948163; Wed, 20 Jul 2022 05:25:48 -0700 (PDT) MIME-Version: 1.0 References: <20220720102956.1141634-1-zengjx95@gmail.com> In-Reply-To: From: jingxiang zeng Date: Wed, 20 Jul 2022 20:25:37 +0800 Message-ID: Subject: Re: [PATCH] kernel/sched/cputime: Fix unused value in cputime_adjust() To: Peter Zijlstra 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Peter Zijlstra =E4=BA=8E2022=E5=B9=B47=E6=9C=8820=E6= =97=A5=E5=91=A8=E4=B8=89 19:33=E5=86=99=E9=81=93=EF=BC=9A > > 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 =3D=3D 0) { > > 569 utime =3D rtime; > > 570 goto update; > > 571 } > > > > value_overwrite: Overwriting previous write to utime with > > the value of expression rtime - stime. > > 592 utime =3D rtime - stime; > > Coverity is being daft, the compiler has a dead-store-elimination pass. > > This way the code is more consistent / easier to ready. Thank you for your suggestion, I will try it.