Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1187147rdb; Wed, 24 Jan 2024 07:24:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCHc9ElKlG/DPbPFNW1bH1Wvb2y4asyOVoSWwfRTgKoYoWf1Mfeti5l89fYJ2cLHG2hAVM X-Received: by 2002:a37:e319:0:b0:783:8dd5:751c with SMTP id y25-20020a37e319000000b007838dd5751cmr8653851qki.106.1706109886722; Wed, 24 Jan 2024 07:24:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706109886; cv=pass; d=google.com; s=arc-20160816; b=uRaxH5YXU1Ac6XOrxsdz4AyjZFKh1Sxpau1B02qx6IVw8jr3rwzluKHzmlzuFpbuUP FzsbzxUTe7YpPnEt89BPKpoRrkZYk3QqYj14lbBD7Y3a2zAUimspFgY35k4S42yt/UaS cPorEnDJ1TFgvlV3JzfkLkugTV1a2linqA69dJJU7fsAiUP64i4wqBgWItrn7l/+U5iE iPCW6HUvNtA2RXhljyRDRdvWIgyKgtfPGYdB06wG/lMx6QMtHxhg9EXOIq7yVUyAaGBS bc5C2tgt+X7gPoGNJlB7kv5tZlqMDVfC9rUAhzBlEVpEnLHwkNHwib3TRldUFpqF1yZq 6k5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=+IWdzfKReTN2PlVowzK8vMbbI1VNfdZNNhWBnWl7Hmk=; fh=JZuiBND46DUo1zyHQr93LFkt9PtZIzAjrAt2twlOVq4=; b=LPp9azOoJQ6NIsLYEiggKwyIBgEI8S6PeCI/c3bNCQS0VXSu9oglFXcwkq5OECDBg+ ap/VDVHEnQsnlyWvX6bKcW69yBY7cI3NAEyQIJBkN2d3c6ZDJXBj2g+fumhTyGs7aNm/ Aq+Ormo9O8UyDZO5Z5/dV1Vwpi8NoGlYahaDd9XynEhgkFnhaJMVOlYq9NKD8ygVJDym rWtDmCu8uJ3MlJIyprrnPmcIlZ7dpE+nrPoyEwQAH3mnGtheks/ReVcygxYhUxEc+vYI /H3hPl3BwzuZtFWiEhqPOzLUswzaVVbyV1Hs1NWHTqZzkQTwgPNg/qj/1MF4kB0TCZYq PCYg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hBCFQQWu; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-37242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37242-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s17-20020ae9f711000000b007838d584725si10103807qkg.554.2024.01.24.07.24.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 07:24:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hBCFQQWu; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-37242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37242-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 797BC1C2157D for ; Wed, 24 Jan 2024 15:24:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C67A07A71F; Wed, 24 Jan 2024 15:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hBCFQQWu" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93FAF2BAE5 for ; Wed, 24 Jan 2024 15:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706109881; cv=none; b=L9qiUdfc/e2XZDFaMm3/6OhSOY2dezXlFMxNHGgonEBC0dhjtm5rYvB4gHsq6rY0LKsRb+sJFHX1FVRWARZtZSiZ2lxnaYJRoXexxYAM4W2HCsWGmRoZcZJwNLHvSOzqhu22V9IMkIgwqEVlN63jY+hDwqUItV/fn+NOOKJO40U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706109881; c=relaxed/simple; bh=TIoLI0NOg9IhGkDnZ07u3QedeQaS0I76rjo0TfaQbW0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oRoYapbPgKw80Hzo6MBXFgNR3iNuZ0LB91QRfAx6FI0tLz+gXt595793Ac21c8cCSQkUJshF++RNVngrpQ06AsOQOF6u9gPGwHL01O+GFU3I2Y8QPIA+F/i2wZvjMlZBEaDFlVcIhJ1n21B0G5UXt8138kqy/aj63uDMH7zEJI8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=hBCFQQWu; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706109877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=+IWdzfKReTN2PlVowzK8vMbbI1VNfdZNNhWBnWl7Hmk=; b=hBCFQQWuMf48OjUr1SSOpkR/4xOwyGp15CJ6XlNsq60j5Id7FbQasL9Q63Cws59gAVKihp u8gtbzKsoqbnoCGFW6ZKYqFjnmKkJCsFjrvFsYolhQ5NfCHC2WHIGiisdHhFAKYrhzetwC GNaXC/nenrYGnYA3T4g3UULy3nuPQbg= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-150-KkuuzhNRMUeijUvHYh02Ug-1; Wed, 24 Jan 2024 10:24:36 -0500 X-MC-Unique: KkuuzhNRMUeijUvHYh02Ug-1 Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-7832a94b051so744388185a.2 for ; Wed, 24 Jan 2024 07:24:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706109875; x=1706714675; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+IWdzfKReTN2PlVowzK8vMbbI1VNfdZNNhWBnWl7Hmk=; b=Gy8aLK12841Ug1sPhEJxj9rjsH2MeemR84eJ2ttxk4YfP18YgAk1gvMHtfuy4Q1jcs myYMT0Zpy4Fog0qBTcXg2KgFKyj2gXJo3TvBRlFnHipysMUIH772cgNUuqEyz0A3YaHy GDg2G6O7k3FFKy7R0R9SNPKRVqz25hXYydff4jtxHt0PY30e7VghDliQsSZGQ8Hoz0as EfEHqbxcBy+heOmbtyRwxzx8IXefzlESa1EolsBjIc0MNqwuF58dIxbmVPpxucDZxMdG JlFyMu6JzQGJp91RmLTuq9IfCbxMZi+JvQycq9KSAROdbGpXzVIr9EcD/tx3rTNP3sF9 c//A== X-Gm-Message-State: AOJu0YzWG3ezDrubrI/xPlaG+Bj/+8Kmf0YuV+fdYcoDMQ/16ROZcFq9 mrkiKOg+ZOfxXfG6wUGNs8xt5OH+a3XTSkxwthFgwjPSeBl0felOLqJDq7vCvZU+eZY4JZa/jLg 79k9F4bG4v8QSywrfpwH9UT3VpmqKvGhG0chZj5cJuZjfj149L84QHGmGS1Sg X-Received: by 2002:a05:620a:b09:b0:781:4d22:da3 with SMTP id t9-20020a05620a0b0900b007814d220da3mr8139814qkg.138.1706109875718; Wed, 24 Jan 2024 07:24:35 -0800 (PST) X-Received: by 2002:a05:620a:b09:b0:781:4d22:da3 with SMTP id t9-20020a05620a0b0900b007814d220da3mr8139801qkg.138.1706109875523; Wed, 24 Jan 2024 07:24:35 -0800 (PST) Received: from klayman.redhat.com (net-2-34-24-75.cust.vodafonedsl.it. [2.34.24.75]) by smtp.gmail.com with ESMTPSA id pa15-20020a05620a830f00b007815b84dbb3sm4126401qkn.49.2024.01.24.07.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 07:24:35 -0800 (PST) From: Marco Pagani To: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix Cc: Marco Pagani , linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] fpga: remove redundant checks for bridge ops Date: Wed, 24 Jan 2024 16:24:07 +0100 Message-ID: <20240124152408.88068-1-marpagan@redhat.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Commit 0d70af3c2530 ("fpga: bridge: Use standard dev_release for class driver") introduced a check in fpga_bridge_register() that prevents registering a bridge without ops, making checking on every call redundant. Signed-off-by: Marco Pagani --- drivers/fpga/fpga-bridge.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c index a024be2b84e2..e0a5ef318f5e 100644 --- a/drivers/fpga/fpga-bridge.c +++ b/drivers/fpga/fpga-bridge.c @@ -30,7 +30,7 @@ int fpga_bridge_enable(struct fpga_bridge *bridge) { dev_dbg(&bridge->dev, "enable\n"); - if (bridge->br_ops && bridge->br_ops->enable_set) + if (bridge->br_ops->enable_set) return bridge->br_ops->enable_set(bridge, 1); return 0; @@ -48,7 +48,7 @@ int fpga_bridge_disable(struct fpga_bridge *bridge) { dev_dbg(&bridge->dev, "disable\n"); - if (bridge->br_ops && bridge->br_ops->enable_set) + if (bridge->br_ops->enable_set) return bridge->br_ops->enable_set(bridge, 0); return 0; @@ -401,7 +401,7 @@ void fpga_bridge_unregister(struct fpga_bridge *bridge) * If the low level driver provides a method for putting bridge into * a desired state upon unregister, do it. */ - if (bridge->br_ops && bridge->br_ops->fpga_bridge_remove) + if (bridge->br_ops->fpga_bridge_remove) bridge->br_ops->fpga_bridge_remove(bridge); device_unregister(&bridge->dev); base-commit: c849ecb2ae8413f86c84627cb0af06dffce4e215 -- 2.43.0