Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2916403pxb; Mon, 17 Jan 2022 08:12:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVHOuaYj2Nq7KLnAIPFfMG7t4DU63RCjW1bEbNKdePt4rMjr/PEApgQARzLDgX2SSJdsSe X-Received: by 2002:a63:d417:: with SMTP id a23mr3812655pgh.297.1642435950213; Mon, 17 Jan 2022 08:12:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642435950; cv=none; d=google.com; s=arc-20160816; b=vIcO0h8ycLg55QB2jBBE3oJTOjRqFvTdrjaY8JFaMbtc+nQb2c+bWp/rg2ygFvL+Hd LEbLY9K1KryVv6q4ndzL3gHpEGBgpvy7y9DsdF7YuOnISxes8YruecKfiNVQLMmVaoeS f7Nx90YBoiaZbtGJ9Btm5Cct0ULfdiJY0zyPWE0nYS7kluDLcfYBGVgsoKmedrOtKHiH UvG60sntksONODGmBKG7sKJGI/SxMOamXRiGkq5pk9U/JrNAQ7IFFSWGKdJF197cGe19 +EsUdd3R5eYQ2FeI56VlGEVlEBlsAtbaRKplNUkos/CCu3N40k00EpogB1dA3lLYkMWL kcWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CymbHoqMdrBbxQE7Zla/8QpP1TV1cfWwuhrQrRdnQa4=; b=DEZgrEyP7jB99kZNj8pxjIS2hLpeHjA5dcyPypGrP2SRNfjo1KEbtfbOp2vK/GtgK2 upQD1oLDsbs74hkeGU3VjQsk4HdN4kkZXaq9qmiLJP2k8dJvi4g01l5ompM0F87B61Na v3ZtKo8ccGyzzjaJeqzgUImvf7XEPMAMDrLaX4Lxpy7Ze43JzRVQAs9iPHiWvrnpL23F cA6S5NTZxhSe5wkrdx63aPHT3EEu6hCSX3x80CZMcMEuOU7hSldPMqnFdUoA0fOhSEXz cwBtqM/VpE9BG9l78n/kO1xPcZbk+WFjNbClNtpfGCarx11SPDwAT7J9mIKdoH1ZsK/x uclg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Jbtj3zW9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si15677917plf.81.2022.01.17.08.12.17; Mon, 17 Jan 2022 08:12:30 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Jbtj3zW9; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237665AbiAQHrY (ORCPT + 99 others); Mon, 17 Jan 2022 02:47:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235240AbiAQHrW (ORCPT ); Mon, 17 Jan 2022 02:47:22 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F71CC061574 for ; Sun, 16 Jan 2022 23:47:22 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id p1-20020a1c7401000000b00345c2d068bdso22172182wmc.3 for ; Sun, 16 Jan 2022 23:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CymbHoqMdrBbxQE7Zla/8QpP1TV1cfWwuhrQrRdnQa4=; b=Jbtj3zW9qmlT0IcgcINehtnVuaCSqm4lkl3DLMTIKPJ+s9zFC9fT5eglDuqC1Lbu3u /aEZiBa4paZRCgkYmrKs1mfkNIr8CyJD8pBeFE+P+mMzOgpQVJ+jpwKGLY7sLPL6gD+t HZMw7IyqfOaevDTg7qmpt2LwYG7z0BOxqjkbKU2HGdpg9Qd/59tdiGi3Ntpx+pKG0izG xvaseFpuW9jSsKUrk2POWsdoZW0Hvs1nbv9ecARr+63rB4t2zTRT1ffKCzABKXlXFiEI GXkmjfuMVWEK2kYM8mAatCqJD1FCLl7iy6Op3YmbYcB1sxVmD+FABbLAK0Z1XS+ak9Dj C9BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CymbHoqMdrBbxQE7Zla/8QpP1TV1cfWwuhrQrRdnQa4=; b=P63LiKb2N3MFBcrskguWen2vORTbdN7FAwqzrmspp8dTK3rXcDubNxCZcPdDCH4Pxn +X+JkyrNCojWA0U7Jcwa4dGMxqFvB2T7nMMm6+/Lk9Ly5PtxVRLjU+XQJ/r7smAtzL6J 6LpEH1BOXlANu0wHIwZHd0LGTtYk34mOgmdssr4+cMXt+98bUqrpd4FHv+dPz484f5R9 9eYTA+LsZgiPODUT8onICclf3C3imHHliofJneeDVPkaosixify6nGQjpXt7Tke/ClTV dPQXiU2VxjVkt2fNk1KdIwFr0WJqzPLfOVJ6RGoNHi5+7hk/zCwqV2MMhKR+mZ6OADVO qc2Q== X-Gm-Message-State: AOAM530v8OEbLF2rSN6hW8MrdD5e/qlYQienUPd6lf5ok50FLwE3sG2T WqHXRJJdhBIYwoJPjXVVubc= X-Received: by 2002:a5d:588d:: with SMTP id n13mr5233368wrf.153.1642405640361; Sun, 16 Jan 2022 23:47:20 -0800 (PST) Received: from localhost.elektrobit.com (eth1-fw1-nbg6.eb.noris.de. [213.95.148.172]) by smtp.gmail.com with ESMTPSA id f9sm14591166wry.115.2022.01.16.23.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jan 2022 23:47:20 -0800 (PST) From: Lukas Bulwahn To: ytcoode@gmail.com Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, rostedt@goodmis.org, Lukas Bulwahn Subject: Re: [PATCH] tracing: Remove redundant assignment to variable ret' Date: Mon, 17 Jan 2022 08:41:17 +0100 Message-Id: <20220117074117.3770-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220116144805.102999-1-ytcoode@gmail.com> References: <20220116144805.102999-1-ytcoode@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Yuntao, when you consider removing dead-store assignments guided by some static analyzer, you need to check if the code you are looking at is actually missing an error-handling branch. In this case, ftrace_process_locs() may return -ENOMEM, and the caller needs to appropriately deal with this error return code. Your patch does not change the code at all, i.e., the compiled object code is the same as after the patch as before. Think about how to deal appropriately with the -ENOMEM return in this caller and submit a patch that implements the right error-handling branch or argue in your commit message why that is not needed at all. If you do not understand or cannot check such basic code properties for dead-store assignments, it might be better to work on some other aspect and area of the kernel repository. E.g., the kernel documentation build also has a few warnings that deserve patches to be fixed. Best regards, Lukas