Re: [PATCH] staging: iio: ad7150: use ternary operating to ensure 0/1 value
On Mon, 17 Jun 2019 11:40:34 +0300 Dan Carpenter wrote: > On Sun, Jun 16, 2019 at 11:15:16AM +0100, Jonathan Cameron wrote: > > On Fri, 14 Jun 2019 13:50:59 -0300 > > Melissa Wen wrote: > > > > > Remove idiom and use ternary operator for consistently trigger 0/1 value > > > on variable declaration. > > > > > > Signed-off-by: Melissa Wen > > Hi Melissa, > > > > In general I would consider this unnecessary churn as, whilst > > it's no longer a favoured idiom, it is extremely common in the > > kernel. > > It's still my favourite... Why wouldn't people like it? It feels like > last week I just saw someone send a bunch of: > > - foo = (bar == baz) ? 1 : 0; > + foo = (bar == baz); > > patches and I thought it was an improvement at the time... That one is nice enough, it's the !! that Linus came out fairly strongly against though not sure I can find the particular email. That one is a fairly kernel specific idiom that I'll be honest I've rarely seen elsewhere ;) I remember wincing at the thread on this as it was an idiom I personally rather liked. In cases where it doesn't matter because foo doesn't need to 1 or 0 then what you have is nice and clean. I can't say it's one I care that much about, but I am happy if code that happens to be under cleanup anyway has this little bit made the 'preferred style'. There is something to said for consistency. Jonathan > > regards, > dan carpenter > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: rtl8188eu: cleanup lines ending with a '('
Cleanup checkpatch issues in usb_halinit.c. CHECK: Lines should not end with a '(' Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index 70c02c49b177..69008accb015 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -469,10 +469,7 @@ static void usb_AggSettingTxUpdate(struct adapter *Adapter) * *--- */ -static void -usb_AggSettingRxUpdate( - struct adapter *Adapter - ) +static void usb_AggSettingRxUpdate(struct adapter *Adapter) { struct hal_data_8188e *haldata = Adapter->HalData; u8 valueDMA; @@ -1044,10 +1041,7 @@ static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool eeprom->mac_addr)); } -static void -readAdapterInfo_8188EU( - struct adapter *adapt - ) +static void readAdapterInfo_8188EU(struct adapter *adapt) { struct eeprom_priv *eeprom = GET_EEPROM_EFUSE_PRIV(adapt); @@ -1067,9 +1061,7 @@ readAdapterInfo_8188EU( Hal_ReadThermalMeter_88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag); } -static void _ReadPROMContent( - struct adapter *Adapter - ) +static void _ReadPROMContent(struct adapter *Adapter) { struct eeprom_priv *eeprom = GET_EEPROM_EFUSE_PRIV(Adapter); u8 eeValue; @@ -1782,11 +1774,8 @@ void rtw_hal_get_hwreg(struct adapter *Adapter, u8 variable, u8 *val) /* Description: */ /* Query setting of specified variable. */ /* */ -u8 rtw_hal_get_def_var( - struct adapter *Adapter, - enum hal_def_variable eVariable, - void *pValue - ) +u8 rtw_hal_get_def_var(struct adapter *Adapter, enum hal_def_variable eVariable, + void *pValue) { struct hal_data_8188e *haldata = Adapter->HalData; u8 bResult = _SUCCESS; -- 2.22.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: rtl8188eu: remove hal_init_macaddr()
Function hal_init_macaddr() just calls rtw_hal_set_hwreg(). Use rtw_hal_set_hwreg() directly and remove hal_init_macaddr(). Signed-off-by: Michael Straube --- drivers/staging/rtl8188eu/hal/hal_com.c | 6 -- drivers/staging/rtl8188eu/hal/usb_halinit.c | 3 ++- drivers/staging/rtl8188eu/include/hal_com.h | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/hal_com.c b/drivers/staging/rtl8188eu/hal/hal_com.c index ff481fbd074c..95f1b1431373 100644 --- a/drivers/staging/rtl8188eu/hal/hal_com.c +++ b/drivers/staging/rtl8188eu/hal/hal_com.c @@ -283,9 +283,3 @@ bool hal_mapping_out_pipe(struct adapter *adapter, u8 numoutpipe) } return result; } - -void hal_init_macaddr(struct adapter *adapter) -{ - rtw_hal_set_hwreg(adapter, HW_VAR_MAC_ADDR, - adapter->eeprompriv.mac_addr); -} diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c index 69008accb015..ac5552050752 100644 --- a/drivers/staging/rtl8188eu/hal/usb_halinit.c +++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c @@ -746,7 +746,8 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter) _InitDriverInfoSize(Adapter, DRVINFO_SZ); _InitInterrupt(Adapter); - hal_init_macaddr(Adapter);/* set mac_address */ + rtw_hal_set_hwreg(Adapter, HW_VAR_MAC_ADDR, + Adapter->eeprompriv.mac_addr); _InitNetworkType(Adapter);/* set msr */ _InitWMACSetting(Adapter); _InitAdaptiveCtrl(Adapter); diff --git a/drivers/staging/rtl8188eu/include/hal_com.h b/drivers/staging/rtl8188eu/include/hal_com.h index 2f7bdade40a5..93cbbe7ba1fd 100644 --- a/drivers/staging/rtl8188eu/include/hal_com.h +++ b/drivers/staging/rtl8188eu/include/hal_com.h @@ -148,5 +148,4 @@ void hal_set_brate_cfg(u8 *brates, u16 *rate_cfg); bool hal_mapping_out_pipe(struct adapter *adapter, u8 numoutpipe); -void hal_init_macaddr(struct adapter *adapter); #endif /* __HAL_COMMON_H__ */ -- 2.22.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] Modify functions return type to void
This patchset modifies two function return types to void. The return values of the function are never checked and they always return success. This resolves coccicheck Unneeded variable warnings PATCH[1/2] : This patch modifies return type of function loadparam() to void. PATCH[2/2] : This patch modifies return type of rtw_reset_drv_sw() to void. Shobhit Kukreti (2): staging: rtl8723bs: os_dep: Modify return type of function loadparam(..) to void staging: rtl8723bs: os_dep: Modify return type of function rtw_reset_drv_sw() to void. drivers/staging/rtl8723bs/include/osdep_intf.h | 2 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c| 8 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: rtl8723bs: os_dep: Modify return type of function rtw_reset_drv_sw() to void.
The function rtw_reset_drv_sw() return value is set to _SUCCESS. The return value is never checked when the function is called. Modified the return value to void to remove "Unneeded Variable warning of coccicheck. Signed-off-by: Shobhit Kukreti --- drivers/staging/rtl8723bs/include/osdep_intf.h | 2 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c| 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/osdep_intf.h b/drivers/staging/rtl8723bs/include/osdep_intf.h index 0ea91a1..40313d1 100644 --- a/drivers/staging/rtl8723bs/include/osdep_intf.h +++ b/drivers/staging/rtl8723bs/include/osdep_intf.h @@ -46,7 +46,7 @@ void devobj_deinit(struct dvobj_priv *pdvobj); u8 rtw_init_drv_sw(struct adapter *padapter); u8 rtw_free_drv_sw(struct adapter *padapter); -u8 rtw_reset_drv_sw(struct adapter *padapter); +void rtw_reset_drv_sw(struct adapter *padapter); void rtw_dev_unload(struct adapter *padapter); u32 rtw_start_drv_threads(struct adapter *padapter); diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index bd8e316..79d073e 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -705,9 +705,8 @@ void devobj_deinit(struct dvobj_priv *pdvobj) kfree(pdvobj); } -u8 rtw_reset_drv_sw(struct adapter *padapter) +void rtw_reset_drv_sw(struct adapter *padapter) { - u8 ret8 = _SUCCESS; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter); @@ -737,7 +736,6 @@ u8 rtw_reset_drv_sw(struct adapter *padapter) rtw_set_signal_stat_timer(&padapter->recvpriv); - return ret8; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: rtl8723bs: os_dep: Modify return type of function loadparam(..) to void
The function static uint loadparam(struct adapter *padapter, _nic_hdl pnetdev) return type is modified to void. The initial return value was always returning _SUCCESS and the return value is never checked when the function is called. This resolves coccicheck warnings of unneeded variables. Signed-off-by: Shobhit Kukreti --- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 8a9d838..bd8e316 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -223,9 +223,8 @@ int _netdev_open(struct net_device *pnetdev); int netdev_open (struct net_device *pnetdev); static int netdev_close (struct net_device *pnetdev); -static uint loadparam(struct adapter *padapter, _nic_hdl pnetdev) +static void loadparam(struct adapter *padapter, _nic_hdl pnetdev) { - uint status = _SUCCESS; struct registry_priv *registry_par = &padapter->registrypriv; registry_par->chip_version = (u8)rtw_chip_version; @@ -330,7 +329,6 @@ static uint loadparam(struct adapter *padapter, _nic_hdl pnetdev) registry_par->qos_opt_enable = (u8)rtw_qos_opt_enable; registry_par->hiq_filter = (u8)rtw_hiq_filter; - return status; } static int rtw_net_set_mac_address(struct net_device *pnetdev, void *p) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: rtl8723bs: os_dep: modified return type of function rtw_suspend_wow() to void
Changed return type of function rtw_suspend_wow() to void. The function always return _SUCCESS and the value is never checked in the calling function. Resolves coccicheck Unneeded variable "ret" warning. Signed-off-by: Shobhit Kukreti --- drivers/staging/rtl8723bs/include/drv_types.h | 2 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/drv_types.h b/drivers/staging/rtl8723bs/include/drv_types.h index 0fd84c9..96346ce 100644 --- a/drivers/staging/rtl8723bs/include/drv_types.h +++ b/drivers/staging/rtl8723bs/include/drv_types.h @@ -673,7 +673,7 @@ int rtw_config_gpio(struct net_device *netdev, int gpio_num, bool isOutput); #endif #ifdef CONFIG_WOWLAN -int rtw_suspend_wow(struct adapter *padapter); +void rtw_suspend_wow(struct adapter *padapter); int rtw_resume_process_wow(struct adapter *padapter); #endif diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index e1e871e..6b26af3 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -1289,14 +1289,13 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter) } #ifdef CONFIG_WOWLAN -int rtw_suspend_wow(struct adapter *padapter) +void rtw_suspend_wow(struct adapter *padapter) { u8 ch, bw, offset; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct net_device *pnetdev = padapter->pnetdev; struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); struct wowlan_ioctl_param poidparam; - int ret = _SUCCESS; DBG_871X("==> " FUNC_ADPT_FMT " entry\n", FUNC_ADPT_ARG(padapter)); @@ -1364,7 +1363,6 @@ int rtw_suspend_wow(struct adapter *padapter) DBG_871X_LEVEL(_drv_always_, "%s: ### ERROR ### wowlan_mode =%d\n", __func__, pwrpriv->wowlan_mode); } DBG_871X("<== " FUNC_ADPT_FMT " exit\n", FUNC_ADPT_ARG(padapter)); - return ret; } #endif /* ifdef CONFIG_WOWLAN */ -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/3] Change function return type to void
This patchset modifies function return types to void. The return values of the function are never checked and they always return success. This resolves coccicheck Unneeded variable warnings. PATCH[1/3]: This patch changes return type of rtw_suspend_normal() to void PATCH[2/3]: This patch changes return type of rtw_suspend_wow() to void PATCH[3/3]: This patch changes return type of rtw_init_default_value to void Shobhit Kukreti (3): staging: rtl8723bs: os_dep: Change return type of function rtw_suspend_normal() to void staging: rtl8723bs: os_dep: modified return type of function rtw_suspend_wow() to void staging: rtl8723bs: os_dep: Change return type of rtw_init_default_value() to void drivers/staging/rtl8723bs/include/drv_types.h | 2 +- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 14 -- 2 files changed, 5 insertions(+), 11 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: rtl8723bs: os_dep: Change return type of rtw_init_default_value() to void
rtw_init_default_value() func always returns a value (u8)_SUCCESS. Modified return type to void to resolve coccicheck warnings of unneeded variable. Signed-off-by: Shobhit Kukreti --- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 6b26af3..22d4461 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -601,9 +601,8 @@ void rtw_stop_drv_threads (struct adapter *padapter) rtw_hal_stop_thread(padapter); } -static u8 rtw_init_default_value(struct adapter *padapter) +static void rtw_init_default_value(struct adapter *padapter) { - u8 ret = _SUCCESS; struct registry_priv *pregistrypriv = &padapter->registrypriv; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -665,7 +664,6 @@ static u8 rtw_init_default_value(struct adapter *padapter) padapter->driver_ampdu_spacing = 0xFF; padapter->driver_rx_ampdu_factor = 0xFF; - return ret; } struct dvobj_priv *devobj_init(void) @@ -749,7 +747,7 @@ u8 rtw_init_drv_sw(struct adapter *padapter) RT_TRACE(_module_os_intfs_c_, _drv_info_, ("+rtw_init_drv_sw\n")); - ret8 = rtw_init_default_value(padapter); + rtw_init_default_value(padapter); rtw_init_hal_com_default_value(padapter); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: rtl8723bs: os_dep: Change return type of function rtw_suspend_normal() to void
Coccicheck issues Unneeded variable "ret" warning. The return value of function rtw_suspend_normal() is set to _SUCCESS. The return value is never never checked by the calling function. Modified return type to void to remove the coccicheck warning.. Signed-off-by: Shobhit Kukreti --- drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/os_intfs.c b/drivers/staging/rtl8723bs/os_dep/os_intfs.c index 8a9d838..e1e871e 100644 --- a/drivers/staging/rtl8723bs/os_dep/os_intfs.c +++ b/drivers/staging/rtl8723bs/os_dep/os_intfs.c @@ -1422,10 +1422,9 @@ int rtw_suspend_ap_wow(struct adapter *padapter) #endif /* ifdef CONFIG_AP_WOWLAN */ -static int rtw_suspend_normal(struct adapter *padapter) +static void rtw_suspend_normal(struct adapter *padapter) { struct net_device *pnetdev = padapter->pnetdev; - int ret = _SUCCESS; DBG_871X("==> " FUNC_ADPT_FMT " entry\n", FUNC_ADPT_ARG(padapter)); if (pnetdev) { @@ -1447,7 +1446,6 @@ static int rtw_suspend_normal(struct adapter *padapter) padapter->intf_deinit(adapter_to_dvobj(padapter)); DBG_871X("<== " FUNC_ADPT_FMT " exit\n", FUNC_ADPT_ARG(padapter)); - return ret; } int rtw_suspend_common(struct adapter *padapter) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/4] staging: mt7621-pci: Handle minor issues
On Fri, Jun 21, 2019 at 7:35 AM Greg Ungerer wrote: > > Hi Sergio, > > On 21/6/19 4:15 pm, Sergio Paracuellos wrote: > > This patch series properly handle minor issues in this driver. These are: > > * Disable pcie port clock on pci dirver instead of doing it in the phy > >driver. The pci driver is the correct place to do this. > > * Add a missing call to phy_exit function to properly handle the function > >'mt7621_pcie_init_port' error path. > > * Move driver to init in a later stage using 'module_init' instead of using > >'arch_initcall'. > > > > Patches are only compile-tested. It would be awasome to be tested before > > applied > > them (mainly the change to 'module_init' stuff). I have similar results to Greg -- on GnuBee PC1 and PC2, six boot attempts each on a kernel built from staging-next, I have four hangs and eight successful boots. The hanging patterns are similar to previous results. If the full boot logs would be helpful let me know, I can provide them. -- Brett Neumeier (bneume...@gmail.com) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/4] staging: mt7621-pci: Handle minor issues
Hi Brett, On Sun, Jun 23, 2019 at 4:15 AM Brett Neumeier wrote: > > On Fri, Jun 21, 2019 at 7:35 AM Greg Ungerer wrote: > > > > Hi Sergio, > > > > On 21/6/19 4:15 pm, Sergio Paracuellos wrote: > > > This patch series properly handle minor issues in this driver. These are: > > > * Disable pcie port clock on pci dirver instead of doing it in the phy > > >driver. The pci driver is the correct place to do this. > > > * Add a missing call to phy_exit function to properly handle the function > > >'mt7621_pcie_init_port' error path. > > > * Move driver to init in a later stage using 'module_init' instead of > > > using > > >'arch_initcall'. > > > > > > Patches are only compile-tested. It would be awasome to be tested before > > > applied > > > them (mainly the change to 'module_init' stuff). > > I have similar results to Greg -- on GnuBee PC1 and PC2, six boot > attempts each on a kernel built from staging-next, I have four hangs > and eight successful boots. The hanging patterns are similar to > previous results. If the full boot logs would be helpful let me know, > I can provide them. Thanks for letting me know. One thing we can try is check init order in v4.20 kernel. Can you please try to compile pci driver for the kernel v4.20 tag changing driver's last line 'arch_initcall' into 'module_init'? Just to know if at that working driver putting all the stuff in a later stage stills work as expected. Full dmesg's of this v4.20 wih the change would be helpful. Best regards, Sergio Paracuellos > > -- > Brett Neumeier (bneume...@gmail.com) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel