Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4166434ioo; Wed, 25 May 2022 17:07:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcemrtwI7uJ/3ybWGBH6NS1YX/HoioPc3WE3nVa5ZCekqFBmtC3sL0eU+n3wehkxJF5nUI X-Received: by 2002:a17:902:f641:b0:15f:21f8:92a1 with SMTP id m1-20020a170902f64100b0015f21f892a1mr36705014plg.56.1653523675227; Wed, 25 May 2022 17:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653523675; cv=none; d=google.com; s=arc-20160816; b=wioMN4+2+Ar5CqC04wR+1ieHCkdEpfGqKleWsJRdAj6rrS9FTGZcqOaWeutt6E5x4p U53S/1l0ENEUrd4iFK6LgaMY+A7Gq5XxAXnkh09X7q+cEiNjIiZITpOC4/iHgO/GilkV V+HQSe/oq8I0cOLGJQaoMsfIvpJqXnESuE4c4kdFaPpFEmXVBThGVP6f7ciscVrz8OPc obMYYPufFcZraWAG6O96KwHO03aEHRS9+jq+L9VGUFThaO5C7MQzhc2VAwaD3deKRXRY pLEbFafFqmUUfXzO3sxGbKIHxgKUiLcFaigbg1R6SSqv638rQvzKF5NKl7Xv4UeKGwVb daFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:content-language:subject:from:mime-version:date :dkim-signature:message-id; bh=B9G5hUzauDQzBCUae+mMyfXNu37nLvF3U6X5lDAQKU8=; b=aFjtkdSJMlFuqgfz3Tl7+xOzjU0hGMgcbPZ6M/IJNjB0OodBw0QxDLq1ocgz98noaV +zcq2n9Jq8rLbIAI958ACbkORORRh+bmDWjzCAylFKsjZoDM7zLtXrxHRTtrn7msH3XJ UBOKsZpBm8hHNaCoDZ+G/E5xQ1w7BZxjYOKfj5/eAAz7deiGOKMho13BRN1+Qs6FnDju FiD1tSZUArhp/nLydAnAztEk/OBD9wjFSDUQOhMueMq6OL00g8+v+cZLIiVBp0aWiEJq xxz+xkBHPluR+nS4EJSZySIw/0W0ep5lspfB40qthvQn2ePkZX6JVtsZA7CTTgVQWRdw 81og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Cj4xv31b; 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=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a1709026b4800b00158f13b4872si25011plt.7.2022.05.25.17.07.42; Wed, 25 May 2022 17:07:55 -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=@linux.dev header.s=key1 header.b=Cj4xv31b; 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=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243688AbiEYEUp (ORCPT + 99 others); Wed, 25 May 2022 00:20:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230048AbiEYEUp (ORCPT ); Wed, 25 May 2022 00:20:45 -0400 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8BFD55345 for ; Tue, 24 May 2022 21:20:43 -0700 (PDT) Message-ID: <3e686290-14e4-a4e9-3825-afb011b8c0e4@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1653452442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=B9G5hUzauDQzBCUae+mMyfXNu37nLvF3U6X5lDAQKU8=; b=Cj4xv31bNF8YNaPcGnC1xELW0EyErW5WTV859fFs4ztuqVR4Xwh+1JDuOk4bTATL1kXrnB /AABN63X9RWpLQ80c7v7K8nrVtjvaj9IXQKIlwxJ0Z0Omt5cChBvbiYz/cGSGViO4ec40c /Eqs7CzNMxJlnO7aNBd/AFf90RDNnno= Date: Wed, 25 May 2022 07:20:40 +0300 MIME-Version: 1.0 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Vasily Averin Subject: Re: [PATCH] ipc: Remove dead code in perform_atomic_semop() Content-Language: en-US To: Gautam Menghani , akpm@linux-foundation.org, shakeelb@google.com, mhocko@suse.com, manfred@colorfullife.com Cc: linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, skhan@linuxfoundation.org References: <20220524182244.42987-1-gautammenghani201@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 5/25/22 02:12, vasily.averin@linux.dev wrote: > On 5/24/22 21:22, Gautam Menghani wrote: >> Remove the line which is dead code. Fixes the clang scan warning: >> warning: Value stored to 'result' is never read [deadcode.DeadStores] >> result = curr->semval; >> >> Signed-off-by: Gautam Menghani >> --- >> ipc/sem.c | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/ipc/sem.c b/ipc/sem.c >> index 0dbdb98fdf2d..156824bcda47 100644 >> --- a/ipc/sem.c >> +++ b/ipc/sem.c >> @@ -766,7 +766,6 @@ static int perform_atomic_semop(struct sem_array *sma, struct sem_queue *q) >> for (sop = sops; sop < sops + nsops; sop++) { >> curr = &sma->sems[sop->sem_num]; >> sem_op = sop->sem_op; >> - result = curr->semval; >> >> if (sop->sem_flg & SEM_UNDO) { >> int undo = un->semadj[sop->sem_num] - sem_op; > > Perhaps it would be better to keep the "result" but use it in the > marked line below, like it was done in previous part of this function? Sorry, I was wrong. Reviewed-by: Vasily Averin