Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4028232ioo; Wed, 25 May 2022 13:12:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDiDgCn/Ux212Q1aTR9IUqQqvxKo0VymQnxEPaNahicEl6ERPB2f3qHG5h98fQ58rGwbnO X-Received: by 2002:a17:90b:3a8b:b0:1e0:548:1490 with SMTP id om11-20020a17090b3a8b00b001e005481490mr12573563pjb.144.1653509557609; Wed, 25 May 2022 13:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653509557; cv=none; d=google.com; s=arc-20160816; b=FTkcOSwWQZqf6iGvoehq+zb81Ptz+W00ILF9pCYU6ikfBztH9ZUtdqbbkNKIASYCO3 9LZJ45/MN6WCRl+wzDQsY5UA0C64NsOzqfdfNcNpU35Q1BTZXAYanH8BxiKJ4rRQDzG6 w4c/2Zak9Ku7lqgoPgz6OPVYeHkq6irqXASRRYIHU3qOg7qmgf1tc3UkYF6LX3EBoVHR zN7GqIeL26tmEmMhPAsBNtJBFxO60qu6LQA8cd81TE9MtWizf896wbTf6Cp2fHbv7hYf kVTi6149mDkXn6I4IGK/GPi5s43jeL5doAKIRmNtTRZqScQLuPNSs07b3uqfkpVCAcbS vCHg== 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=mk7xRNKNX0AOjCU5G7KogWbcujD8+WpYXrtI2ETV4XE=; b=iJA9PwRrA6qJ7Qdw7w3/+afVTjwIXg1bE4NvX2En9iea02t2ajlZxJ+IGho9trS6QA Y+SIzk77hlz8GLzIXBPOPAblDYp8/1dk81lDOqROJkzc8n7uAxBy3AKSXxwYjmQ2qVKf sX/R45VcutXM4lcnE9or+c3TFpumc2yfQYnjms6oVOjI0eQUPCECjj8UFKFCWg9uDh8U Mk9kczAEPoGyFYbQeRF4Zq6g/b2jKAi1T2X4lkIYts8zGj+QgrAZ4rEfjd2MrwyYqBgT y+DuvMzvsUoCK0GcKmUun0LhTdFjQxKKnKSuAieQUxY0WKeMCch6kRV9N3dh8QSviGNK fKGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=jbyXtlbZ; 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 l73-20020a63914c000000b003fad857c97bsi4078015pge.314.2022.05.25.13.12.19; Wed, 25 May 2022 13:12:37 -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=jbyXtlbZ; 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 S242523AbiEXXMv (ORCPT + 99 others); Tue, 24 May 2022 19:12:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239226AbiEXXMt (ORCPT ); Tue, 24 May 2022 19:12:49 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED785BE49 for ; Tue, 24 May 2022 16:12:48 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1653433965; 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=mk7xRNKNX0AOjCU5G7KogWbcujD8+WpYXrtI2ETV4XE=; b=jbyXtlbZqNLrbFY1S2vnVXbfwQVr7DceO1EXyKdR6qAsHKO5XsshFKzXtd3RxBrN866jNM yQBnKE2abWf1OfF+EvaXxqIq1sNo05pgot/iYufWGjiRK/GBOJy0xPePZYOgo8uUXrdYeN m1yUzychkjRXcWo7joeT7mC8/u+Op6c= Date: Wed, 25 May 2022 02:12:44 +0300 MIME-Version: 1.0 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: vasily.averin@linux.dev 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: <20220524182244.42987-1-gautammenghani201@gmail.com> 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/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? un->semadj[sop->sem_num] = undo; } curr->semval += sem_op; <<<<<< VvS: here ? ipc_update_pid(&curr->sempid, q->pid); Thank you, Vasily Averin