[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <985729eb-08c5-4c0d-9172-1642a45caffd@redhat.com>
Date: Thu, 1 Feb 2024 16:14:15 +0100
From: Marco Pagani <marpagan@...hat.com>
To: Xu Yilun <yilun.xu@...ux.intel.com>
Cc: Moritz Fischer <mdf@...nel.org>, Wu Hao <hao.wu@...el.com>,
Xu Yilun <yilun.xu@...el.com>, Tom Rix <trix@...hat.com>,
linux-fpga@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] fpga: remove redundant checks for bridge ops
On 2024-01-30 10:18, Xu Yilun wrote:
> 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 <marpagan@...hat.com>
>> ---
>> 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()?
Right, I missed that one. I'll remove it in v2
Thanks,
Marco
Powered by blists - more mailing lists