[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <18a8da3f-4fdf-3da6-2023-c5c66176475d@ti.com>
Date: Tue, 19 May 2020 10:47:52 +0530
From: Kishon Vijay Abraham I <kishon@...com>
To: Dilip Kota <eswara.kota@...ux.intel.com>,
<linux-kernel@...r.kernel.org>, <vkoul@...nel.org>,
<devicetree@...r.kernel.org>
CC: <robh@...nel.org>, <andriy.shevchenko@...el.com>,
<cheol.yong.kim@...el.com>, <chuanhua.lei@...ux.intel.com>,
<qi-ming.wu@...el.com>, <yixin.zhu@...el.com>
Subject: Re: [RESEND PATCH v8 0/3] Add Intel ComboPhy driver
Dilip,
On 5/19/2020 9:26 AM, Dilip Kota wrote:
>
> On 5/18/2020 9:49 PM, Kishon Vijay Abraham I wrote:
>> Dilip,
>>
>> On 5/15/2020 1:43 PM, Dilip Kota wrote:
>>> This patch series adds Intel ComboPhy driver, respective yaml schemas
>>>
>>> Changes on v8:
>>> As per PHY Maintainer's request add description in comments for doing
>>> register access through register map framework.
>>>
>>> Changes on v7:
>>> As per System control driver maintainer's inputs remove
>>> fwnode_to_regmap() definition and use device_node_get_regmap()
>> Can you fix this warning and resend the patch?
>> drivers/phy/intel/phy-intel-combo.c:229:6: warning: ‘cb_mode’ may be used
>> uninitialized in this function [-Wmaybe-uninitialized]
>> ret = regmap_write(cbphy->hsiocfg, REG_COMBO_MODE(cbphy->bid), cb_mode);
>> ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/phy/intel/phy-intel-combo.c:204:24: note: ‘cb_mode’ was declared here
>> enum intel_combo_mode cb_mode;
>> ^~~~~~~
> I noticed this warning while preparing the patch.
> It sounds like false warning because:
> 1.) "cb_mode" is initialized in the switch case based on the "mode =
> cbphy->phy_mode;"
> 2.) cbphy->phy_mode is initialized during the probe in
> "intel_cbphy_fwnode_parse()" with one of the 3 values.
> PHY_PCIE_MODE, PHY_SATA_MODE, PHY_XPCS_MODE.
> 3.) There is no chance of "cbphy->phy_mode" having different value.
> 4.) And "cb_mode" will be initialized according to the "mode = cbphy->phy_mode;"
> 5.) Hence, there is no chance of "cb_mode" getting accessed uninitialized.
Let's try to keep the compiler happy. Please fix this warning.
Thanks
Kishon
Powered by blists - more mailing lists