Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp3203567ybg; Sat, 6 Jun 2020 14:07:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIs7F5C7xhXubxzBRDMG8zTx/xpdmEyZ8tZZWF7tujgOIB7xuE7r4t4rlc5wAEK5UaB/An X-Received: by 2002:a17:906:55c9:: with SMTP id z9mr15377060ejp.276.1591477663886; Sat, 06 Jun 2020 14:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591477663; cv=none; d=google.com; s=arc-20160816; b=Nn/nYPrJ0wagR8gwgyjrQLYVcQ/z70rG+Ys6ymVhdX/W3UjWdsMHYBACkBQ2vkbLQP qG7LktcraGmlkfLQJ6Bh4uU2W+rbXCaub4yIyRONeIAbLrPLzvMl2h8d92QAFPyXAm4o CRPlx1v8CqSFVJ73lp2z1OFwEiCDAr3H7Js6Gl0OVrHghImApdvDhmJJky7LDkRoZ4pK Sqck4RE5uqyaH+meCdgzvmV9lhSvStB+wR6OaA/ewkTrIWc97yDy9Hq9fzoB6dFWZcrj gPrb1kri2rzWXzgMY0QmXB6mLr6dWWZwkbAH8ctlBSG7O2KYGld+ZtpTaECXaYyTP4Nj 90qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=EhPcZ8ZKsOGQJhM7Y4SG5KeIBZOSBJJrvqPyygwuVxE=; b=qVPqbdKo6SjDQv37Oa+W4CCZOdAPAe60KacENCGoqEAwaGcKRHtWEN/jfuEx4yXpEl kfCbu0jViIaqL7dwp6GfCMN+tKpMUrG2bnbQxsypHcCZbYKzgF3EDE+jaEqIfNHYhR+J GjbMfU4PKMl+em2+jhc2j0Es4v3BDJROcioMCGJXnnJz6iErQ+DZMZRXf94wId4NeIZY cPwp/jACSgg9dsWKbKJHlosg6sK8cSQJ45ABvJHcFQuooXIFSkhSJY3tmY3tATaOSKRF HvwRjTSfN7z75T01yBWHZ3pi0w549Kn3lUYWOOD6L2ov4o3SrHxFctEHbuSlUtq4lxe1 j5EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eA7geEuj; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si5984001edp.566.2020.06.06.14.07.20; Sat, 06 Jun 2020 14:07:43 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=eA7geEuj; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728891AbgFFVDC (ORCPT + 99 others); Sat, 6 Jun 2020 17:03:02 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46937 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728686AbgFFVC4 (ORCPT ); Sat, 6 Jun 2020 17:02:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591477375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=EhPcZ8ZKsOGQJhM7Y4SG5KeIBZOSBJJrvqPyygwuVxE=; b=eA7geEujKYkZ18qb1V8UGD3yX9daeOn8lNq2BA2c3OTTjiZzp7b2vIB4GFy/4aGd/MWOxX XRFRF0BC3B7tvI4SfbHDR8y8jkvCZU46TK6/XpSwyy0GjQpSbWq3J5nmgzuSgKeu1HJJl0 +rU0qCPoCjPEI4ORkQZJnphpsE8sKKw= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-231-zrItblCxPj-n0ocVHaT3EQ-1; Sat, 06 Jun 2020 17:02:53 -0400 X-MC-Unique: zrItblCxPj-n0ocVHaT3EQ-1 Received: by mail-qk1-f199.google.com with SMTP id w14so10830156qkb.0 for ; Sat, 06 Jun 2020 14:02:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EhPcZ8ZKsOGQJhM7Y4SG5KeIBZOSBJJrvqPyygwuVxE=; b=U5JUViS6+yIr6bsa1GdpEnRDqPQmAoYC5Il3NoqmJnOy5Hp5Y+VpqnnehWDTpB1FO5 gQrHSMg2YJueptrdcWLvS8mJynHIBtT0/58885Dm2egHuueewz5pWYkZfCk4arDlHAO1 wosXiUZEC6ii3SRRe0pZkzOGfSAV2mZNFNlWsjo9SWOkKg5FwFbkuwtxqy3hH2lpadXo uu29+i5sAhYSOqnMraliTQaYmDL+RnbcVp5wTF+sxKCWNPwTKThHRzJTWyvGYymFtaSq KY70xK5saec7tSV0Cc6JLe0Ruv3GWHiAFVB4quXO210ynmEKbLJU+/qy5DjwjpS6QOLD 7fcA== X-Gm-Message-State: AOAM530r5xsEWsyDUMONNTUVFUmZL4bOD8/XuWpwHuy5UJFLmliSjTl7 20Jn1JmCAYOMqUTgysRPCtDDu1snJdIiasOuXxLNcGXlhcrdyB+Qb4TL6MaeWQt3Dhal4bZJFhw lgpfoK26SUZ7a1tyYGjZL08G+ X-Received: by 2002:a37:9586:: with SMTP id x128mr15600406qkd.312.1591477372798; Sat, 06 Jun 2020 14:02:52 -0700 (PDT) X-Received: by 2002:a37:9586:: with SMTP id x128mr15600393qkd.312.1591477372591; Sat, 06 Jun 2020 14:02:52 -0700 (PDT) Received: from trix.remote.csb (075-142-250-213.res.spectrum.com. [75.142.250.213]) by smtp.gmail.com with ESMTPSA id d14sm3025299qkg.25.2020.06.06.14.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jun 2020 14:02:51 -0700 (PDT) From: trix@redhat.com To: mdf@kernel.org Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org, Tom Rix Subject: [PATCH 1/1] fpga: dfl: Fix dead store Date: Sat, 6 Jun 2020 14:02:41 -0700 Message-Id: <20200606210241.7459-2-trix@redhat.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20200606210241.7459-1-trix@redhat.com> References: <20200606210241.7459-1-trix@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tom Rix Using clang's scan-build/view this issue was flagged in fpga-mgr.c drivers/fpga/fpga-mgr.c:585:3: warning: Value stored to 'ret' is never read [deadcode.DeadStores] ret = id; A similar issue was flagged in fpga-bridge. So remove the unused stores. Signed-off-by: Tom Rix --- drivers/fpga/fpga-bridge.c | 6 ++---- drivers/fpga/fpga-mgr.c | 4 +--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index 4bab9028940a..2deccacc3aa7 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -328,7 +328,7 @@ struct fpga_bridge *fpga_bridge_create(struct device *dev, const char *name, void *priv) { struct fpga_bridge *bridge; - int id, ret = 0; + int id, ret; if (!name || !strlen(name)) { dev_err(dev, "Attempt to register with no name!\n"); @@ -340,10 +340,8 @@ struct fpga_bridge *fpga_bridge_create(struct device *dev, const char *name, return NULL; id = ida_simple_get(&fpga_bridge_ida, 0, 0, GFP_KERNEL); - if (id < 0) { - ret = id; + if (id < 0) goto error_kfree; - } mutex_init(&bridge->mutex); INIT_LIST_HEAD(&bridge->node); diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c index e05104f5e40c..f38bab01432e 100644 --- a/drivers/fpga/fpga-mgr.c +++ b/drivers/fpga/fpga-mgr.c @@ -581,10 +581,8 @@ struct fpga_manager *fpga_mgr_create(struct device *dev, const char *name, return NULL; id = ida_simple_get(&fpga_mgr_ida, 0, 0, GFP_KERNEL); - if (id < 0) { - ret = id; + if (id < 0) goto error_kfree; - } mutex_init(&mgr->ref_mutex); -- 2.26.0