Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp958450rdb; Tue, 30 Jan 2024 04:03:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFF0QL6V/z+wwhKE6AI0d5IbOaTEzZbd0XJBNZrx87h//qBldOX/Yy4KB0sYRVV1O5AoCSI X-Received: by 2002:a17:903:1108:b0:1d9:1cb5:558f with SMTP id n8-20020a170903110800b001d91cb5558fmr172961plh.2.1706616224295; Tue, 30 Jan 2024 04:03:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706616224; cv=pass; d=google.com; s=arc-20160816; b=j/3AYJSo+Bg/KFTESK80OQPhA6+cmMs98KAlbezZiVqve028mtSj3b1WVjdvMDFVUg wwzjWUK/A7qLJe1RGK7hJP6incBUWoDa98pifkyJg7xlgvGuC2jCJk1C2TFmkbMAvCbL M7QMuCTMXEpUQAdD7wPNbZn3tWBBhEJWlaxLZ8Cpmxpk2VzjrXIcgXt0egfrKh4//Qz7 7hi+PSskq362SaMNaH3a1ormLh5pig1x80xJhnLwtePat0dL8KLj02HC/RUyAd+HesVu oqhG+Pnh96buqVyGSMXDtP2r66LZeQNhypQQ5mYXQpGMDJxpFBAvSnm3KuujFf0GL8Xv Rt8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=sO87vxXe7MgsTrKUzYCx6o0XeHcdnLCZRarzckjuvQI=; fh=esPoLGEj8a7gX3q/+lYGzl+niIlBpt+AwQTkaQkIdOE=; b=GByTVze58UqkDWF6pVbhcXKtnjC+vrvbUkxJgIMSTRFhaBz6bQKEqzaqyjptFbMGju A2SNnLN7+QsJpJpmk4CeKMa0pAUr+Ib2tBF12R+EM2A1gu/vMvR0fEHk5q1i/ckxjqml 2s9cg+qu2s08jUF9hFlQEAnLU2ybAwMSMTgFYwOQD+Es7p+XxxJeSz48+Ra2bw0SS+Vk yz2vGEJZIhwhW3OOZOMkZYU3efmHqk20ZqTNKUiJehSwFrCNlLbmy6d8vkQpAxTTsEyk PSw/po8CO0YtMrMbKTHjIKp4emWMCo9/VRjxJBtmjGMwZLjsezcMoxCf9Uh/Ot81r0+B XqIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Wa8blGB5; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-44242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44242-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n6-20020a170902e54600b001d8a64238b5si7005126plf.174.2024.01.30.04.03.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:03:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Wa8blGB5; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-44242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44242-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id BE0DEB2D583 for ; Tue, 30 Jan 2024 09:21:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0749C59155; Tue, 30 Jan 2024 09:21:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Wa8blGB5" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 CA84D5821A; Tue, 30 Jan 2024 09:21:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706606490; cv=none; b=tlL0bXZBRfKCF4NP5zO42/0bSnqSQBG8uSGoGYgl8rL1/hKDq14Cmr98YfBelcG+puJwNE38wmJaXXZ4TEtH6ytFFopSy6iV02W1J4W/M8i6yPOZIfkZlBiJ0+pmH36AaT34t+D1n5sjzJZGDkre7r2r5PiuEH+ZenqhsiQH+dU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706606490; c=relaxed/simple; bh=ifAlKUG+CxYISCTy0oT7pt8UtA4YNwpiVo6jZ1ymT/U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oaVwDhBP8G9dgXqHSFh8zw98vJFN41lnuq0EoqNv2a6dVT30FruDPFtx5yPa0v7mn+EG8hJHyO4Rl7s1nuFxM/DlO58/A5aH7FJcSzq6tVPUHt8fvrzepecSl5wTXyDJCT4S/8AFH4zULbHrqUqWGKjzpq9CdlWR9p5mcW3p/A4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Wa8blGB5; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706606489; x=1738142489; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=ifAlKUG+CxYISCTy0oT7pt8UtA4YNwpiVo6jZ1ymT/U=; b=Wa8blGB5KLyjj0pjJxyWB2dZrrDAyNFQIGJ19R/mm3a7FYPNHxhv1J0W FsfRifQC4hwOOXr+bIaCEZ7bqdDkR6knvpIyLlRc6Yp6fjbdvpGG42Vzh /eUvDmz+iyqj3t4dntAwuu6y0eppuFINIqcN50LPm73nPwRQD8746w7rc PbI5PtzLfdp9KQ5L5Hnp2r2MzT7PPPKCjX6O/tFxqf09VZwGMTJEm4JgA HwRHz0hgjxSmZX+lRttsBGoafoMS0Nitg1LTarr7O9S4B8Igh32WoAJtk XwH+UyZ7w7O0GTR7zR/a3TRkIgP790P4ZFHoPOrFX2ARRWXwEUEJiz3D+ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10968"; a="3078810" X-IronPort-AV: E=Sophos;i="6.05,707,1701158400"; d="scan'208";a="3078810" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 01:21:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10968"; a="1119198673" X-IronPort-AV: E=Sophos;i="6.05,707,1701158400"; d="scan'208";a="1119198673" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.165]) by fmsmga005.fm.intel.com with ESMTP; 30 Jan 2024 01:21:25 -0800 Date: Tue, 30 Jan 2024 17:18:00 +0800 From: Xu Yilun To: Marco Pagani Cc: Moritz Fischer , Wu Hao , Xu Yilun , Tom Rix , linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fpga: remove redundant checks for bridge ops Message-ID: References: <20240124152408.88068-1-marpagan@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240124152408.88068-1-marpagan@redhat.com> On Wed, Jan 24, 2024 at 04:24:07PM +0100, Marco Pagani wrote: > 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); Also for state_show()? Thanks, Yilun > > device_unregister(&bridge->dev); > > base-commit: c849ecb2ae8413f86c84627cb0af06dffce4e215 > -- > 2.43.0 > >