Re: [PATCH] staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables
On 10/06/19 11:19 AM, Greg KH wrote: On Mon, Jun 10, 2019 at 10:08:21AM +0530, Nishka Dasgupta wrote: On 09/06/19 4:32 PM, Greg KH wrote: On Fri, Jun 07, 2019 at 12:41:23PM +0530, Nishka Dasgupta wrote: Remove variables that are declared and assigned values but not otherwise used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 - 1 file changed, 9 deletions(-) You sent me 8 patches for this driver, yet only 2 were ordered in a series. I have no idea what order to apply these in :( Please resend them _all_ in a numbered patch series so I have a chance to get this correct. Yes, I can do that. Who do I send the patch series to in that case? The maintainers list is slightly different for each file, and most of the patches in this driver are for different and unrelated files (except, I think, the two that I did send as a patch series). Do I combine the maintainers lists and send the entire patch series to everyone listed as a maintainer for any one of the patches in it? The maintainer and mailing list is the same for all of the files in a single driver. If not, then something is wrong. I'm using get_maintainers.pl with no arguments, and for rtl8723bs, I am getting a lot of different mailing lists. E.g For core/rtw_ieee80211.c, I'm getting the following list: Greg Kroah-Hartman Michael Straube Andy Shevchenko Hardik Singh Rathore Payal Kshirsagar Nishka Dasgupta de...@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) linux-ker...@vger.kernel.org (open list) Which is not the same as for core/rtw_mlme_ext.c (the current patch). And yes, you can combine the list of people if you wish but be sure you are not just randomly including people who happened to touch the driver "last". Okay, I'll combine then. But is there any metric I should be using to filter the output of get_maintainer.pl? Currently I'm running it with no arguments and just adding everyone. Thanking you, Nishka greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/34] treewide: simplify getting the adapter of an I2C client
Hi Peter, > Similar things go on in: > > drivers/hwmon/lm90.c > drivers/leds/leds-is31fl319x.c > drivers/of/unittest.c Right. I'll fix them, too. > And drivers/rtc/rtc-fm3130.c has a couple of these: These are fixed in patch 26 of this series. Thanks and happy hacking, Wolfram signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/7] staging: kpc2000: use __func__ in debug messages in core.c
On 06/06, Greg KH wrote: > On Tue, Jun 04, 2019 at 12:29:13AM +0200, Simon Sandström wrote: > > > > - dev_dbg(&pdev->dev, "kp2000_pcie_probe(pdev = [%p], id = [%p])\n", > > - pdev, id); > > + dev_dbg(&pdev->dev, "%s(pdev = [%p], id = [%p])\n", > > + __func__, pdev, id); > > debugging lines that say "called this function!" can all be removed, as > we have ftrace in the kernel tree, we can use that instead. I'll take > this, but feel free to clean them up as follow-on patches. > > thanks, > > greg k-h Can they be removed even if they print function arguments or other variables? - Simon ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables
On Mon, Jun 10, 2019 at 12:44:05PM +0530, Nishka Dasgupta wrote: > On 10/06/19 11:19 AM, Greg KH wrote: > > On Mon, Jun 10, 2019 at 10:08:21AM +0530, Nishka Dasgupta wrote: > > > On 09/06/19 4:32 PM, Greg KH wrote: > > > > On Fri, Jun 07, 2019 at 12:41:23PM +0530, Nishka Dasgupta wrote: > > > > > Remove variables that are declared and assigned values but not > > > > > otherwise > > > > > used. > > > > > Issue found with Coccinelle. > > > > > > > > > > Signed-off-by: Nishka Dasgupta > > > > > --- > > > > >drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 - > > > > >1 file changed, 9 deletions(-) > > > > > > > > You sent me 8 patches for this driver, yet only 2 were ordered in a > > > > series. I have no idea what order to apply these in :( > > > > > > > > Please resend them _all_ in a numbered patch series so I have a chance > > > > to get this correct. > > > > > > Yes, I can do that. Who do I send the patch series to in that case? The > > > maintainers list is slightly different for each file, and most of the > > > patches in this driver are for different and unrelated files (except, I > > > think, the two that I did send as a patch series). Do I combine the > > > maintainers lists and send the entire patch series to everyone listed as a > > > maintainer for any one of the patches in it? > > > > The maintainer and mailing list is the same for all of the files in a > > single driver. If not, then something is wrong. > > I'm using get_maintainers.pl with no arguments, and for rtl8723bs, I am > getting a lot of different mailing lists. > E.g > For core/rtw_ieee80211.c, I'm getting the following list: > Greg Kroah-Hartman > Michael Straube > Andy Shevchenko > Hardik Singh Rathore > Payal Kshirsagar > Nishka Dasgupta > de...@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) > linux-ker...@vger.kernel.org (open list) > > Which is not the same as for core/rtw_mlme_ext.c (the current patch). > > > And yes, you can combine the list of people if you wish but be sure you > > are not just randomly including people who happened to touch the driver > > "last". > > Okay, I'll combine then. But is there any metric I should be using to filter > the output of get_maintainer.pl? Currently I'm running it with no arguments > and just adding everyone. Look at the "role" that each person has. Here is the output of get_maintainer.pl when I run it on the first file above: $ ./scripts/get_maintainer.pl --file drivers/staging/rtl8723bs/core/rtw_ieee80211.c Greg Kroah-Hartman (supporter:STAGING SUBSYSTEM,commit_signer:16/16=100%) Michael Straube (commit_signer:14/16=88%,authored:14/16=88%,added_lines:43/59=73%,removed_lines:114/130=88%) Payal Kshirsagar (commit_signer:1/16=6%,authored:1/16=6%,added_lines:3/59=5%) Hardik Singh Rathore (commit_signer:1/16=6%,authored:1/16=6%,added_lines:13/59=22%,removed_lines:13/130=10%) Andy Shevchenko (commit_signer:1/16=6%) de...@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) linux-ker...@vger.kernel.org (open list) That shows that "Greg Kroah-Hartman" is a reviewer for this subsystem, Michael and Payal and Hardik and Andy have all submitted patches "recently", and then devel@ is the mailing list for the patches to be sent to. So, just include the maintainer and the mailing list and you will be fine. No need to bother lkml with staging patches, nor the people who last sent cleanup patches. hope this helps, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables
On 10/06/19 12:55 PM, Greg KH wrote: On Mon, Jun 10, 2019 at 12:44:05PM +0530, Nishka Dasgupta wrote: On 10/06/19 11:19 AM, Greg KH wrote: On Mon, Jun 10, 2019 at 10:08:21AM +0530, Nishka Dasgupta wrote: On 09/06/19 4:32 PM, Greg KH wrote: On Fri, Jun 07, 2019 at 12:41:23PM +0530, Nishka Dasgupta wrote: Remove variables that are declared and assigned values but not otherwise used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 - 1 file changed, 9 deletions(-) You sent me 8 patches for this driver, yet only 2 were ordered in a series. I have no idea what order to apply these in :( Please resend them _all_ in a numbered patch series so I have a chance to get this correct. Yes, I can do that. Who do I send the patch series to in that case? The maintainers list is slightly different for each file, and most of the patches in this driver are for different and unrelated files (except, I think, the two that I did send as a patch series). Do I combine the maintainers lists and send the entire patch series to everyone listed as a maintainer for any one of the patches in it? The maintainer and mailing list is the same for all of the files in a single driver. If not, then something is wrong. I'm using get_maintainers.pl with no arguments, and for rtl8723bs, I am getting a lot of different mailing lists. E.g For core/rtw_ieee80211.c, I'm getting the following list: Greg Kroah-Hartman Michael Straube Andy Shevchenko Hardik Singh Rathore Payal Kshirsagar Nishka Dasgupta de...@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) linux-ker...@vger.kernel.org (open list) Which is not the same as for core/rtw_mlme_ext.c (the current patch). And yes, you can combine the list of people if you wish but be sure you are not just randomly including people who happened to touch the driver "last". Okay, I'll combine then. But is there any metric I should be using to filter the output of get_maintainer.pl? Currently I'm running it with no arguments and just adding everyone. Look at the "role" that each person has. Here is the output of get_maintainer.pl when I run it on the first file above: $ ./scripts/get_maintainer.pl --file drivers/staging/rtl8723bs/core/rtw_ieee80211.c Greg Kroah-Hartman (supporter:STAGING SUBSYSTEM,commit_signer:16/16=100%) Michael Straube (commit_signer:14/16=88%,authored:14/16=88%,added_lines:43/59=73%,removed_lines:114/130=88%) Payal Kshirsagar (commit_signer:1/16=6%,authored:1/16=6%,added_lines:3/59=5%) Hardik Singh Rathore (commit_signer:1/16=6%,authored:1/16=6%,added_lines:13/59=22%,removed_lines:13/130=10%) Andy Shevchenko (commit_signer:1/16=6%) de...@driverdev.osuosl.org (open list:STAGING SUBSYSTEM) linux-ker...@vger.kernel.org (open list) That shows that "Greg Kroah-Hartman" is a reviewer for this subsystem, Michael and Payal and Hardik and Andy have all submitted patches "recently", and then devel@ is the mailing list for the patches to be sent to. So, just include the maintainer and the mailing list and you will be fine. No need to bother lkml with staging patches, nor the people who last sent cleanup patches. hope this helps, This helps a lot; thank you! Nishka greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 02/10] staging: rtl8723bs: Change type of rtw_os_recvbuf_resource_free()
Change return type of function rtw_os_recvbuf_resource_free to void as its return value is never stored, checked or otherwise used. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of patch series. drivers/staging/rtl8723bs/include/recv_osdep.h | 2 +- drivers/staging/rtl8723bs/os_dep/recv_linux.c | 6 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/include/recv_osdep.h b/drivers/staging/rtl8723bs/include/recv_osdep.h index 0e1baf170cfb..1056f615d0f9 100644 --- a/drivers/staging/rtl8723bs/include/recv_osdep.h +++ b/drivers/staging/rtl8723bs/include/recv_osdep.h @@ -29,7 +29,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv); void rtw_os_free_recvframe(union recv_frame *precvframe); -int rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf); +void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf); _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata); void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt_attrib *pattrib); diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c index 45145efa3f68..3fe9c2255edd 100644 --- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c @@ -46,16 +46,12 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv) } /* free os related resource in struct recv_buf */ -int rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf) +void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf) { - int ret = _SUCCESS; - if (precvbuf->pskb) { dev_kfree_skb_any(precvbuf->pskb); } - return ret; - } _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata) -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 07/10] staging: rtl8723bs: hal: rtl8723b_cmd.c: Remove variables
Remove variables that are declared and initialised but never used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of patch series. drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c index fe3891106a6d..e001d302b34c 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_cmd.c @@ -674,10 +674,6 @@ static void ConstructProbeReq(struct adapter *padapter, u8 *pframe, u32 *pLength u32 pktlen; unsigned char *mac; unsigned char bssrate[NumRates]; - struct xmit_priv *pxmitpriv = &(padapter->xmitpriv); - struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); - struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv); - struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); int bssrate_len = 0; u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; @@ -1288,8 +1284,6 @@ static void rtl8723b_set_FwAOACGlobalInfo_Cmd(struct adapter *padapter, u8 grou static void rtl8723b_set_FwScanOffloadInfo_cmd(struct adapter *padapter, PRSVDPAGE_LOC rsvdpageloc, u8 enable) { u8 u1H2CScanOffloadInfoParm[H2C_SCAN_OFFLOAD_CTRL_LEN] = {0}; - u8 res = 0, count = 0; - struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); DBG_871X("%s: loc_probe_packet:%d, loc_scan_info: %d loc_ssid_info:%d\n", __func__, rsvdpageloc->LocProbePacket, rsvdpageloc->LocScanInfo, rsvdpageloc->LocSSIDInfo); -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 04/10] staging: rtl8723bs: hal: sdio_halinit.c: Remove variables
Remove the variables RegRATR and RegRRSR as they are never used after initialisation and assignment. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of patch series. drivers/staging/rtl8723bs/hal/sdio_halinit.c | 11 --- 1 file changed, 11 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/sdio_halinit.c b/drivers/staging/rtl8723bs/hal/sdio_halinit.c index 3c65a9c02bbd..55d21aa52e62 100644 --- a/drivers/staging/rtl8723bs/hal/sdio_halinit.c +++ b/drivers/staging/rtl8723bs/hal/sdio_halinit.c @@ -614,7 +614,6 @@ static void _InitOperationMode(struct adapter *padapter) struct hal_com_data *pHalData; struct mlme_ext_priv *pmlmeext; u8 regBwOpMode = 0; - u32 regRATR = 0, regRRSR = 0; pHalData = GET_HAL_DATA(padapter); pmlmeext = &padapter->mlmeextpriv; @@ -626,34 +625,24 @@ static void _InitOperationMode(struct adapter *padapter) switch (pmlmeext->cur_wireless_mode) { case WIRELESS_MODE_B: regBwOpMode = BW_OPMODE_20MHZ; - regRATR = RATE_ALL_CCK; - regRRSR = RATE_ALL_CCK; break; case WIRELESS_MODE_A: /* RT_ASSERT(false, ("Error wireless a mode\n")); */ break; case WIRELESS_MODE_G: regBwOpMode = BW_OPMODE_20MHZ; - regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG; - regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG; break; case WIRELESS_MODE_AUTO: regBwOpMode = BW_OPMODE_20MHZ; - regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS; - regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG; break; case WIRELESS_MODE_N_24G: /* It support CCK rate by default. */ /* CCK rate will be filtered out only when associated AP does not support it. */ regBwOpMode = BW_OPMODE_20MHZ; - regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS; - regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG; break; case WIRELESS_MODE_N_5G: /* RT_ASSERT(false, ("Error wireless mode")); */ regBwOpMode = BW_OPMODE_5G; - regRATR = RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS; - regRRSR = RATE_ALL_OFDM_AG; break; default: /* for MacOSX compiler warning. */ -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 03/10] staging: rtl8723bs: os_dep: ioctl_linux.c: Remove return variables
Remove return variables and in multiple functions and return the values directly, as the functions all return 0 in all cases. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of patch series. drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index fc3885d299d6..1d8f1907883f 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -2601,9 +2601,7 @@ static int rtw_p2p_set(struct net_device *dev, union iwreq_data *wrqu, char *extra) { - int ret = 0; - - return ret; + return 0; } @@ -2612,9 +2610,7 @@ static int rtw_p2p_get(struct net_device *dev, union iwreq_data *wrqu, char *extra) { - int ret = 0; - - return ret; + return 0; } @@ -2623,9 +2619,7 @@ static int rtw_p2p_get2(struct net_device *dev, union iwreq_data *wrqu, char *extra) { - int ret = 0; - - return ret; + return 0; } -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 06/10] staging: rtl8723bs: core: Remove variable change_priority
Remove local variable change_priority, as it takes the value of the argument priority; as both of these variables are of type u8, priority can be modified without changing the value of its copy at the call site. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of a patch series. drivers/staging/rtl8723bs/core/rtw_xmit.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 53146ec62ae9..b5dcb78fb4f4 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -625,13 +625,11 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p u8 qos_acm(u8 acm_mask, u8 priority) { - u8 change_priority = priority; - switch (priority) { case 0: case 3: if (acm_mask & BIT(1)) - change_priority = 1; + priority = 1; break; case 1: case 2: @@ -639,19 +637,19 @@ u8 qos_acm(u8 acm_mask, u8 priority) case 4: case 5: if (acm_mask & BIT(2)) - change_priority = 0; + priority = 0; break; case 6: case 7: if (acm_mask & BIT(3)) - change_priority = 5; + priority = 5; break; default: DBG_871X("qos_acm(): invalid pattrib->priority: %d!!!\n", priority); break; } - return change_priority; + return priority; } static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib) -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 09/10] staging: rtl8723bs: rtw_get_sec_ie(): Change return type
Remove assignment of return value of function rtw_get_sec_ie as it is never checked or used. Remove return statement of rtw_get_sec_ie as its return value is never stored or checked or used. Change return type of rtw_get_sec_ie to void. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of patch series. drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 4 +--- drivers/staging/rtl8723bs/include/ieee80211.h | 2 +- drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c index aaf27438cd81..6018d877a8a6 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c @@ -654,7 +654,7 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len) } /* endif */ -int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len) +void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len) { u8 authmode, sec_idx, i; u8 wpa_oui[4] = {0x0, 0x50, 0xf2, 0x01}; @@ -705,8 +705,6 @@ int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, } } } - - return *rsn_len + *wpa_len; } u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen) diff --git a/drivers/staging/rtl8723bs/include/ieee80211.h b/drivers/staging/rtl8723bs/include/ieee80211.h index 74c028fbe8f7..2110552b8e59 100644 --- a/drivers/staging/rtl8723bs/include/ieee80211.h +++ b/drivers/staging/rtl8723bs/include/ieee80211.h @@ -1138,7 +1138,7 @@ int rtw_get_wapi_ie(u8 *in_ie, uint in_len, u8 *wapi_ie, u16 *wapi_len); int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x); int rtw_parse_wpa2_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwise_cipher, int *is_8021x); -int rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len); +void rtw_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len, u8 *wpa_ie, u16 *wpa_len); u8 rtw_is_wps_ie(u8 *ie_ptr, uint *wps_ielen); u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen); diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index 1d8f1907883f..4c5855bde9ad 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -235,8 +235,7 @@ static char *translate_scan(struct adapter *padapter, u8 wpa_ie[255], rsn_ie[255]; u16 wpa_len = 0, rsn_len = 0; u8 *p; - sint out_len = 0; - out_len =rtw_get_sec_ie(pnetwork->network.IEs , pnetwork->network.IELength, rsn_ie,&rsn_len, wpa_ie,&wpa_len); + rtw_get_sec_ie(pnetwork->network.IEs, pnetwork->network.IELength, rsn_ie, &rsn_len, wpa_ie, &wpa_len); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: ssid =%s\n", pnetwork->network.Ssid.Ssid)); RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n", wpa_len, rsn_len)); -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 08/10] staging: rtl8723bs: core: rtw_mlme_ext.c: Remove unused variables
Remove variables that are declared and assigned values but not otherwise used. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of patch series. drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 65e8cba7feba..5f0b20038a28 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -6771,10 +6771,6 @@ int rtw_get_ch_setting_union(struct adapter *adapter, u8 *ch, u8 *bw, u8 *offset { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct adapter *iface; - struct mlme_ext_priv *mlmeext; - u8 ch_ret = 0; - u8 bw_ret = CHANNEL_WIDTH_20; - u8 offset_ret = HAL_PRIME_CHNL_OFFSET_DONT_CARE; if (ch) *ch = 0; @@ -6784,15 +6780,10 @@ int rtw_get_ch_setting_union(struct adapter *adapter, u8 *ch, u8 *bw, u8 *offset *offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; iface = dvobj->padapters; - mlmeext = &iface->mlmeextpriv; if (!check_fwstate(&iface->mlmepriv, _FW_LINKED|_FW_UNDER_LINKING)) return 0; - ch_ret = mlmeext->cur_channel; - bw_ret = mlmeext->cur_bwmode; - offset_ret = mlmeext->cur_ch_offset; - return 1; } -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 05/10] staging: rtl8723bs: hal: hal_btcoex.c: Remove variables
Remove variables and use the values directly. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of a patch series. drivers/staging/rtl8723bs/hal/hal_btcoex.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 6caddd7834a1..aebe8b8977ad 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -362,15 +362,9 @@ static u32 halbtcoutsrc_GetBtPatchVer(PBTC_COEXIST pBtCoexist) static s32 halbtcoutsrc_GetWifiRssi(struct adapter *padapter) { - struct hal_com_data *pHalData; - s32 UndecoratedSmoothedPWDB = 0; - - - pHalData = GET_HAL_DATA(padapter); - - UndecoratedSmoothedPWDB = pHalData->dmpriv.EntryMinUndecoratedSmoothedPWDB; + struct hal_com_data *pHalData = GET_HAL_DATA(padapter); - return UndecoratedSmoothedPWDB; + return pHalData->dmpriv.EntryMinUndecoratedSmoothedPWDB; } static u8 halbtcoutsrc_GetWifiScanAPNum(struct adapter *padapter) -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 01/10] staging: rtl8723bs: Change type of rtw_os_recv_resource_alloc()
Remove assignment of the return value of rtw_os_recv_resource_alloc as this assignment at the call site is never used. Remove return statement from rtw_os_recv_resource_alloc() as its return variable is never used. Change the type of the function to void. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of a patch series. drivers/staging/rtl8723bs/core/rtw_recv.c | 2 +- drivers/staging/rtl8723bs/include/recv_osdep.h | 2 +- drivers/staging/rtl8723bs/os_dep/recv_linux.c | 6 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c index b9c9bba1a335..687ff3c6f09f 100644 --- a/drivers/staging/rtl8723bs/core/rtw_recv.c +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c @@ -67,7 +67,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter) list_add_tail(&(precvframe->u.list), &(precvpriv->free_recv_queue.queue)); - res = rtw_os_recv_resource_alloc(padapter, precvframe); + rtw_os_recv_resource_alloc(padapter, precvframe); precvframe->u.hdr.len = 0; diff --git a/drivers/staging/rtl8723bs/include/recv_osdep.h b/drivers/staging/rtl8723bs/include/recv_osdep.h index 6fea0e948271..0e1baf170cfb 100644 --- a/drivers/staging/rtl8723bs/include/recv_osdep.h +++ b/drivers/staging/rtl8723bs/include/recv_osdep.h @@ -22,7 +22,7 @@ int rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter); void rtw_free_recv_priv (struct recv_priv *precvpriv); -int rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe); +void rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe); void rtw_os_recv_resource_free(struct recv_priv *precvpriv); diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c index 67ec336264e5..45145efa3f68 100644 --- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c @@ -21,13 +21,9 @@ void rtw_os_free_recvframe(union recv_frame *precvframe) } /* alloc os related resource in union recv_frame */ -int rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe) +void rtw_os_recv_resource_alloc(struct adapter *padapter, union recv_frame *precvframe) { - int res = _SUCCESS; - precvframe->u.hdr.pkt_newalloc = precvframe->u.hdr.pkt = NULL; - - return res; } /* free os related resource in union recv_frame */ -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 10/10] staging: rtl8723bs: os_dep: Remove variable pos
Remove variable pos as it is not used after (or before) being assigned a value. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Send as part of patch series. drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c index 4c5855bde9ad..ea50ec424e50 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c @@ -616,7 +616,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param, static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ielen) { - u8 *buf = NULL, *pos = NULL; + u8 *buf = NULL; int group_cipher = 0, pairwise_cipher = 0; int ret = 0; u8 null_addr[]= {0, 0, 0, 0, 0, 0}; @@ -646,7 +646,6 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie DBG_871X("0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", buf[i], buf[i+1], buf[i+2], buf[i+3], buf[i+4], buf[i+5], buf[i+6], buf[i+7]); } - pos = buf; if (ielen < RSN_HEADER_LEN) { RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_err_, ("Ie len too short %d\n", ielen)); ret = -1; -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: kpc2000: kpc_i2c: remove the macros inb_p and outb_p
remove inb_p and outb_p to call readq/writeq directly. Signed-off-by: Hao Xu --- Changes in v2: - remove the macros inb_p/outb_p and use readq/writeq directly, per https://lkml.kernel.org/lkml/20190608134505.ga...@arch-01.home/ --- drivers/staging/kpc2000/kpc2000_i2c.c | 112 -- 1 file changed, 53 insertions(+), 59 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c b/drivers/staging/kpc2000/kpc2000_i2c.c index 69e8773..246d5b3 100644 --- a/drivers/staging/kpc2000/kpc2000_i2c.c +++ b/drivers/staging/kpc2000/kpc2000_i2c.c @@ -122,12 +122,6 @@ struct i2c_device { /* Not really a feature, but it's convenient to handle it as such */ #define FEATURE_IDF BIT(15) -// FIXME! -#undef inb_p -#define inb_p(a) readq((void *)a) -#undef outb_p -#define outb_p(d, a) writeq(d, (void *)a) - /* Make sure the SMBus host is ready to start transmitting. * Return 0 if it is, -EBUSY if it is not. */ @@ -135,7 +129,7 @@ static int i801_check_pre(struct i2c_device *priv) { int status; - status = inb_p(SMBHSTSTS(priv)); + status = readq((void *)SMBHSTSTS(priv)); if (status & SMBHSTSTS_HOST_BUSY) { dev_err(&priv->adapter.dev, "SMBus is busy, can't use it! (status=%x)\n", status); return -EBUSY; @@ -144,8 +138,8 @@ static int i801_check_pre(struct i2c_device *priv) status &= STATUS_FLAGS; if (status) { //dev_dbg(&priv->adapter.dev, "Clearing status flags (%02x)\n", status); - outb_p(status, SMBHSTSTS(priv)); - status = inb_p(SMBHSTSTS(priv)) & STATUS_FLAGS; + writeq(status, (void *)SMBHSTSTS(priv)); + status = readq((void *)SMBHSTSTS(priv)) & STATUS_FLAGS; if (status) { dev_err(&priv->adapter.dev, "Failed clearing status flags (%02x)\n", status); return -EBUSY; @@ -164,15 +158,15 @@ static int i801_check_post(struct i2c_device *priv, int status, int timeout) dev_err(&priv->adapter.dev, "Transaction timeout\n"); /* try to stop the current command */ dev_dbg(&priv->adapter.dev, "Terminating the current operation\n"); - outb_p(inb_p(SMBHSTCNT(priv)) | SMBHSTCNT_KILL, SMBHSTCNT(priv)); + writeq(readq((void *)SMBHSTCNT(priv)) | SMBHSTCNT_KILL, (void *)SMBHSTCNT(priv)); usleep_range(1000, 2000); - outb_p(inb_p(SMBHSTCNT(priv)) & (~SMBHSTCNT_KILL), SMBHSTCNT(priv)); + writeq(readq((void *)SMBHSTCNT(priv)) & (~SMBHSTCNT_KILL), (void *)SMBHSTCNT(priv)); /* Check if it worked */ - status = inb_p(SMBHSTSTS(priv)); + status = readq((void *)SMBHSTSTS(priv)); if ((status & SMBHSTSTS_HOST_BUSY) || !(status & SMBHSTSTS_FAILED)) dev_err(&priv->adapter.dev, "Failed terminating the transaction\n"); - outb_p(STATUS_FLAGS, SMBHSTSTS(priv)); + writeq(STATUS_FLAGS, (void *)SMBHSTSTS(priv)); return -ETIMEDOUT; } @@ -191,8 +185,8 @@ static int i801_check_post(struct i2c_device *priv, int status, int timeout) if (result) { /* Clear error flags */ - outb_p(status & STATUS_FLAGS, SMBHSTSTS(priv)); - status = inb_p(SMBHSTSTS(priv)) & STATUS_FLAGS; + writeq(status & STATUS_FLAGS, (void *)SMBHSTSTS(priv)); + status = readq((void *)SMBHSTSTS(priv)) & STATUS_FLAGS; if (status) dev_warn(&priv->adapter.dev, "Failed clearing status flags at end of transaction (%02x)\n", status); } @@ -212,19 +206,19 @@ static int i801_transaction(struct i2c_device *priv, int xact) /* the current contents of SMBHSTCNT can be overwritten, since PEC, * INTREN, SMBSCMD are passed in xact */ - outb_p(xact | I801_START, SMBHSTCNT(priv)); + writeq(xact | I801_START, (void *)SMBHSTCNT(priv)); /* We will always wait for a fraction of a second! */ do { usleep_range(250, 500); - status = inb_p(SMBHSTSTS(priv)); + status = readq((void *)SMBHSTSTS(priv)); } while ((status & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_RETRIES)); result = i801_check_post(priv, status, timeout > MAX_RETRIES); if (result < 0) return result; - outb_p(SMBHSTSTS_INTR, SMBHSTSTS(priv)); + writeq(SMBHSTSTS_INTR, (void *)SMBHSTSTS(priv)); return 0; } @@ -236,13 +230,13 @@ static void i801_wait_hwpec(struct i2c_device *priv) do { usleep_range(250, 500); - status = inb_p(SMBHSTSTS(priv)); + status = readq((void *)SMBHSTSTS(priv)); } while ((!(status & SMBHSTSTS_INTR)) && (timeout++ < MAX_RETRIES)); if (timeout > MAX_RE
Re: [PATCH 4/7] staging: kpc2000: use __func__ in debug messages in core.c
On Mon, Jun 10, 2019 at 09:20:09AM +0200, Simon Sandström wrote: > On 06/06, Greg KH wrote: > > On Tue, Jun 04, 2019 at 12:29:13AM +0200, Simon Sandström wrote: > > > > > > - dev_dbg(&pdev->dev, "kp2000_pcie_probe(pdev = [%p], id = [%p])\n", > > > - pdev, id); > > > + dev_dbg(&pdev->dev, "%s(pdev = [%p], id = [%p])\n", > > > + __func__, pdev, id); > > > > debugging lines that say "called this function!" can all be removed, as > > we have ftrace in the kernel tree, we can use that instead. I'll take > > this, but feel free to clean them up as follow-on patches. > > > > thanks, > > > > greg k-h > > Can they be removed even if they print function arguments or other > variables? Of course! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: rtl8712: Change return values of r8712_setdatarate_cmd()
Change the return values of function r8712_setdatarate_cmd from _SUCCESS and _FAIL to 0 and -ENOMEM respectively. Change the return type of the function from u8 to int to reflect this. Change the call site of the function to check for 0 instead of _SUCCESS. Return the value at the call site directly instead of storing it in a return variable. Remove now-unused return variable. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Change return method at call site. - Remove variable at call site. - Fix commit subject. drivers/staging/rtl8712/rtl871x_cmd.c | 8 drivers/staging/rtl8712/rtl871x_cmd.h | 2 +- drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 6 ++ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index 05a78ac24987..e478c031f95f 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -242,7 +242,7 @@ u8 r8712_sitesurvey_cmd(struct _adapter *padapter, return _SUCCESS; } -u8 r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset) +int r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset) { struct cmd_obj *ph2c; struct setdatarate_parm *pbsetdataratepara; @@ -250,18 +250,18 @@ u8 r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset) ph2c = kmalloc(sizeof(*ph2c), GFP_ATOMIC); if (!ph2c) - return _FAIL; + return -ENOMEM; pbsetdataratepara = kmalloc(sizeof(*pbsetdataratepara), GFP_ATOMIC); if (!pbsetdataratepara) { kfree(ph2c); - return _FAIL; + return -ENOMEM; } init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate)); pbsetdataratepara->mac_id = 5; memcpy(pbsetdataratepara->datarates, rateset, NumRates); r8712_enqueue_cmd(pcmdpriv, ph2c); - return _SUCCESS; + return 0; } u8 r8712_set_chplan_cmd(struct _adapter *padapter, int chplan) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h b/drivers/staging/rtl8712/rtl871x_cmd.h index 262984c58efb..800216cca2f6 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.h +++ b/drivers/staging/rtl8712/rtl871x_cmd.h @@ -719,7 +719,7 @@ u8 r8712_joinbss_cmd(struct _adapter *padapter, u8 r8712_disassoc_cmd(struct _adapter *padapter); u8 r8712_setopmode_cmd(struct _adapter *padapter, enum NDIS_802_11_NETWORK_INFRASTRUCTURE networktype); -u8 r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset); +int r8712_setdatarate_cmd(struct _adapter *padapter, u8 *rateset); u8 r8712_set_chplan_cmd(struct _adapter *padapter, int chplan); u8 r8712_setbasicrate_cmd(struct _adapter *padapter, u8 *rateset); u8 r8712_getrfreg_cmd(struct _adapter *padapter, u8 offset, u8 *pval); diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c index b424b8436fcf..a224797cd993 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c @@ -1309,7 +1309,7 @@ static int r8711_wx_set_rate(struct net_device *dev, u32 ratevalue = 0; u8 datarates[NumRates]; u8 mpdatarate[NumRates] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff}; - int i, ret = 0; + int i; if (target_rate == -1) { ratevalue = 11; @@ -1367,9 +1367,7 @@ static int r8711_wx_set_rate(struct net_device *dev, datarates[i] = 0xff; } } - if (r8712_setdatarate_cmd(padapter, datarates) != _SUCCESS) - ret = -ENOMEM; - return ret; + return r8712_setdatarate_cmd(padapter, datarates); } static int r8711_wx_get_rate(struct net_device *dev, -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: rtl8712: Change return values of r8712_createbss_cmd()
Change return values of r8712_createbss_cmd from _SUCCESS and _FAIL to 0 and -ENOMEM respectively. Change return type of the function from unsigned to int to reflect this. Change call site to check for 0 instead of _SUCCESS. Signed-off-by: Nishka Dasgupta --- Changes in v2: - Fix commit subject. drivers/staging/rtl8712/rtl871x_cmd.c | 6 +++--- drivers/staging/rtl8712/rtl871x_cmd.h | 2 +- drivers/staging/rtl8712/rtl871x_ioctl_set.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c b/drivers/staging/rtl8712/rtl871x_cmd.c index e478c031f95f..94ff875d9025 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.c +++ b/drivers/staging/rtl8712/rtl871x_cmd.c @@ -409,7 +409,7 @@ void r8712_readtssi_cmdrsp_callback(struct _adapter *padapter, padapter->mppriv.workparam.bcompleted = true; } -u8 r8712_createbss_cmd(struct _adapter *padapter) +int r8712_createbss_cmd(struct _adapter *padapter) { struct cmd_obj *pcmd; struct cmd_priv *pcmdpriv = &padapter->cmdpriv; @@ -419,7 +419,7 @@ u8 r8712_createbss_cmd(struct _adapter *padapter) padapter->ledpriv.LedControlHandler(padapter, LED_CTL_START_TO_LINK); pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC); if (!pcmd) - return _FAIL; + return -ENOMEM; INIT_LIST_HEAD(&pcmd->list); pcmd->cmdcode = _CreateBss_CMD_; pcmd->parmbuf = (unsigned char *)pdev_network; @@ -431,7 +431,7 @@ u8 r8712_createbss_cmd(struct _adapter *padapter) pdev_network->IELength = pdev_network->IELength; pdev_network->Ssid.SsidLength = pdev_network->Ssid.SsidLength; r8712_enqueue_cmd(pcmdpriv, pcmd); - return _SUCCESS; + return 0; } u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork) diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h b/drivers/staging/rtl8712/rtl871x_cmd.h index 800216cca2f6..6ea1bafd8acc 100644 --- a/drivers/staging/rtl8712/rtl871x_cmd.h +++ b/drivers/staging/rtl8712/rtl871x_cmd.h @@ -712,7 +712,7 @@ u8 r8712_setMacAddr_cmd(struct _adapter *padapter, u8 *mac_addr); u8 r8712_setassocsta_cmd(struct _adapter *padapter, u8 *mac_addr); u8 r8712_sitesurvey_cmd(struct _adapter *padapter, struct ndis_802_11_ssid *pssid); -u8 r8712_createbss_cmd(struct _adapter *padapter); +int r8712_createbss_cmd(struct _adapter *padapter); u8 r8712_setstakey_cmd(struct _adapter *padapter, u8 *psta, u8 unicast_key); u8 r8712_joinbss_cmd(struct _adapter *padapter, struct wlan_network *pnetwork); diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c index 2622d5e3bff9..d0274c65d17e 100644 --- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c +++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c @@ -84,7 +84,7 @@ static u8 do_join(struct _adapter *padapter) sizeof(struct ndis_802_11_ssid)); r8712_update_registrypriv_dev_network(padapter); r8712_generate_random_ibss(pibss); - if (r8712_createbss_cmd(padapter) != _SUCCESS) + if (r8712_createbss_cmd(padapter)) return false; pmlmepriv->to_join = false; } else { -- 2.19.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/5] staging: kpc2000: remove unnecessary debug prints
These patches removes unnecessary debug prints in staging/kpc2000. Debug prints that just informs about function entry or exit can be removed as ftrace can be used to get this information. Simon Sandström (5): staging: kpc2000: remove unnecessary debug prints in cell_probe.c staging: kpc2000: remove unnecessary debug prints in core.c staging: kpc2000: remove unnecessary debug prints in dma.c staging: kpc2000: remove unnecessary debug prints in fileops.c staging: kpc2000: remove unnecessary debug prints in kpc_dma_driver.c drivers/staging/kpc2000/kpc2000/cell_probe.c| 5 - drivers/staging/kpc2000/kpc2000/core.c | 6 -- drivers/staging/kpc2000/kpc_dma/dma.c | 4 drivers/staging/kpc2000/kpc_dma/fileops.c | 17 - .../staging/kpc2000/kpc_dma/kpc_dma_driver.c| 4 5 files changed, 36 deletions(-) -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging: kpc2000: remove unnecessary debug prints in kpc_dma_driver.c
Debug prints that are used only to inform about function entry or exit can be removed as ftrace can be used to get this information. Signed-off-by: Simon Sandström --- drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c index 9acf1eafa024..4b854027e60a 100644 --- a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c +++ b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c @@ -106,8 +106,6 @@ int kpc_dma_probe(struct platform_device *pldev) goto err_rv; } - dev_dbg(&pldev->dev, "%s(pldev = [%p]) ldev = [%p]\n", __func__, pldev, ldev); - INIT_LIST_HEAD(&ldev->list); ldev->pldev = pldev; @@ -183,8 +181,6 @@ int kpc_dma_remove(struct platform_device *pldev) if (!ldev) return -ENXIO; - dev_dbg(&ldev->pldev->dev, "%s(pldev = [%p]) ldev = [%p]\n", __func__, pldev, ldev); - lock_engine(ldev); sysfs_remove_files(&(ldev->pldev->dev.kobj), ndd_attr_list); destroy_dma_engine(ldev); -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] staging: kpc2000: remove unnecessary debug prints in core.c
Debug prints that are used only to inform about function entry or exit can be removed as ftrace can be used to get this information. Signed-off-by: Simon Sandström --- drivers/staging/kpc2000/kpc2000/core.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000/core.c b/drivers/staging/kpc2000/kpc2000/core.c index 93e381198b45..9b9b29ac90c5 100644 --- a/drivers/staging/kpc2000/kpc2000/core.c +++ b/drivers/staging/kpc2000/kpc2000/core.c @@ -311,9 +311,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, unsigned long dma_bar_phys_len; u16 regval; - dev_dbg(&pdev->dev, "%s(pdev = [%p], id = [%p])\n", - __func__, pdev, id); - /* * Step 1: Allocate a struct for the pcard */ @@ -506,7 +503,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, writel(KPC_DMA_CARD_IRQ_ENABLE | KPC_DMA_CARD_USER_INTERRUPT_MODE, pcard->dma_common_regs); - dev_dbg(&pcard->pdev->dev, "%s() complete!\n", __func__); mutex_unlock(&pcard->sem); return 0; @@ -540,8 +536,6 @@ static void kp2000_pcie_remove(struct pci_dev *pdev) { struct kp2000_device *pcard = pci_get_drvdata(pdev); - dev_dbg(&pdev->dev, "%s(pdev=%p)\n", __func__, pdev); - if (!pcard) return; -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] staging: kpc2000: remove unnecessary debug prints in fileops.c
Debug prints that are used only to inform about function entry or exit can be removed as ftrace can be used to get this information. Signed-off-by: Simon Sandström --- drivers/staging/kpc2000/kpc_dma/fileops.c | 17 - 1 file changed, 17 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_dma/fileops.c b/drivers/staging/kpc2000/kpc_dma/fileops.c index fdec1ab25dfd..f80b01715d93 100644 --- a/drivers/staging/kpc2000/kpc_dma/fileops.c +++ b/drivers/staging/kpc2000/kpc_dma/fileops.c @@ -54,8 +54,6 @@ int kpc_dma_transfer(struct dev_private_data *priv, struct kiocb *kcb, unsigned ldev = priv->ldev; BUG_ON(ldev == NULL); - dev_dbg(&priv->ldev->pldev->dev, "%s(priv = [%p], kcb = [%p], iov_base = [%p], iov_len = %zu) ldev = [%p]\n", __func__, priv, kcb, (void *)iov_base, iov_len, ldev); - acd = kzalloc(sizeof(*acd), GFP_KERNEL); if (!acd) { dev_err(&priv->ldev->pldev->dev, "Couldn't kmalloc space for for the aio data\n"); @@ -218,8 +216,6 @@ void transfer_complete_cb(struct aio_cb_data *acd, size_t xfr_count, u32 flags) BUG_ON(acd->ldev == NULL); BUG_ON(acd->ldev->pldev == NULL); - dev_dbg(&acd->ldev->pldev->dev, "%s(acd = [%p])\n", __func__, acd); - for (i = 0 ; i < acd->page_count ; i++) { if (!PageReserved(acd->user_pages[i])) { set_page_dirty(acd->user_pages[i]); @@ -275,7 +271,6 @@ int kpc_dma_open(struct inode *inode, struct file *filp) priv->ldev = ldev; filp->private_data = priv; - dev_dbg(&priv->ldev->pldev->dev, "%s(inode = [%p], filp = [%p]) priv = [%p] ldev = [%p]\n", __func__, inode, filp, priv, priv->ldev); return 0; } @@ -286,8 +281,6 @@ int kpc_dma_close(struct inode *inode, struct file *filp) struct dev_private_data *priv = (struct dev_private_data *)filp->private_data; struct kpc_dma_device *eng = priv->ldev; - dev_dbg(&priv->ldev->pldev->dev, "%s(inode = [%p], filp = [%p]) priv = [%p], ldev = [%p]\n", __func__, inode, filp, priv, priv->ldev); - lock_engine(eng); stop_dma_engine(eng); @@ -330,8 +323,6 @@ ssize_t kpc_dma_aio_read(struct kiocb *kcb, const struct iovec *iov, unsigned { struct dev_private_data *priv = (struct dev_private_data *)kcb->ki_filp->private_data; - dev_dbg(&priv->ldev->pldev->dev, "%s(kcb = [%p], iov = [%p], iov_count = %ld, pos = %lld) priv = [%p], ldev = [%p]\n", __func__, kcb, iov, iov_count, pos, priv, priv->ldev); - if (priv->ldev->dir != DMA_FROM_DEVICE) return -EMEDIUMTYPE; @@ -350,8 +341,6 @@ ssize_t kpc_dma_aio_write(struct kiocb *kcb, const struct iovec *iov, unsigned { struct dev_private_data *priv = (struct dev_private_data *)kcb->ki_filp->private_data; - dev_dbg(&priv->ldev->pldev->dev, "%s(kcb = [%p], iov = [%p], iov_count = %ld, pos = %lld) priv = [%p], ldev = [%p]\n", __func__, kcb, iov, iov_count, pos, priv, priv->ldev); - if (priv->ldev->dir != DMA_TO_DEVICE) return -EMEDIUMTYPE; @@ -371,8 +360,6 @@ ssize_t kpc_dma_read(struct file *filp, char __user *user_buf, size_t cou { struct dev_private_data *priv = (struct dev_private_data *)filp->private_data; - dev_dbg(&priv->ldev->pldev->dev, "%s(filp = [%p], user_buf = [%p], count = %zu, ppos = [%p]) priv = [%p], ldev = [%p]\n", __func__, filp, user_buf, count, ppos, priv, priv->ldev); - if (priv->ldev->dir != DMA_FROM_DEVICE) return -EMEDIUMTYPE; @@ -384,8 +371,6 @@ ssize_t kpc_dma_write(struct file *filp, const char __user *user_buf, size_t co { struct dev_private_data *priv = (struct dev_private_data *)filp->private_data; - dev_dbg(&priv->ldev->pldev->dev, "%s(filp = [%p], user_buf = [%p], count = %zu, ppos = [%p]) priv = [%p], ldev = [%p]\n", __func__, filp, user_buf, count, ppos, priv, priv->ldev); - if (priv->ldev->dir != DMA_TO_DEVICE) return -EMEDIUMTYPE; @@ -397,8 +382,6 @@ long kpc_dma_ioctl(struct file *filp, unsigned int ioctl_num, unsigned long ioc { struct dev_private_data *priv = (struct dev_private_data *)filp->private_data; - dev_dbg(&priv->ldev->pldev->dev, "%s(filp = [%p], ioctl_num = 0x%x, ioctl_param = 0x%lx) priv = [%p], ldev = [%p]\n", __func__, filp, ioctl_num, ioctl_param, priv, priv->ldev); - switch (ioctl_num) { case KND_IOCTL_SET_CARD_ADDR: priv->card_addr = ioctl_param; return priv->card_addr; -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging: kpc2000: remove unnecessary debug prints in dma.c
Debug prints that are used only to inform about function entry or exit can be removed as ftrace can be used to get this information. Signed-off-by: Simon Sandström --- drivers/staging/kpc2000/kpc_dma/dma.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_dma/dma.c b/drivers/staging/kpc2000/kpc_dma/dma.c index 059932ab5907..8092d0cf4a4a 100644 --- a/drivers/staging/kpc2000/kpc_dma/dma.c +++ b/drivers/staging/kpc2000/kpc_dma/dma.c @@ -92,8 +92,6 @@ int setup_dma_engine(struct kpc_dma_device *eng, u32 desc_cnt) unsigned int i; int rv; - dev_dbg(&eng->pldev->dev, "Setting up DMA engine [%p]\n", eng); - caps = GetEngineCapabilities(eng); if (WARN(!(caps & ENG_CAP_PRESENT), "%s() called for DMA Engine at %p which isn't present in hardware!\n", __func__, eng)) @@ -161,8 +159,6 @@ void stop_dma_engine(struct kpc_dma_device *eng) { unsigned long timeout; - dev_dbg(&eng->pldev->dev, "Destroying DMA engine [%p]\n", eng); - // Disable the descriptor engine WriteEngineControl(eng, 0); -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging: kpc2000: remove unnecessary debug prints in cell_probe.c
Debug prints that are used only to inform about function entry or exit can be removed as ftrace can be used to get this information. Signed-off-by: Simon Sandström --- drivers/staging/kpc2000/kpc2000/cell_probe.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000/cell_probe.c b/drivers/staging/kpc2000/kpc2000/cell_probe.c index f731a97c6cac..138d16bcf6e1 100644 --- a/drivers/staging/kpc2000/kpc2000/cell_probe.c +++ b/drivers/staging/kpc2000/kpc2000/cell_probe.c @@ -344,8 +344,6 @@ static int create_dma_engine_core(struct kp2000_device *pcard, size_t engine_re struct mfd_cell cell = { .id = engine_num }; struct resource resources[2]; - dev_dbg(&pcard->pdev->dev, "create_dma_core(pcard = [%p], engine_regs_offset = %zx, engine_num = %d)\n", pcard, engine_regs_offset, engine_num); - cell.platform_data = NULL; cell.pdata_size = 0; cell.name = KP_DRIVER_NAME_DMA_CONTROLLER; @@ -414,9 +412,6 @@ int kp2000_probe_cores(struct kp2000_device *pcard) unsigned int highest_core_id = 0; struct core_table_entry cte; - dev_dbg(&pcard->pdev->dev, "%s(pcard = %p / %d)\n", __func__, pcard, - pcard->card_num); - err = kp2000_setup_dma_controller(pcard); if (err) return err; -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: erofs: add requirements field in superblock
There are some backward incompatible optimizations pending for months, mainly due to on-disk format expensions. However, we should ensure that it cannot be mounted with old kernels. Otherwise, it will causes unexpected behaviors. Fixes: ba2b77a82022 ("staging: erofs: add super block operations") Cc: # 4.19+ Signed-off-by: Gao Xiang --- drivers/staging/erofs/erofs_fs.h | 11 +-- drivers/staging/erofs/super.c| 8 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/staging/erofs/erofs_fs.h b/drivers/staging/erofs/erofs_fs.h index fa52898df006..531821757845 100644 --- a/drivers/staging/erofs/erofs_fs.h +++ b/drivers/staging/erofs/erofs_fs.h @@ -17,10 +17,16 @@ #define EROFS_SUPER_MAGIC_V10xE0F5E1E2 #define EROFS_SUPER_OFFSET 1024 +/* + * Any bits that aren't in EROFS_ALL_REQUIREMENTS should be + * incompatible with this kernel version. + */ +#define EROFS_ALL_REQUIREMENTS 0 + struct erofs_super_block { /* 0 */__le32 magic; /* in the little endian */ /* 4 */__le32 checksum;/* crc32c(super_block) */ -/* 8 */__le32 features; +/* 8 */__le32 features;/* extra features for the image */ /* 12 */__u8 blkszbits; /* support block_size == PAGE_SIZE only */ /* 13 */__u8 reserved; @@ -34,8 +40,9 @@ struct erofs_super_block { /* 44 */__le32 xattr_blkaddr; /* 48 */__u8 uuid[16]; /* 128-bit uuid for volume */ /* 64 */__u8 volume_name[16]; /* volume name */ +/* 80 */__le32 requirements;/* all mandatory minimum requirements */ -/* 80 */__u8 reserved2[48]; /* 128 bytes */ +/* 84 */__u8 reserved2[44]; /* 128 bytes */ } __packed; /* diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index f580d4ef77a1..815e5825db59 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -104,6 +104,14 @@ static int superblock_read(struct super_block *sb) goto out; } + /* check if the kernel meets all mandatory requirements */ + if (le32_to_cpu(layout->requirements) & (~EROFS_ALL_REQUIREMENTS)) { + errln("too old to meet minimum requirements: %x supported: %x", + le32_to_cpu(layout->requirements), + EROFS_ALL_REQUIREMENTS); + goto out; + } + sbi->blocks = le32_to_cpu(layout->blocks); sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr); #ifdef CONFIG_EROFS_FS_XATTR -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: erofs: rename data_mapping_mode to datamode
data_mapping_mode is too long as a member name of erofs_vnode, datamode is straight-forward enough. Signed-off-by: Gao Xiang --- drivers/staging/erofs/inode.c| 17 - drivers/staging/erofs/internal.h | 10 -- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index 9520419f746c..e51348f7e838 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -22,11 +22,11 @@ static int read_inode(struct inode *inode, void *data) const unsigned int advise = le16_to_cpu(v1->i_advise); erofs_blk_t nblks = 0; - vi->data_mapping_mode = __inode_data_mapping(advise); + vi->datamode = __inode_data_mapping(advise); - if (unlikely(vi->data_mapping_mode >= EROFS_INODE_LAYOUT_MAX)) { - errln("unknown data mapping mode %u of nid %llu", - vi->data_mapping_mode, vi->nid); + if (unlikely(vi->datamode >= EROFS_INODE_LAYOUT_MAX)) { + errln("unsupported data mapping %u of nid %llu", + vi->datamode, vi->nid); DBG_BUGON(1); return -EIO; } @@ -63,7 +63,7 @@ static int read_inode(struct inode *inode, void *data) inode->i_size = le64_to_cpu(v2->i_size); /* total blocks for compressed files */ - if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) + if (is_inode_layout_compression(inode)) nblks = le32_to_cpu(v2->i_u.compressed_blocks); } else if (__inode_version(advise) == EROFS_INODE_LAYOUT_V1) { struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb); @@ -95,7 +95,7 @@ static int read_inode(struct inode *inode, void *data) sbi->build_time_nsec; inode->i_size = le32_to_cpu(v1->i_size); - if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) + if (is_inode_layout_compression(inode)) nblks = le32_to_cpu(v1->i_u.compressed_blocks); } else { errln("unsupported on-disk inode version %u of nid %llu", @@ -127,7 +127,7 @@ static int fill_inline_data(struct inode *inode, void *data, { struct erofs_vnode *vi = EROFS_V(inode); struct erofs_sb_info *sbi = EROFS_I_SB(inode); - int mode = vi->data_mapping_mode; + const int mode = vi->datamode; DBG_BUGON(mode >= EROFS_INODE_LAYOUT_MAX); @@ -299,9 +299,8 @@ int erofs_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int query_flags) { struct inode *const inode = d_inode(path->dentry); - struct erofs_vnode *const vi = EROFS_V(inode); - if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) + if (is_inode_layout_compression(inode)) stat->attributes |= STATX_ATTR_COMPRESSED; stat->attributes |= STATX_ATTR_IMMUTABLE; diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 911333cdeef4..6a7eb04d29b4 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -347,8 +347,7 @@ struct erofs_vnode { /* atomic flags (including bitlocks) */ unsigned long flags; - unsigned char data_mapping_mode; - /* inline size in bytes */ + unsigned char datamode; unsigned char inode_isize; unsigned short xattr_isize; @@ -383,18 +382,17 @@ static inline unsigned long inode_datablocks(struct inode *inode) static inline bool is_inode_layout_plain(struct inode *inode) { - return EROFS_V(inode)->data_mapping_mode == EROFS_INODE_LAYOUT_PLAIN; + return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_PLAIN; } static inline bool is_inode_layout_compression(struct inode *inode) { - return EROFS_V(inode)->data_mapping_mode == - EROFS_INODE_LAYOUT_COMPRESSION; + return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_COMPRESSION; } static inline bool is_inode_layout_inline(struct inode *inode) { - return EROFS_V(inode)->data_mapping_mode == EROFS_INODE_LAYOUT_INLINE; + return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_INLINE; } extern const struct super_operations erofs_sops; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/3] media: imx7-media-csi: add i.MX6UL support
Hi Sebastien, Thanks for the patch. On Thu 06 Jun 2019 at 16:38, Sébastien Szymanski wrote: > i.MX7 and i.MX6UL/L have the same CSI controller. So add i.MX6UL/L support > to imx7-media-csi driver. > > Signed-off-by: Sébastien Szymanski > --- > > Changes for v2: > - rebase on top of linuxtv/master > - mention i.MX6UL/L in header and Kconfig help text > - rename csi_type to csi_soc_id > > drivers/staging/media/imx/Kconfig | 4 +- > drivers/staging/media/imx/imx7-media-csi.c | 62 -- > 2 files changed, 49 insertions(+), 17 deletions(-) > > diff --git a/drivers/staging/media/imx/Kconfig > b/drivers/staging/media/imx/Kconfig > index ad3d7df6bb3c..8b6dc42c39e0 100644 > --- a/drivers/staging/media/imx/Kconfig > +++ b/drivers/staging/media/imx/Kconfig > @@ -22,11 +22,11 @@ config VIDEO_IMX_CSI > A video4linux camera sensor interface driver for i.MX5/6. > > config VIDEO_IMX7_CSI > - tristate "i.MX7 Camera Sensor Interface driver" > + tristate "i.MX6UL/L / i.MX7 Camera Sensor Interface driver" > depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C > default y > help > Enable support for video4linux camera sensor interface driver for > - i.MX7. > + i.MX6UL/L or i.MX7. > endmenu > endif > diff --git a/drivers/staging/media/imx/imx7-media-csi.c > b/drivers/staging/media/imx/imx7-media-csi.c > index 9101566f3f67..902bdce594cf 100644 > --- a/drivers/staging/media/imx/imx7-media-csi.c > +++ b/drivers/staging/media/imx/imx7-media-csi.c > @@ -1,6 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0 > /* > - * V4L2 Capture CSI Subdev for Freescale i.MX7 SOC > + * V4L2 Capture CSI Subdev for Freescale i.MX6UL/L / i.MX7 SOC > * > * Copyright (c) 2019 Linaro Ltd > * > @@ -152,6 +152,11 @@ > #define CSI_CSICR18 0x48 > #define CSI_CSICR19 0x4c > > +enum csi_soc_id { > + IMX7, > + IMX6UL > +}; > + > struct imx7_csi { > struct device *dev; > struct v4l2_subdev sd; > @@ -191,6 +196,7 @@ struct imx7_csi { > bool is_init; > bool is_streaming; > bool is_csi2; > + enum csi_soc_id soc_id; > > struct completion last_eof_completion; > }; > @@ -548,6 +554,14 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev > *sd, > if (ret) > return ret; > > + if (csi->soc_id == IMX6UL) { > + mutex_lock(&csi->lock); > + csi->is_csi2 = false; > + mutex_unlock(&csi->lock); > + > + return 0; > + } > + > ret = imx7_csi_get_upstream_endpoint(csi, &upstream_ep, true); > if (ret) { > v4l2_err(&csi->sd, "failed to find upstream endpoint\n"); > @@ -757,6 +771,7 @@ static int imx7_csi_configure(struct imx7_csi *csi) > struct v4l2_pix_format *out_pix = &vdev->fmt.fmt.pix; > __u32 in_code = csi->format_mbus[IMX7_CSI_PAD_SINK].code; > u32 cr1, cr18; > + int width = out_pix->width; > > if (out_pix->field == V4L2_FIELD_INTERLACED) { > imx7_csi_deinterlace_enable(csi, true); > @@ -766,15 +781,27 @@ static int imx7_csi_configure(struct imx7_csi *csi) > imx7_csi_buf_stride_set(csi, 0); > } > > - imx7_csi_set_imagpara(csi, out_pix->width, out_pix->height); > + cr18 = imx7_csi_reg_read(csi, CSI_CSICR18); > + > + if (!csi->is_csi2) { > + if (out_pix->pixelformat == V4L2_PIX_FMT_UYVY || > + out_pix->pixelformat == V4L2_PIX_FMT_YUYV) > + width *= 2; > + > + imx7_csi_set_imagpara(csi, width, out_pix->height); > + > + cr18 |= (BIT_BASEADDR_SWITCH_EN | BIT_BASEADDR_SWITCH_SEL | > + BIT_BASEADDR_CHG_ERR_EN); > + imx7_csi_reg_write(csi, cr18, CSI_CSICR18); > > - if (!csi->is_csi2) > return 0; > + } > + > + imx7_csi_set_imagpara(csi, width, out_pix->height); > > cr1 = imx7_csi_reg_read(csi, CSI_CSICR1); > cr1 &= ~BIT_GCLK_MODE; > > - cr18 = imx7_csi_reg_read(csi, CSI_CSICR18); > cr18 &= BIT_MIPI_DATA_FORMAT_MASK; > cr18 |= BIT_DATA_FROM_MIPI; > > @@ -809,11 +836,9 @@ static void imx7_csi_enable(struct imx7_csi *csi) > { > imx7_csi_sw_reset(csi); > > - if (csi->is_csi2) { > - imx7_csi_dmareq_rff_enable(csi); > - imx7_csi_hw_enable_irq(csi); > - imx7_csi_hw_enable(csi); > - } > + imx7_csi_dmareq_rff_enable(csi); > + imx7_csi_hw_enable_irq(csi); > + imx7_csi_hw_enable(csi); > } > > static void imx7_csi_disable(struct imx7_csi *csi) > @@ -1166,19 +1191,32 @@ static int imx7_csi_parse_endpoint(struct device *dev, > return fwnode_device_is_available(asd->match.fwnode) ? 0 : -EINVAL; > } > > +static const struct of_device_id imx7_csi_of_match[] = { > + { .compatible = "fsl,imx7-csi", .data = (void *)IMX7 }, > + { .compatible = "fsl,imx6ul-csi", .data = (void *)IMX6UL }, looking at this again I think we can do this is
Re: [PATCH v2 2/3] media: imx7-media-csi: add i.MX6UL support
Hi Randy, On Fri 07 Jun 2019 at 00:10, Randy Dunlap wrote: > On 6/6/19 8:38 AM, Sébastien Szymanski wrote: >> i.MX7 and i.MX6UL/L have the same CSI controller. So add i.MX6UL/L support >> to imx7-media-csi driver. >> >> Signed-off-by: Sébastien Szymanski >> --- >> >> Changes for v2: >> - rebase on top of linuxtv/master >> - mention i.MX6UL/L in header and Kconfig help text >> - rename csi_type to csi_soc_id >> >> drivers/staging/media/imx/Kconfig | 4 +- >> drivers/staging/media/imx/imx7-media-csi.c | 62 -- >> 2 files changed, 49 insertions(+), 17 deletions(-) >> >> diff --git a/drivers/staging/media/imx/Kconfig >> b/drivers/staging/media/imx/Kconfig >> index ad3d7df6bb3c..8b6dc42c39e0 100644 >> --- a/drivers/staging/media/imx/Kconfig >> +++ b/drivers/staging/media/imx/Kconfig >> @@ -22,11 +22,11 @@ config VIDEO_IMX_CSI >>A video4linux camera sensor interface driver for i.MX5/6. >> >> config VIDEO_IMX7_CSI >> -tristate "i.MX7 Camera Sensor Interface driver" >> +tristate "i.MX6UL/L / i.MX7 Camera Sensor Interface driver" >> depends on VIDEO_IMX_MEDIA && VIDEO_DEV && I2C >> default y > > Hi, > I realize that this "default y" is not part of this patch set, but we have > pretty strong guidance that a driver should not default to 'y' unless it is > needed for a system to boot. If this driver is optional, then please drop > the 2 occurrences of "default y" in this Kconfig file. Yeah, even though both depends on imx_media, I agree that they should not default to y. I will send a patch for this. Thanks. --- Cheers, Rui > > thanks. >> help >>Enable support for video4linux camera sensor interface driver for >> - i.MX7. >> + i.MX6UL/L or i.MX7. >> endmenu >> endif ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/16] Staging: wlan-ng: cfg80211: fixed alignment issue with open parenthesis line ending with (
From: Merwin Trever Ferrao Fixed a coding style issue. Signed-off-by: Merwin Trever Ferrao --- drivers/staging/wlan-ng/cfg80211.c | 32 ++ 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index eee1998c4b18..5424e2682911 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c @@ -324,8 +324,7 @@ static int prism2_scan(struct wiphy *wiphy, (i < request->n_channels) && i < ARRAY_SIZE(prism2_channels); i++) msg1.channellist.data.data[i] = - ieee80211_frequency_to_channel( - request->channels[i]->center_freq); + ieee80211_frequency_to_channel(request->channels[i]->center_freq); msg1.channellist.data.len = request->n_channels; msg1.maxchanneltime.data = 250; @@ -359,15 +358,15 @@ static int prism2_scan(struct wiphy *wiphy, freq = ieee80211_channel_to_frequency(msg2.dschannel.data, NL80211_BAND_2GHZ); bss = cfg80211_inform_bss(wiphy, - ieee80211_get_channel(wiphy, freq), - CFG80211_BSS_FTYPE_UNKNOWN, - (const u8 *)&msg2.bssid.data.data, - msg2.timestamp.data, msg2.capinfo.data, - msg2.beaconperiod.data, - ie_buf, - ie_len, - (msg2.signal.data - 65536) * 100, /* Conversion to signed type */ - GFP_KERNEL + ieee80211_get_channel(wiphy, freq), + CFG80211_BSS_FTYPE_UNKNOWN, + (const u8 *)&msg2.bssid.data.data, + msg2.timestamp.data, msg2.capinfo.data, + msg2.beaconperiod.data, + ie_buf, + ie_len, + (msg2.signal.data - 65536) * 100, /* Conversion to signed type */ + GFP_KERNEL ); if (!bss) { @@ -475,14 +474,13 @@ static int prism2_connect(struct wiphy *wiphy, struct net_device *dev, } result = prism2_domibset_uint32(wlandev, - DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, - sme->key_idx); + DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, + sme->key_idx); if (result) goto exit; /* send key to driver */ - did = didmib_dot11smt_wepdefaultkeystable_key( - sme->key_idx + 1); + did = didmib_dot11smt_wepdefaultkeystable_key(sme->key_idx + 1); result = prism2_domibset_pstr32(wlandev, did, sme->key_len, (u8 *)sme->key); @@ -588,8 +586,8 @@ static int prism2_set_tx_power(struct wiphy *wiphy, struct wireless_dev *wdev, data = MBM_TO_DBM(mbm); result = prism2_domibset_uint32(wlandev, - DIDMIB_DOT11PHY_TXPOWERTABLE_CURRENTTXPOWERLEVEL, - data); + DIDMIB_DOT11PHY_TXPOWERTABLE_CURRENTTXPOWERLEVEL, + data); if (result) { err = -EFAULT; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 -next] staging: fieldbus: Fix build error without CONFIG_REGMAP_MMIO
Hello Greg, just a friendly ping regarding this patch. It got my Reviewed-by tag two weeks ago, no further feedback from anyone. Is there anything you would like us to do before queuing this? Link to v2 that got the Reviewed-by: https://lkml.org/lkml/2019/5/28/609 On Tue, May 28, 2019 at 1:31 PM Sven Van Asbroeck wrote: > For the v2 patch: > Reviewed-by: Sven Van Asbroeck > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 -next] staging: fieldbus: Fix build error without CONFIG_REGMAP_MMIO
On Mon, Jun 10, 2019 at 08:51:10AM -0400, Sven Van Asbroeck wrote: > Hello Greg, just a friendly ping regarding this patch. It got my Reviewed-by > tag > two weeks ago, no further feedback from anyone. Is there anything you would > like us to do before queuing this? > > Link to v2 that got the Reviewed-by: > https://lkml.org/lkml/2019/5/28/609 > > On Tue, May 28, 2019 at 1:31 PM Sven Van Asbroeck wrote: > > For the v2 patch: > > Reviewed-by: Sven Van Asbroeck Odd, sorry, must have fell through the cracks, I'll pick it up now. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8712: remove the leading spaces
This patch fixes the checkpatch warning, removing leading spaces to make sure that tabstop starts a new line. Signed-off-by: Li Mingshuo --- drivers/staging/rtl8712/rtl871x_xmit.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8712/rtl871x_xmit.h b/drivers/staging/rtl8712/rtl871x_xmit.h index 3bea2e374f13..4199cb586fb1 100644 --- a/drivers/staging/rtl8712/rtl871x_xmit.h +++ b/drivers/staging/rtl8712/rtl871x_xmit.h @@ -148,8 +148,8 @@ struct xmit_frame { _pkt *pkt; int frame_tag; struct _adapter *padapter; -u8 *buf_addr; -struct xmit_buf *pxmitbuf; + u8 *buf_addr; + struct xmit_buf *pxmitbuf; u8 *mem_addr; u16 sz[8]; struct urb *pxmit_urb[8]; -- 2.21.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: rtl8712: r8712_setdatarate_cmd(): Change
On Mon, Jun 10, 2019 at 10:02:27AM +0530, Nishka Dasgupta wrote: > On 07/06/19 7:45 PM, Dan Carpenter wrote: > > Probably you sent this patch unintentionally. The subject doesn't make > > any sort of sense. :P > > So the problem with the subject line is that git send-email and vim (as > configured on my laptop) tend to line-wrap even the subject line. Since I > have two patches that do the same thing for different functions, I felt I > should have the driver and the function name in the subject line (to avoid > confusion between the patches and to allow for easy searching later). But > that doesn't leave enough space in the subject line for "Change return > values/type" or any other descriptive message. What should I do? > I don't really care. [PATCH] staging: rtl8712: clean up r8712_setdatarate_cmd() return type regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 16/16] Staging: wlan-ng: cfg80211: fixed alignment issue with open parenthesis line ending with (
On Mon, Jun 10, 2019 at 04:08:25PM +0530, Merwin Trever Ferrao wrote: > From: Merwin Trever Ferrao > > Fixed a coding style issue. > > Signed-off-by: Merwin Trever Ferrao > --- > drivers/staging/wlan-ng/cfg80211.c | 32 ++ > 1 file changed, 15 insertions(+), 17 deletions(-) > > diff --git a/drivers/staging/wlan-ng/cfg80211.c > b/drivers/staging/wlan-ng/cfg80211.c > index eee1998c4b18..5424e2682911 100644 > --- a/drivers/staging/wlan-ng/cfg80211.c > +++ b/drivers/staging/wlan-ng/cfg80211.c > @@ -324,8 +324,7 @@ static int prism2_scan(struct wiphy *wiphy, > (i < request->n_channels) && i < ARRAY_SIZE(prism2_channels); > i++) > msg1.channellist.data.data[i] = > - ieee80211_frequency_to_channel( > - request->channels[i]->center_freq); > + > ieee80211_frequency_to_channel(request->channels[i]->center_freq); And now you violate the other coding style rule of too long lines :( You can just keep sending patches fixing this back and forth, if you want a never-ending set of patches to be applied, but we don't really like that. So the code is ok as-is. > msg1.channellist.data.len = request->n_channels; > > msg1.maxchanneltime.data = 250; > @@ -359,15 +358,15 @@ static int prism2_scan(struct wiphy *wiphy, > freq = ieee80211_channel_to_frequency(msg2.dschannel.data, > NL80211_BAND_2GHZ); > bss = cfg80211_inform_bss(wiphy, > - ieee80211_get_channel(wiphy, freq), > - CFG80211_BSS_FTYPE_UNKNOWN, > - (const u8 *)&msg2.bssid.data.data, > - msg2.timestamp.data, msg2.capinfo.data, > - msg2.beaconperiod.data, > - ie_buf, > - ie_len, > - (msg2.signal.data - 65536) * 100, /* Conversion to > signed type */ > - GFP_KERNEL > + ieee80211_get_channel(wiphy, freq), > + CFG80211_BSS_FTYPE_UNKNOWN, > + (const u8 *)&msg2.bssid.data.data, > + msg2.timestamp.data, > msg2.capinfo.data, > + msg2.beaconperiod.data, > + ie_buf, > + ie_len, > + (msg2.signal.data - 65536) * 100, /* > Conversion to signed type */ > + GFP_KERNEL > ); Why is this final ); way over here? > > if (!bss) { > @@ -475,14 +474,13 @@ static int prism2_connect(struct wiphy *wiphy, struct > net_device *dev, > } > > result = prism2_domibset_uint32(wlandev, > - DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > - sme->key_idx); > + > DIDMIB_DOT11SMT_PRIVACYTABLE_WEPDEFAULTKEYID, > + sme->key_idx); > if (result) > goto exit; > > /* send key to driver */ > - did = didmib_dot11smt_wepdefaultkeystable_key( > - sme->key_idx + 1); > + did = > didmib_dot11smt_wepdefaultkeystable_key(sme->key_idx + 1); Too long of a line. Remember, checkpatch is just a "hint", you still have to use your brain when looking at the output of it. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: kpc2000: kpc_i2c: remove the macros inb_p and outb_p
On Mon, Jun 10, 2019 at 03:48:24PM +0800, Hao Xu wrote: > remove inb_p and outb_p to call readq/writeq directly. > > Signed-off-by: Hao Xu > --- > Changes in v2: > - remove the macros inb_p/outb_p and use readq/writeq directly, per > https://lkml.kernel.org/lkml/20190608134505.ga...@arch-01.home/ > --- > drivers/staging/kpc2000/kpc2000_i2c.c | 112 > -- > 1 file changed, 53 insertions(+), 59 deletions(-) > > diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c > b/drivers/staging/kpc2000/kpc2000_i2c.c > index 69e8773..246d5b3 100644 > --- a/drivers/staging/kpc2000/kpc2000_i2c.c > +++ b/drivers/staging/kpc2000/kpc2000_i2c.c > @@ -122,12 +122,6 @@ struct i2c_device { > /* Not really a feature, but it's convenient to handle it as such */ > #define FEATURE_IDF BIT(15) > > -// FIXME! > -#undef inb_p > -#define inb_p(a) readq((void *)a) > -#undef outb_p > -#define outb_p(d, a) writeq(d, (void *)a) > - > /* Make sure the SMBus host is ready to start transmitting. > * Return 0 if it is, -EBUSY if it is not. > */ > @@ -135,7 +129,7 @@ static int i801_check_pre(struct i2c_device *priv) > { > int status; > > - status = inb_p(SMBHSTSTS(priv)); > + status = readq((void *)SMBHSTSTS(priv)); Ugh, all of the void * casting, is is really needed everywhere? That just makes everything a mess... thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: kpc2000: To make symbols static
On Mon, Jun 10, 2019 at 05:50:01AM +, Rishiraj Manwatkar wrote: > This patch makes 4 symbols static as suggested by Sparse tool. > > Signed-off-by: Rishiraj Manwatkar Your subject line is very odd, what does that really mean? > --- > drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c > b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c > index cda057569163..e4056607af0b 100644 > --- a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c > +++ b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c > @@ -36,14 +36,14 @@ struct kpc_dma_device *kpc_dma_lookup_device(int minor) > return c; > } > > -void kpc_dma_add_device(struct kpc_dma_device *ldev) > +static void kpc_dma_add_device(struct kpc_dma_device *ldev) This patch does not apply to my latest tree, can you rebase it against the staging-next branch of staging.git on git.kernel.org and resend? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 14/33] docs: kbuild: convert docs to ReST and rename to *.rst
In data Sunday, June 9, 2019 4:27:04 AM CEST, Mauro Carvalho Chehab ha scritto: > The kbuild documentation clearly shows that the documents > there are written at different times: some use markdown, > some use their own peculiar logic to split sections. > > Convert everything to ReST without affecting too much > the author's style and avoiding adding uneeded markups. > > The conversion is actually: > - add blank lines and identation in order to identify paragraphs; > - fix tables markups; > - add some lists markups; > - mark literal blocks; > - adjust title markups. > > At its new index.rst, let's add a :orphan: while this is not linked to > the main index.rst file, in order to avoid build warnings. > > Signed-off-by: Mauro Carvalho Chehab > --- > Documentation/admin-guide/README.rst | 2 +- > ...eaders_install.txt => headers_install.rst} | 5 +- > Documentation/kbuild/index.rst| 27 + > Documentation/kbuild/issues.rst | 11 + > .../kbuild/{kbuild.txt => kbuild.rst} | 119 ++-- > ...nfig-language.txt => kconfig-language.rst} | 232 > ...anguage.txt => kconfig-macro-language.rst} | 37 +- > .../kbuild/{kconfig.txt => kconfig.rst} | 136 +++-- > .../kbuild/{makefiles.txt => makefiles.rst} | 530 +++--- > .../kbuild/{modules.txt => modules.rst} | 168 +++--- > Documentation/kernel-hacking/hacking.rst | 4 +- > Documentation/process/coding-style.rst| 2 +- > Documentation/process/submit-checklist.rst| 2 +- > .../it_IT/kernel-hacking/hacking.rst | 4 +- > .../it_IT/process/coding-style.rst| 2 +- > .../it_IT/process/submit-checklist.rst| 2 +- Limited to translations/it_IT Acked-by: Federico Vaga > .../zh_CN/process/coding-style.rst| 2 +- > .../zh_CN/process/submit-checklist.rst| 2 +- > Kconfig | 2 +- > arch/arc/plat-eznps/Kconfig | 2 +- > arch/c6x/Kconfig | 2 +- > arch/microblaze/Kconfig.debug | 2 +- > arch/microblaze/Kconfig.platform | 2 +- > arch/nds32/Kconfig| 2 +- > arch/openrisc/Kconfig | 2 +- > arch/powerpc/sysdev/Kconfig | 2 +- > arch/riscv/Kconfig| 2 +- > drivers/auxdisplay/Kconfig| 2 +- > drivers/firmware/Kconfig | 2 +- > drivers/mtd/devices/Kconfig | 2 +- > drivers/net/ethernet/smsc/Kconfig | 6 +- > drivers/net/wireless/intel/iwlegacy/Kconfig | 4 +- > drivers/net/wireless/intel/iwlwifi/Kconfig| 2 +- > drivers/parport/Kconfig | 2 +- > drivers/scsi/Kconfig | 4 +- > drivers/staging/sm750fb/Kconfig | 2 +- > drivers/usb/misc/Kconfig | 4 +- > drivers/video/fbdev/Kconfig | 14 +- > net/bridge/netfilter/Kconfig | 2 +- > net/ipv4/netfilter/Kconfig| 2 +- > net/ipv6/netfilter/Kconfig| 2 +- > net/netfilter/Kconfig | 16 +- > net/tipc/Kconfig | 2 +- > scripts/Kbuild.include| 4 +- > scripts/Makefile.host | 2 +- > scripts/kconfig/symbol.c | 2 +- > .../tests/err_recursive_dep/expected_stderr | 14 +- > sound/oss/dmasound/Kconfig| 6 +- > 48 files changed, 840 insertions(+), 561 deletions(-) > rename Documentation/kbuild/{headers_install.txt => headers_install.rst} > (96%) create mode 100644 Documentation/kbuild/index.rst > create mode 100644 Documentation/kbuild/issues.rst > rename Documentation/kbuild/{kbuild.txt => kbuild.rst} (72%) > rename Documentation/kbuild/{kconfig-language.txt => kconfig-language.rst} > (85%) rename Documentation/kbuild/{kconfig-macro-language.txt => > kconfig-macro-language.rst} (94%) rename Documentation/kbuild/{kconfig.txt > => kconfig.rst} (80%) > rename Documentation/kbuild/{makefiles.txt => makefiles.rst} (83%) > rename Documentation/kbuild/{modules.txt => modules.rst} (84%) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723bs: fix spaces required around unary operator
this patch fixes below issues reported by checkpatch ERROR: spaces required around that '=' (ctx:WxV) ERROR: spaces required around that '=' (ctx:WxV) ERROR: spaces required around that '<' (ctx:VxV) Signed-off-by: Hariprasad Kelam --- drivers/staging/rtl8723bs/os_dep/osdep_service.c | 36 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/osdep_service.c b/drivers/staging/rtl8723bs/os_dep/osdep_service.c index a5a5a5c..1d2c581 100644 --- a/drivers/staging/rtl8723bs/os_dep/osdep_service.c +++ b/drivers/staging/rtl8723bs/os_dep/osdep_service.c @@ -77,13 +77,13 @@ static int openFile(struct file **fpp, char *path, int flag, int mode) { struct file *fp; - fp =filp_open(path, flag, mode); + fp = filp_open(path, flag, mode); if (IS_ERR(fp)) { *fpp = NULL; return PTR_ERR(fp); } else { - *fpp =fp; + *fpp = fp; return 0; } } @@ -106,10 +106,10 @@ static int readFile(struct file *fp, char *buf, int len) if (!fp->f_op || !fp->f_op->read) return -EPERM; - while (sumf_pos); - if (rlen>0) - sum+=rlen; + if (rlen > 0) + sum += rlen; else if (0 != rlen) return rlen; else @@ -131,7 +131,7 @@ static int isFileReadable(char *path) int ret = 0; char buf; - fp =filp_open(path, O_RDONLY, 0); + fp = filp_open(path, O_RDONLY, 0); if (IS_ERR(fp)) return PTR_ERR(fp); @@ -151,7 +151,7 @@ static int isFileReadable(char *path) */ static int retriveFromFile(char *path, u8 *buf, u32 sz) { - int ret =-1; + int ret = -1; struct file *fp; if (path && buf) { @@ -160,7 +160,7 @@ static int retriveFromFile(char *path, u8 *buf, u32 sz) if (ret == 0) { DBG_871X("%s openFile path:%s fp =%p\n", __func__, path , fp); - ret =readFile(fp, buf, sz); + ret = readFile(fp, buf, sz); closeFile(fp); DBG_871X("%s readFile, ret:%d\n", __func__, ret); @@ -197,8 +197,8 @@ int rtw_is_file_readable(char *path) */ int rtw_retrive_from_file(char *path, u8 *buf, u32 sz) { - int ret =retriveFromFile(path, buf, sz); - return ret>= 0?ret:0; + int ret = retriveFromFile(path, buf, sz); + return ret >= 0 ? ret : 0; } struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_priv) @@ -211,8 +211,8 @@ struct net_device *rtw_alloc_etherdev_with_old_priv(int sizeof_priv, void *old_p goto RETURN; pnpi = netdev_priv(pnetdev); - pnpi->priv =old_priv; - pnpi->sizeof_priv =sizeof_priv; + pnpi->priv = old_priv; + pnpi->sizeof_priv = sizeof_priv; RETURN: return pnetdev; @@ -236,7 +236,7 @@ struct net_device *rtw_alloc_etherdev(int sizeof_priv) goto RETURN; } - pnpi->sizeof_priv =sizeof_priv; + pnpi->sizeof_priv = sizeof_priv; RETURN: return pnetdev; } @@ -284,7 +284,7 @@ int rtw_change_ifname(struct adapter *padapter, const char *ifname) else unregister_netdevice(cur_pnetdev); - rereg_priv->old_pnetdev =cur_pnetdev; + rereg_priv->old_pnetdev = cur_pnetdev; pnetdev = rtw_init_netdev(padapter); if (!pnetdev) { @@ -379,7 +379,7 @@ void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len) */ inline bool rtw_cbuf_full(struct rtw_cbuf *cbuf) { - return (cbuf->write == cbuf->read-1)? true : false; + return (cbuf->write == cbuf->read - 1) ? true : false; } /** @@ -390,7 +390,7 @@ inline bool rtw_cbuf_full(struct rtw_cbuf *cbuf) */ inline bool rtw_cbuf_empty(struct rtw_cbuf *cbuf) { - return (cbuf->write == cbuf->read)? true : false; + return (cbuf->write == cbuf->read) ? true : false; } /** @@ -408,7 +408,7 @@ bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf) DBG_871X("%s on %u\n", __func__, cbuf->write); cbuf->bufs[cbuf->write] = buf; - cbuf->write = (cbuf->write+1)%cbuf->size; + cbuf->write = (cbuf->write + 1) % cbuf->size; return _SUCCESS; } @@ -428,7 +428,7 @@ void *rtw_cbuf_pop(struct rtw_cbuf *cbuf) DBG_871X("%s on %u\n", __func__, cbuf->read); buf = cbuf->bufs[cbuf->read]; - cbuf->read = (cbuf->read+1)%cbuf->size; + cbuf->read = (cbuf->read + 1) % cbuf->size; return buf; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] staging: kpc2000: minor fixes in kp2000_pcie_probe
These two patches fixes issues pointed out by Dan in a previous staging/kpc2000 patch thread: many comments in kp2000_pcie_probe just repeats the code and the current label names doesn't add any information and makes it hard to follow the code. Rename all labels and remove the comments that just repeats the code. Simon Sandström (2): staging: kpc2000: improve label names in kp2000_pcie_probe staging: kpc2000: remove unnecessary comments in kp2000_pcie_probe drivers/staging/kpc2000/kpc2000/core.c | 80 -- 1 file changed, 25 insertions(+), 55 deletions(-) -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: kpc2000: improve label names in kp2000_pcie_probe
Use self-explanatory label names instead of the generic numbered ones, to make it easier to follow and understand the code. Signed-off-by: Simon Sandström --- drivers/staging/kpc2000/kpc2000/core.c | 42 -- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000/core.c b/drivers/staging/kpc2000/kpc2000/core.c index 9b9b29ac90c5..ee6b9be7127d 100644 --- a/drivers/staging/kpc2000/kpc2000/core.c +++ b/drivers/staging/kpc2000/kpc2000/core.c @@ -327,7 +327,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, if (err < 0) { dev_err(&pdev->dev, "probe: failed to get card number (%d)\n", err); - goto out2; + goto err_free_pcard; } pcard->card_num = err; scnprintf(pcard->name, 16, "kpcard%u", pcard->card_num); @@ -346,7 +346,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, dev_err(&pcard->pdev->dev, "probe: failed to enable PCIE2000 PCIe device (%d)\n", err); - goto out3; + goto err_remove_ida; } /* @@ -360,7 +360,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, dev_err(&pcard->pdev->dev, "probe: REG_BAR could not remap memory to virtual space\n"); err = -ENODEV; - goto out4; + goto err_disable_device; } dev_dbg(&pcard->pdev->dev, "probe: REG_BAR virt hardware address start [%p]\n", @@ -373,7 +373,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, "probe: failed to acquire PCI region (%d)\n", err); err = -ENODEV; - goto out4; + goto err_disable_device; } pcard->regs_base_resource.start = reg_bar_phys_addr; @@ -393,7 +393,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, dev_err(&pcard->pdev->dev, "probe: DMA_BAR could not remap memory to virtual space\n"); err = -ENODEV; - goto out5; + goto err_unmap_regs; } dev_dbg(&pcard->pdev->dev, "probe: DMA_BAR virt hardware address start [%p]\n", @@ -407,7 +407,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, dev_err(&pcard->pdev->dev, "probe: failed to acquire PCI region (%d)\n", err); err = -ENODEV; - goto out5; + goto err_unmap_regs; } pcard->dma_base_resource.start = dma_bar_phys_addr; @@ -421,7 +421,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, pcard->sysinfo_regs_base = pcard->regs_bar_base; err = read_system_regs(pcard); if (err) - goto out6; + goto err_unmap_dma; // Disable all "user" interrupts because they're not used yet. writeq(0x, @@ -461,7 +461,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, if (err) { dev_err(&pcard->pdev->dev, "CANNOT use DMA mask %0llx\n", DMA_BIT_MASK(64)); - goto out7; + goto err_unmap_dma; } dev_dbg(&pcard->pdev->dev, "Using DMA mask %0llx\n", dma_get_mask(PCARD_TO_DEV(pcard))); @@ -471,14 +471,14 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, */ err = pci_enable_msi(pcard->pdev); if (err < 0) - goto out8a; + goto err_unmap_dma; rv = request_irq(pcard->pdev->irq, kp2000_irq_handler, IRQF_SHARED, pcard->name, pcard); if (rv) { dev_err(&pcard->pdev->dev, "%s: failed to request_irq: %d\n", __func__, rv); - goto out8b; + goto err_disable_msi; } /* @@ -487,7 +487,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, err = sysfs_create_files(&pdev->dev.kobj, kp_attr_list); if (err) { dev_err(&pdev->dev, "Failed to add sysfs files: %d\n", err); - goto out9; + goto err_free_irq; } /* @@ -495,7 +495,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, */ err = kp2000_probe_cores(pcard); if (err) - goto out10; + goto err_remove_sysfs; /* * Step 11: Enable IRQs in HW @@ -506,28 +506,26 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, mutex_unlock(&pcard->sem); return 0; -out10: +err_remove_sysfs: sysfs_remove_files(&pdev->dev.kobj, kp_attr_list); -out9: +err_free_irq: free_irq(pcard->pdev->irq, pcard); -out8b: +err_disable_msi: pci_disable_msi(pcard->pdev); -out8a: -out7: -out6: +err_unmap_dma: iounmap(pca
[PATCH 2/2] staging: kpc2000: remove unnecessary comments in kp2000_pcie_probe
Much of the code comments in kp2000_pcie_probe just repeats the code and does not add any additional information. Delete them and make sure that comments still left in the function all use the same style. Signed-off-by: Simon Sandström --- drivers/staging/kpc2000/kpc2000/core.c | 38 -- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000/core.c b/drivers/staging/kpc2000/kpc2000/core.c index ee6b9be7127d..7ec54b672c20 100644 --- a/drivers/staging/kpc2000/kpc2000/core.c +++ b/drivers/staging/kpc2000/kpc2000/core.c @@ -311,18 +311,12 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, unsigned long dma_bar_phys_len; u16 regval; - /* -* Step 1: Allocate a struct for the pcard -*/ pcard = kzalloc(sizeof(*pcard), GFP_KERNEL); if (!pcard) return -ENOMEM; dev_dbg(&pdev->dev, "probe: allocated struct kp2000_device @ %p\n", pcard); - /* -* Step 2: Initialize trivial pcard elements -*/ err = ida_simple_get(&card_num_ida, 1, INT_MAX, GFP_KERNEL); if (err < 0) { dev_err(&pdev->dev, "probe: failed to get card number (%d)\n", @@ -338,9 +332,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, pcard->pdev = pdev; pci_set_drvdata(pdev, pcard); - /* -* Step 3: Enable PCI device -*/ err = pci_enable_device(pcard->pdev); if (err) { dev_err(&pcard->pdev->dev, @@ -349,9 +340,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, goto err_remove_ida; } - /* -* Step 4: Setup the Register BAR -*/ + // Setup the Register BAR reg_bar_phys_addr = pci_resource_start(pcard->pdev, REG_BAR); reg_bar_phys_len = pci_resource_len(pcard->pdev, REG_BAR); @@ -381,9 +370,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, reg_bar_phys_len - 1; pcard->regs_base_resource.flags = IORESOURCE_MEM; - /* -* Step 5: Setup the DMA BAR -*/ + // Setup the DMA BAR dma_bar_phys_addr = pci_resource_start(pcard->pdev, DMA_BAR); dma_bar_phys_len = pci_resource_len(pcard->pdev, DMA_BAR); @@ -415,9 +402,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, dma_bar_phys_len - 1; pcard->dma_base_resource.flags = IORESOURCE_MEM; - /* -* Step 6: System Regs -*/ + // Read System Regs pcard->sysinfo_regs_base = pcard->regs_bar_base; err = read_system_regs(pcard); if (err) @@ -427,11 +412,9 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, writeq(0x, pcard->sysinfo_regs_base + REG_INTERRUPT_MASK); - /* -* Step 7: Configure PCI thingies -*/ // let the card master PCIe pci_set_master(pcard->pdev); + // enable IO and mem if not already done pci_read_config_word(pcard->pdev, PCI_COMMAND, ®val); regval |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); @@ -466,9 +449,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, dev_dbg(&pcard->pdev->dev, "Using DMA mask %0llx\n", dma_get_mask(PCARD_TO_DEV(pcard))); - /* -* Step 8: Configure IRQs -*/ err = pci_enable_msi(pcard->pdev); if (err < 0) goto err_unmap_dma; @@ -481,25 +461,17 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, goto err_disable_msi; } - /* -* Step 9: Setup sysfs attributes -*/ err = sysfs_create_files(&pdev->dev.kobj, kp_attr_list); if (err) { dev_err(&pdev->dev, "Failed to add sysfs files: %d\n", err); goto err_free_irq; } - /* -* Step 10: Probe cores -*/ err = kp2000_probe_cores(pcard); if (err) goto err_remove_sysfs; - /* -* Step 11: Enable IRQs in HW -*/ + // Enable IRQs in HW writel(KPC_DMA_CARD_IRQ_ENABLE | KPC_DMA_CARD_USER_INTERRUPT_MODE, pcard->dma_common_regs); -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 14/33] docs: kbuild: convert docs to ReST and rename to *.rst
In data Sunday, June 9, 2019 4:27:04 AM CEST, Mauro Carvalho Chehab ha scritto: > The kbuild documentation clearly shows that the documents > there are written at different times: some use markdown, > some use their own peculiar logic to split sections. > > Convert everything to ReST without affecting too much > the author's style and avoiding adding uneeded markups. > > The conversion is actually: > - add blank lines and identation in order to identify paragraphs; > - fix tables markups; > - add some lists markups; > - mark literal blocks; > - adjust title markups. > > At its new index.rst, let's add a :orphan: while this is not linked to > the main index.rst file, in order to avoid build warnings. > > Signed-off-by: Mauro Carvalho Chehab > --- > Documentation/admin-guide/README.rst | 2 +- > ...eaders_install.txt => headers_install.rst} | 5 +- > Documentation/kbuild/index.rst| 27 + > Documentation/kbuild/issues.rst | 11 + > .../kbuild/{kbuild.txt => kbuild.rst} | 119 ++-- > ...nfig-language.txt => kconfig-language.rst} | 232 > ...anguage.txt => kconfig-macro-language.rst} | 37 +- > .../kbuild/{kconfig.txt => kconfig.rst} | 136 +++-- > .../kbuild/{makefiles.txt => makefiles.rst} | 530 +++--- > .../kbuild/{modules.txt => modules.rst} | 168 +++--- > Documentation/kernel-hacking/hacking.rst | 4 +- > Documentation/process/coding-style.rst| 2 +- > Documentation/process/submit-checklist.rst| 2 +- > .../it_IT/kernel-hacking/hacking.rst | 4 +- > .../it_IT/process/coding-style.rst| 2 +- > .../it_IT/process/submit-checklist.rst| 2 +- Limited to translations/it_IT Acked-by: Federico Vaga > .../zh_CN/process/coding-style.rst| 2 +- > .../zh_CN/process/submit-checklist.rst| 2 +- > Kconfig | 2 +- > arch/arc/plat-eznps/Kconfig | 2 +- > arch/c6x/Kconfig | 2 +- > arch/microblaze/Kconfig.debug | 2 +- > arch/microblaze/Kconfig.platform | 2 +- > arch/nds32/Kconfig| 2 +- > arch/openrisc/Kconfig | 2 +- > arch/powerpc/sysdev/Kconfig | 2 +- > arch/riscv/Kconfig| 2 +- > drivers/auxdisplay/Kconfig| 2 +- > drivers/firmware/Kconfig | 2 +- > drivers/mtd/devices/Kconfig | 2 +- > drivers/net/ethernet/smsc/Kconfig | 6 +- > drivers/net/wireless/intel/iwlegacy/Kconfig | 4 +- > drivers/net/wireless/intel/iwlwifi/Kconfig| 2 +- > drivers/parport/Kconfig | 2 +- > drivers/scsi/Kconfig | 4 +- > drivers/staging/sm750fb/Kconfig | 2 +- > drivers/usb/misc/Kconfig | 4 +- > drivers/video/fbdev/Kconfig | 14 +- > net/bridge/netfilter/Kconfig | 2 +- > net/ipv4/netfilter/Kconfig| 2 +- > net/ipv6/netfilter/Kconfig| 2 +- > net/netfilter/Kconfig | 16 +- > net/tipc/Kconfig | 2 +- > scripts/Kbuild.include| 4 +- > scripts/Makefile.host | 2 +- > scripts/kconfig/symbol.c | 2 +- > .../tests/err_recursive_dep/expected_stderr | 14 +- > sound/oss/dmasound/Kconfig| 6 +- > 48 files changed, 840 insertions(+), 561 deletions(-) > rename Documentation/kbuild/{headers_install.txt => headers_install.rst} > (96%) create mode 100644 Documentation/kbuild/index.rst > create mode 100644 Documentation/kbuild/issues.rst > rename Documentation/kbuild/{kbuild.txt => kbuild.rst} (72%) > rename Documentation/kbuild/{kconfig-language.txt => kconfig-language.rst} > (85%) rename Documentation/kbuild/{kconfig-macro-language.txt => > kconfig-macro-language.rst} (94%) rename Documentation/kbuild/{kconfig.txt > => kconfig.rst} (80%) > rename Documentation/kbuild/{makefiles.txt => makefiles.rst} (83%) > rename Documentation/kbuild/{modules.txt => modules.rst} (84%) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: erofs: add requirements field in superblock
On 2019/6/10 17:36, Gao Xiang wrote: > There are some backward incompatible optimizations pending > for months, mainly due to on-disk format expensions. > > However, we should ensure that it cannot be mounted with > old kernels. Otherwise, it will causes unexpected behaviors. > > Fixes: ba2b77a82022 ("staging: erofs: add super block operations") > Cc: # 4.19+ > Signed-off-by: Gao Xiang > --- > drivers/staging/erofs/erofs_fs.h | 11 +-- > drivers/staging/erofs/super.c| 8 > 2 files changed, 17 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/erofs/erofs_fs.h > b/drivers/staging/erofs/erofs_fs.h > index fa52898df006..531821757845 100644 > --- a/drivers/staging/erofs/erofs_fs.h > +++ b/drivers/staging/erofs/erofs_fs.h > @@ -17,10 +17,16 @@ > #define EROFS_SUPER_MAGIC_V10xE0F5E1E2 > #define EROFS_SUPER_OFFSET 1024 > > +/* > + * Any bits that aren't in EROFS_ALL_REQUIREMENTS should be > + * incompatible with this kernel version. > + */ > +#define EROFS_ALL_REQUIREMENTS 0 > + > struct erofs_super_block { > /* 0 */__le32 magic; /* in the little endian */ > /* 4 */__le32 checksum;/* crc32c(super_block) */ > -/* 8 */__le32 features; > +/* 8 */__le32 features;/* extra features for the image */ > /* 12 */__u8 blkszbits; /* support block_size == PAGE_SIZE only */ > /* 13 */__u8 reserved; > > @@ -34,8 +40,9 @@ struct erofs_super_block { > /* 44 */__le32 xattr_blkaddr; > /* 48 */__u8 uuid[16]; /* 128-bit uuid for volume */ > /* 64 */__u8 volume_name[16]; /* volume name */ > +/* 80 */__le32 requirements;/* all mandatory minimum requirements */ > > -/* 80 */__u8 reserved2[48]; /* 128 bytes */ > +/* 84 */__u8 reserved2[44]; /* 128 bytes */ Xiang, It needs to update the comment behind reserved2, it's locating at 132 bytes. > } __packed; > > /* > diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c > index f580d4ef77a1..815e5825db59 100644 > --- a/drivers/staging/erofs/super.c > +++ b/drivers/staging/erofs/super.c > @@ -104,6 +104,14 @@ static int superblock_read(struct super_block *sb) > goto out; > } > > + /* check if the kernel meets all mandatory requirements */ > + if (le32_to_cpu(layout->requirements) & (~EROFS_ALL_REQUIREMENTS)) { > + errln("too old to meet minimum requirements: %x supported: %x", It will be better to give a suggestion to user to upgrade kernel version to match the image with new layout, otherwise it's just a little confused about above printed message. Thanks, > + le32_to_cpu(layout->requirements), > + EROFS_ALL_REQUIREMENTS); > + goto out; > + } > + > sbi->blocks = le32_to_cpu(layout->blocks); > sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr); > #ifdef CONFIG_EROFS_FS_XATTR > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: erofs: rename data_mapping_mode to datamode
On 2019/6/10 17:36, Gao Xiang wrote: > data_mapping_mode is too long as a member name of erofs_vnode, > datamode is straight-forward enough. > > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: erofs: make use of DBG_BUGON
On 2019/6/8 17:49, Hariprasad Kelam wrote: > DBG_BUGON is introduced and it could only crash when EROFS_FS_DEBUG > (EROFS developping feature) is on. > replace BUG_ON with DBG_BUGON. > > Signed-off-by: Hariprasad Kelam Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: erofs: fix warning Comparison to bool
On 2019/6/8 17:39, Hariprasad Kelam wrote: > fix below warnings reported by coccicheck > > drivers/staging/erofs/unzip_vle.c:332:11-18: WARNING: Comparison to bool > > Signed-off-by: Hariprasad Kelam Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: erofs: add requirements field in superblock
Hi Chao, On 2019/6/11 9:37, Chao Yu wrote: > On 2019/6/10 17:36, Gao Xiang wrote: >> There are some backward incompatible optimizations pending >> for months, mainly due to on-disk format expensions. >> >> However, we should ensure that it cannot be mounted with >> old kernels. Otherwise, it will causes unexpected behaviors. >> >> Fixes: ba2b77a82022 ("staging: erofs: add super block operations") >> Cc: # 4.19+ >> Signed-off-by: Gao Xiang >> --- >> drivers/staging/erofs/erofs_fs.h | 11 +-- >> drivers/staging/erofs/super.c| 8 >> 2 files changed, 17 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/erofs/erofs_fs.h >> b/drivers/staging/erofs/erofs_fs.h >> index fa52898df006..531821757845 100644 >> --- a/drivers/staging/erofs/erofs_fs.h >> +++ b/drivers/staging/erofs/erofs_fs.h >> @@ -17,10 +17,16 @@ >> #define EROFS_SUPER_MAGIC_V10xE0F5E1E2 >> #define EROFS_SUPER_OFFSET 1024 >> >> +/* >> + * Any bits that aren't in EROFS_ALL_REQUIREMENTS should be >> + * incompatible with this kernel version. >> + */ >> +#define EROFS_ALL_REQUIREMENTS 0 >> + >> struct erofs_super_block { >> /* 0 */__le32 magic; /* in the little endian */ >> /* 4 */__le32 checksum;/* crc32c(super_block) */ >> -/* 8 */__le32 features; >> +/* 8 */__le32 features;/* extra features for the image */ >> /* 12 */__u8 blkszbits; /* support block_size == PAGE_SIZE only */ >> /* 13 */__u8 reserved; >> >> @@ -34,8 +40,9 @@ struct erofs_super_block { >> /* 44 */__le32 xattr_blkaddr; >> /* 48 */__u8 uuid[16]; /* 128-bit uuid for volume */ >> /* 64 */__u8 volume_name[16]; /* volume name */ >> +/* 80 */__le32 requirements;/* all mandatory minimum requirements */ >> >> -/* 80 */__u8 reserved2[48]; /* 128 bytes */ >> +/* 84 */__u8 reserved2[44]; /* 128 bytes */ > > Xiang, > > It needs to update the comment behind reserved2, it's locating at 132 bytes. I don't get the point... the whole struct is totally 128bytes I think? > >> } __packed; >> >> /* >> diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c >> index f580d4ef77a1..815e5825db59 100644 >> --- a/drivers/staging/erofs/super.c >> +++ b/drivers/staging/erofs/super.c >> @@ -104,6 +104,14 @@ static int superblock_read(struct super_block *sb) >> goto out; >> } >> >> +/* check if the kernel meets all mandatory requirements */ >> +if (le32_to_cpu(layout->requirements) & (~EROFS_ALL_REQUIREMENTS)) { >> +errln("too old to meet minimum requirements: %x supported: %x", > > It will be better to give a suggestion to user to upgrade kernel version to > match the image with new layout, otherwise it's just a little confused about > above printed message. OK, I will refine the printed message :) Thanks, Gao Xiang > > Thanks, > >> + le32_to_cpu(layout->requirements), >> + EROFS_ALL_REQUIREMENTS); >> +goto out; >> +} >> + >> sbi->blocks = le32_to_cpu(layout->blocks); >> sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr); >> #ifdef CONFIG_EROFS_FS_XATTR >> ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: erofs: add requirements field in superblock
On 2019/6/11 9:43, Gao Xiang wrote: > Hi Chao, > > On 2019/6/11 9:37, Chao Yu wrote: >> On 2019/6/10 17:36, Gao Xiang wrote: >>> There are some backward incompatible optimizations pending >>> for months, mainly due to on-disk format expensions. >>> >>> However, we should ensure that it cannot be mounted with >>> old kernels. Otherwise, it will causes unexpected behaviors. >>> >>> Fixes: ba2b77a82022 ("staging: erofs: add super block operations") >>> Cc: # 4.19+ >>> Signed-off-by: Gao Xiang >>> --- >>> drivers/staging/erofs/erofs_fs.h | 11 +-- >>> drivers/staging/erofs/super.c| 8 >>> 2 files changed, 17 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/staging/erofs/erofs_fs.h >>> b/drivers/staging/erofs/erofs_fs.h >>> index fa52898df006..531821757845 100644 >>> --- a/drivers/staging/erofs/erofs_fs.h >>> +++ b/drivers/staging/erofs/erofs_fs.h >>> @@ -17,10 +17,16 @@ >>> #define EROFS_SUPER_MAGIC_V10xE0F5E1E2 >>> #define EROFS_SUPER_OFFSET 1024 >>> >>> +/* >>> + * Any bits that aren't in EROFS_ALL_REQUIREMENTS should be >>> + * incompatible with this kernel version. >>> + */ >>> +#define EROFS_ALL_REQUIREMENTS 0 >>> + >>> struct erofs_super_block { >>> /* 0 */__le32 magic; /* in the little endian */ >>> /* 4 */__le32 checksum;/* crc32c(super_block) */ >>> -/* 8 */__le32 features; >>> +/* 8 */__le32 features;/* extra features for the image */ >>> /* 12 */__u8 blkszbits; /* support block_size == PAGE_SIZE only */ >>> /* 13 */__u8 reserved; >>> >>> @@ -34,8 +40,9 @@ struct erofs_super_block { >>> /* 44 */__le32 xattr_blkaddr; >>> /* 48 */__u8 uuid[16]; /* 128-bit uuid for volume */ >>> /* 64 */__u8 volume_name[16]; /* volume name */ >>> +/* 80 */__le32 requirements;/* all mandatory minimum requirements */ >>> >>> -/* 80 */__u8 reserved2[48]; /* 128 bytes */ >>> +/* 84 */__u8 reserved2[44]; /* 128 bytes */ >> >> Xiang, >> >> It needs to update the comment behind reserved2, it's locating at 132 bytes. > > I don't get the point... the whole struct is totally 128bytes I think? Xiang, I misunderstood meaning of comments, please ignore it, sorry. :) Thanks, > >> >>> } __packed; >>> >>> /* >>> diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c >>> index f580d4ef77a1..815e5825db59 100644 >>> --- a/drivers/staging/erofs/super.c >>> +++ b/drivers/staging/erofs/super.c >>> @@ -104,6 +104,14 @@ static int superblock_read(struct super_block *sb) >>> goto out; >>> } >>> >>> + /* check if the kernel meets all mandatory requirements */ >>> + if (le32_to_cpu(layout->requirements) & (~EROFS_ALL_REQUIREMENTS)) { >>> + errln("too old to meet minimum requirements: %x supported: %x", >> >> It will be better to give a suggestion to user to upgrade kernel version to >> match the image with new layout, otherwise it's just a little confused about >> above printed message. > > OK, I will refine the printed message :) > > Thanks, > Gao Xiang > >> >> Thanks, >> >>> + le32_to_cpu(layout->requirements), >>> + EROFS_ALL_REQUIREMENTS); >>> + goto out; >>> + } >>> + >>> sbi->blocks = le32_to_cpu(layout->blocks); >>> sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr); >>> #ifdef CONFIG_EROFS_FS_XATTR >>> > . > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: kpc2000: kpc_i2c: remove the macros inb_p and outb_p
On Mon, Jun 10, 2019 at 03:48:24PM +0800, Hao Xu wrote: > remove inb_p and outb_p to call readq/writeq directly. > > Signed-off-by: Hao Xu > --- > Changes in v2: > - remove the macros inb_p/outb_p and use readq/writeq directly, per > https://lkml.kernel.org/lkml/20190608134505.ga...@arch-01.home/ > --- > drivers/staging/kpc2000/kpc2000_i2c.c | 112 > -- > 1 file changed, 53 insertions(+), 59 deletions(-) > > diff --git a/drivers/staging/kpc2000/kpc2000_i2c.c > b/drivers/staging/kpc2000/kpc2000_i2c.c > index 69e8773..246d5b3 100644 > --- a/drivers/staging/kpc2000/kpc2000_i2c.c > +++ b/drivers/staging/kpc2000/kpc2000_i2c.c > @@ -307,28 +301,28 @@ static int i801_block_transaction_byte_by_byte(struct > i2c_device *priv, union i2 > else > smbcmd = I801_BLOCK_DATA; > } > - outb_p(smbcmd | ENABLE_INT9, SMBHSTCNT(priv)); > + writeq(smbcmd | ENABLE_INT9, (void *)SMBHSTCNT(priv)); > > if (i == 1) > - outb_p(inb(SMBHSTCNT(priv)) | I801_START, > SMBHSTCNT(priv)); > + writeq(inb(SMBHSTCNT(priv)) | I801_START, (void > *)SMBHSTCNT(priv)); This inb() call looks like a bug. We perform a 64-bit operation when talking to this hardware register everywhere else in this driver. Anyone have more insight into the hardware with which this driver interacts such that they could shed some light on the subject? Probably a separate issue, but I did notice it as a result of this patch. Thanks, Geordan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: erofs: rename data_mapping_mode to datamode
data_mapping_mode is too long as a member name of erofs_vnode, datamode is straight-forward enough. Reviewed-by: Chao Yu Signed-off-by: Gao Xiang --- drivers/staging/erofs/inode.c| 17 - drivers/staging/erofs/internal.h | 10 -- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c index 9520419f746c..e51348f7e838 100644 --- a/drivers/staging/erofs/inode.c +++ b/drivers/staging/erofs/inode.c @@ -22,11 +22,11 @@ static int read_inode(struct inode *inode, void *data) const unsigned int advise = le16_to_cpu(v1->i_advise); erofs_blk_t nblks = 0; - vi->data_mapping_mode = __inode_data_mapping(advise); + vi->datamode = __inode_data_mapping(advise); - if (unlikely(vi->data_mapping_mode >= EROFS_INODE_LAYOUT_MAX)) { - errln("unknown data mapping mode %u of nid %llu", - vi->data_mapping_mode, vi->nid); + if (unlikely(vi->datamode >= EROFS_INODE_LAYOUT_MAX)) { + errln("unsupported data mapping %u of nid %llu", + vi->datamode, vi->nid); DBG_BUGON(1); return -EIO; } @@ -63,7 +63,7 @@ static int read_inode(struct inode *inode, void *data) inode->i_size = le64_to_cpu(v2->i_size); /* total blocks for compressed files */ - if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) + if (is_inode_layout_compression(inode)) nblks = le32_to_cpu(v2->i_u.compressed_blocks); } else if (__inode_version(advise) == EROFS_INODE_LAYOUT_V1) { struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb); @@ -95,7 +95,7 @@ static int read_inode(struct inode *inode, void *data) sbi->build_time_nsec; inode->i_size = le32_to_cpu(v1->i_size); - if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) + if (is_inode_layout_compression(inode)) nblks = le32_to_cpu(v1->i_u.compressed_blocks); } else { errln("unsupported on-disk inode version %u of nid %llu", @@ -127,7 +127,7 @@ static int fill_inline_data(struct inode *inode, void *data, { struct erofs_vnode *vi = EROFS_V(inode); struct erofs_sb_info *sbi = EROFS_I_SB(inode); - int mode = vi->data_mapping_mode; + const int mode = vi->datamode; DBG_BUGON(mode >= EROFS_INODE_LAYOUT_MAX); @@ -299,9 +299,8 @@ int erofs_getattr(const struct path *path, struct kstat *stat, u32 request_mask, unsigned int query_flags) { struct inode *const inode = d_inode(path->dentry); - struct erofs_vnode *const vi = EROFS_V(inode); - if (vi->data_mapping_mode == EROFS_INODE_LAYOUT_COMPRESSION) + if (is_inode_layout_compression(inode)) stat->attributes |= STATX_ATTR_COMPRESSED; stat->attributes |= STATX_ATTR_IMMUTABLE; diff --git a/drivers/staging/erofs/internal.h b/drivers/staging/erofs/internal.h index 911333cdeef4..6a7eb04d29b4 100644 --- a/drivers/staging/erofs/internal.h +++ b/drivers/staging/erofs/internal.h @@ -347,8 +347,7 @@ struct erofs_vnode { /* atomic flags (including bitlocks) */ unsigned long flags; - unsigned char data_mapping_mode; - /* inline size in bytes */ + unsigned char datamode; unsigned char inode_isize; unsigned short xattr_isize; @@ -383,18 +382,17 @@ static inline unsigned long inode_datablocks(struct inode *inode) static inline bool is_inode_layout_plain(struct inode *inode) { - return EROFS_V(inode)->data_mapping_mode == EROFS_INODE_LAYOUT_PLAIN; + return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_PLAIN; } static inline bool is_inode_layout_compression(struct inode *inode) { - return EROFS_V(inode)->data_mapping_mode == - EROFS_INODE_LAYOUT_COMPRESSION; + return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_COMPRESSION; } static inline bool is_inode_layout_inline(struct inode *inode) { - return EROFS_V(inode)->data_mapping_mode == EROFS_INODE_LAYOUT_INLINE; + return EROFS_V(inode)->datamode == EROFS_INODE_LAYOUT_INLINE; } extern const struct super_operations erofs_sops; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: erofs: add requirements field in superblock
There are some backward incompatible features pending for months, mainly due to on-disk format expensions. However, we should ensure that it cannot be mounted with old kernels. Otherwise, it will causes unexpected behaviors. Fixes: ba2b77a82022 ("staging: erofs: add super block operations") Cc: # 4.19+ Signed-off-by: Gao Xiang --- change log v2: - update printed message drivers/staging/erofs/erofs_fs.h | 13 ++--- drivers/staging/erofs/super.c| 17 + 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/staging/erofs/erofs_fs.h b/drivers/staging/erofs/erofs_fs.h index fa52898df006..8ddb2b3e7d39 100644 --- a/drivers/staging/erofs/erofs_fs.h +++ b/drivers/staging/erofs/erofs_fs.h @@ -17,10 +17,16 @@ #define EROFS_SUPER_MAGIC_V10xE0F5E1E2 #define EROFS_SUPER_OFFSET 1024 +/* + * Any bits that aren't in EROFS_ALL_REQUIREMENTS should be + * incompatible with this kernel version. + */ +#define EROFS_ALL_REQUIREMENTS 0 + struct erofs_super_block { /* 0 */__le32 magic; /* in the little endian */ /* 4 */__le32 checksum;/* crc32c(super_block) */ -/* 8 */__le32 features; +/* 8 */__le32 features;/* (aka. feature_compat) */ /* 12 */__u8 blkszbits; /* support block_size == PAGE_SIZE only */ /* 13 */__u8 reserved; @@ -34,9 +40,10 @@ struct erofs_super_block { /* 44 */__le32 xattr_blkaddr; /* 48 */__u8 uuid[16]; /* 128-bit uuid for volume */ /* 64 */__u8 volume_name[16]; /* volume name */ +/* 80 */__le32 requirements;/* (aka. feature_incompat) */ -/* 80 */__u8 reserved2[48]; /* 128 bytes */ -} __packed; +/* 84 */__u8 reserved2[44]; +} __packed; /* 128 bytes */ /* * erofs inode data mapping: diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c index f580d4ef77a1..fdcf65b3e52d 100644 --- a/drivers/staging/erofs/super.c +++ b/drivers/staging/erofs/super.c @@ -71,6 +71,20 @@ static void free_inode(struct inode *inode) kmem_cache_free(erofs_inode_cachep, vi); } +static bool check_layout_compatibility(struct super_block *sb, + struct erofs_super_block *layout) +{ + const unsigned int requirements = le32_to_cpu(layout->requirements); + + /* check if current kernel meets all mandatory requirements */ + if (requirements & (~EROFS_ALL_REQUIREMENTS)) { + errln("unidentified requirements %x, please upgrade kernel version", + requirements & ~EROFS_ALL_REQUIREMENTS); + return false; + } + return true; +} + static int superblock_read(struct super_block *sb) { struct erofs_sb_info *sbi; @@ -104,6 +118,9 @@ static int superblock_read(struct super_block *sb) goto out; } + if (!check_layout_compatibility(sb, layout)) + goto out; + sbi->blocks = le32_to_cpu(layout->blocks); sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr); #ifdef CONFIG_EROFS_FS_XATTR -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: rtl8723bs: fix issue Comparison to NULL
This patch fixes below issues reported by checkpatch CHECK: Comparison to NULL could be written "rtw_proc" CHECK: Comparison to NULL could be written "!rtw_proc" CHECK: Comparison to NULL could be written "!rtw_proc" Signed-off-by: Hariprasad Kelam --- drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c index d8e7ad1..d6862e8 100644 --- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c +++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c @@ -122,14 +122,14 @@ int rtw_drv_proc_init(void) ssize_t i; struct proc_dir_entry *entry = NULL; - if (rtw_proc != NULL) { + if (rtw_proc) { rtw_warn_on(1); goto exit; } rtw_proc = rtw_proc_create_dir(RTW_PROC_NAME, get_proc_net, NULL); - if (rtw_proc == NULL) { + if (!rtw_proc) { rtw_warn_on(1); goto exit; } @@ -152,7 +152,7 @@ void rtw_drv_proc_deinit(void) { int i; - if (rtw_proc == NULL) + if (!rtw_proc) return; for (i = 0; i < drv_proc_hdls_num; i++) @@ -637,18 +637,18 @@ static struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev) struct adapter *adapter = rtw_netdev_priv(dev); ssize_t i; - if (adapter->dir_dev == NULL) { + if (!adapter->dir_dev) { rtw_warn_on(1); goto exit; } - if (adapter->dir_odm != NULL) { + if (adapter->dir_odm) { rtw_warn_on(1); goto exit; } dir_odm = rtw_proc_create_dir("odm", adapter->dir_dev, dev); - if (dir_odm == NULL) { + if (!dir_odm) { rtw_warn_on(1); goto exit; } @@ -674,7 +674,7 @@ static void rtw_odm_proc_deinit(struct adapter *adapter) dir_odm = adapter->dir_odm; - if (dir_odm == NULL) { + if (!dir_odm) { rtw_warn_on(1); return; } @@ -695,18 +695,18 @@ struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev) struct adapter *adapter = rtw_netdev_priv(dev); ssize_t i; - if (drv_proc == NULL) { + if (!drv_proc) { rtw_warn_on(1); goto exit; } - if (adapter->dir_dev != NULL) { + if (adapter->dir_dev) { rtw_warn_on(1); goto exit; } dir_dev = rtw_proc_create_dir(dev->name, drv_proc, dev); - if (dir_dev == NULL) { + if (!dir_dev) { rtw_warn_on(1); goto exit; } @@ -736,7 +736,7 @@ void rtw_adapter_proc_deinit(struct net_device *dev) dir_dev = adapter->dir_dev; - if (dir_dev == NULL) { + if (!dir_dev) { rtw_warn_on(1); return; } @@ -760,7 +760,7 @@ void rtw_adapter_proc_replace(struct net_device *dev) dir_dev = adapter->dir_dev; - if (dir_dev == NULL) { + if (!dir_dev) { rtw_warn_on(1); return; } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] rtl8723bs: os_dep: fix spaces preferred around unary operator
CHECK: spaces preferred around that '|' (ctx:VxV) CHECK: spaces preferred around that '|' (ctx:VxV) CHECK: spaces preferred around that '+' (ctx:VxV) Signed-off-by: Hariprasad Kelam --- drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c index d6862e8..16ada19 100644 --- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c +++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c @@ -21,7 +21,7 @@ inline struct proc_dir_entry *rtw_proc_create_dir(const char *name, struct proc_ { struct proc_dir_entry *entry; - entry = proc_mkdir_data(name, S_IRUGO|S_IXUGO, parent, data); + entry = proc_mkdir_data(name, S_IRUGO | S_IXUGO, parent, data); return entry; } @@ -31,7 +31,7 @@ inline struct proc_dir_entry *rtw_proc_create_entry(const char *name, struct pro { struct proc_dir_entry *entry; - entry = proc_create_data(name, S_IFREG|S_IRUGO, parent, fops, data); + entry = proc_create_data(name, S_IFREG | S_IRUGO, parent, fops, data); return entry; } @@ -90,7 +90,7 @@ static int rtw_drv_proc_open(struct inode *inode, struct file *file) { /* struct net_device *dev = proc_get_parent_data(inode); */ ssize_t index = (ssize_t)PDE_DATA(inode); - const struct rtw_proc_hdl *hdl = drv_proc_hdls+index; + const struct rtw_proc_hdl *hdl = drv_proc_hdls + index; return single_open(file, hdl->show, NULL); } @@ -98,7 +98,7 @@ static int rtw_drv_proc_open(struct inode *inode, struct file *file) static ssize_t rtw_drv_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { ssize_t index = (ssize_t)PDE_DATA(file_inode(file)); - const struct rtw_proc_hdl *hdl = drv_proc_hdls+index; + const struct rtw_proc_hdl *hdl = drv_proc_hdls + index; ssize_t (*write)(struct file *, const char __user *, size_t, loff_t *, void *) = hdl->write; if (write) @@ -207,7 +207,7 @@ static int proc_get_linked_info_dump(struct seq_file *m, void *v) struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev); if (padapter) - DBG_871X_SEL_NL(m, "linked_info_dump :%s\n", (padapter->bLinkInfoDump)?"enable":"disable"); + DBG_871X_SEL_NL(m, "linked_info_dump :%s\n", (padapter->bLinkInfoDump) ? "enable" : "disable"); return 0; } @@ -245,7 +245,7 @@ static int proc_get_rx_info(struct seq_file *m, void *v) struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; /* Counts of packets whose seq_num is less than preorder_ctrl->indicate_seq, Ex delay, retransmission, redundant packets and so on */ - DBG_871X_SEL_NL(m,"Counts of Packets Whose Seq_Num Less Than Reorder Control Seq_Num: %llu\n", (unsigned long long)pdbgpriv->dbg_rx_ampdu_drop_count); + DBG_871X_SEL_NL(m, "Counts of Packets Whose Seq_Num Less Than Reorder Control Seq_Num: %llu\n", (unsigned long long)pdbgpriv->dbg_rx_ampdu_drop_count); /* How many times the Rx Reorder Timer is triggered. */ DBG_871X_SEL_NL(m,"Rx Reorder Time-out Trigger Counts: %llu\n", (unsigned long long)pdbgpriv->dbg_rx_ampdu_forced_indicate_count); /* Total counts of packets loss */ @@ -341,8 +341,8 @@ static int proc_get_cam_cache(struct seq_file *m, void *v) , dvobj->cam_cache[i].ctrl , MAC_ARG(dvobj->cam_cache[i].mac) , KEY_ARG(dvobj->cam_cache[i].key) - , (dvobj->cam_cache[i].ctrl)&0x03 - , security_type_str(((dvobj->cam_cache[i].ctrl)>>2)&0x07) + , (dvobj->cam_cache[i].ctrl) & 0x03 + , security_type_str(((dvobj->cam_cache[i].ctrl) >> 2) & 0x07) /* ((dvobj->cam_cache[i].ctrl)>>5)&0x01 */ /* ((dvobj->cam_cache[i].ctrl)>>6)&0x01 */ /* ((dvobj->cam_cache[i].ctrl)>>8)&0x7f */ @@ -421,7 +421,7 @@ static const int adapter_proc_hdls_num = sizeof(adapter_proc_hdls) / sizeof(stru static int rtw_adapter_proc_open(struct inode *inode, struct file *file) { ssize_t index = (ssize_t)PDE_DATA(inode); - const struct rtw_proc_hdl *hdl = adapter_proc_hdls+index; + const struct rtw_proc_hdl *hdl = adapter_proc_hdls + index; return single_open(file, hdl->show, proc_get_parent_data(inode)); } @@ -429,7 +429,7 @@ static int rtw_adapter_proc_open(struct inode *inode, struct file *file) static ssize_t rtw_adapter_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos) { ssize_t index = (ssize_t)PDE_DATA(file_inode(file)); - const struct rtw_proc_hdl *hdl = adapter_proc_hdls+index; + const struct rtw_proc
Re: [PATCH v2 1/2] staging: erofs: add requirements field in superblock
On 2019/6/11 10:42, Gao Xiang wrote: > There are some backward incompatible features pending > for months, mainly due to on-disk format expensions. > > However, we should ensure that it cannot be mounted with > old kernels. Otherwise, it will causes unexpected behaviors. > > Fixes: ba2b77a82022 ("staging: erofs: add super block operations") > Cc: # 4.19+ > Signed-off-by: Gao Xiang Reviewed-by: Chao Yu Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: kpc2000: Fix: 'kpc_dma_del_device' and other symbols were not declared
This patch removes the Sparse generated warnings. Following warnings are reported by Sparse: drivers/staging/kpc2000//kpc_dma/kpc_dma_driver.c:46:6: warning: symbol 'kpc_dma_del_device' was not declared. Should it be static? drivers/staging/kpc2000//kpc_dma/kpc_dma_driver.c:91:14: warning: symbol 'kpc_dma_class' was not declared. Should it be static? drivers/staging/kpc2000//kpc_dma/kpc_dma_driver.c:199:24: warning: symbol 'kpc_dma_plat_driver_i' was not declared. Should it be static? Signed-off-by: Rishiraj Manwatkar --- drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c index 9acf1eafa024..b45296b4b8b2 100644 --- a/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c +++ b/drivers/staging/kpc2000/kpc_dma/kpc_dma_driver.c @@ -43,7 +43,7 @@ static void kpc_dma_add_device(struct kpc_dma_device *ldev) mutex_unlock(&kpc_dma_mtx); } -void kpc_dma_del_device(struct kpc_dma_device *ldev) +static void kpc_dma_del_device(struct kpc_dma_device *ldev) { mutex_lock(&kpc_dma_mtx); list_del(&ldev->list); @@ -88,7 +88,7 @@ static const struct attribute *ndd_attr_list[] = { NULL, }; -struct class *kpc_dma_class; +static struct class *kpc_dma_class; /** Platform Driver Functions **/ static @@ -196,7 +196,7 @@ int kpc_dma_remove(struct platform_device *pldev) } /** Driver Functions **/ -struct platform_driver kpc_dma_plat_driver_i = { +static struct platform_driver kpc_dma_plat_driver_i = { .probe= kpc_dma_probe, .remove = kpc_dma_remove, .driver = { -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel