Re: [PATCH v3 05/11] mm, fsdax: Refactor memory-failure handler for dax mapping

2021-03-15 Thread zhong jiang
n of ZONE_DEVICE memory necessitates +* SIGBUS (i.e. MF_MUST_KILL) +*/ + flags |= MF_ACTION_REQUIRED | MF_MUST_KILL; MF_ACTION_REQUIRED only kill the current execution context. A page can be shared when reflink file be mapped by different process. We can not kill all process shared the pag

Re: [PATCH 04/10] mm, fsdax: Refactor memory-failure handler for dax mapping

2021-01-14 Thread zhong jiang
On 2021/1/14 11:52 上午, Ruan Shiyang wrote: On 2021/1/14 上午11:26, zhong jiang wrote: On 2021/1/14 9:44 上午, Ruan Shiyang wrote: On 2021/1/13 下午6:04, zhong jiang wrote: On 2021/1/12 10:55 上午, Ruan Shiyang wrote: On 2021/1/6 下午11:41, Jan Kara wrote: On Thu 31-12-20 00:55:55, Shiyang

Re: [PATCH 04/10] mm, fsdax: Refactor memory-failure handler for dax mapping

2021-01-13 Thread zhong jiang
On 2021/1/14 9:44 上午, Ruan Shiyang wrote: On 2021/1/13 下午6:04, zhong jiang wrote: On 2021/1/12 10:55 上午, Ruan Shiyang wrote: On 2021/1/6 下午11:41, Jan Kara wrote: On Thu 31-12-20 00:55:55, Shiyang Ruan wrote: The current memory_failure_dev_pagemap() can only handle single-mapped dax

Re: [PATCH 04/10] mm, fsdax: Refactor memory-failure handler for dax mapping

2021-01-13 Thread zhong jiang
On 2021/1/12 10:55 上午, Ruan Shiyang wrote: On 2021/1/6 下午11:41, Jan Kara wrote: On Thu 31-12-20 00:55:55, Shiyang Ruan wrote: The current memory_failure_dev_pagemap() can only handle single-mapped dax page for fsdax mode.  The dax page could be mapped by multiple files and offsets if we

[PATCH] power: supply: cpcap-charger: Make cpcap_charger_voltage_to_regval static

2019-10-21 Thread zhong jiang
The GCC complains the following case when compiling kernel. drivers/power/supply/cpcap-charger.c:563:5: warning: symbol 'cpcap_charger_voltage_to_regval' was not declared. Should it be static? Signed-off-by: zhong jiang --- drivers/power/supply/cpcap-charger.c | 2 +- 1 file changed, 1

Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-16 Thread zhong jiang
ate "Silicon Labs wireless chips WF200 and further" > depends on MAC80211 > + depends on MMC || !MMC # do not allow WFX=y if MMC=m > depends on (SPI || MMC) > help > This is a driver for Silicons Labs WFxxx series (WF200 and further) > > Hi, Jerome It's better to understandable. Could you send the patch or want to repost by me? Thanks, zhong jiang

Re: [PATCH] mm: Unsigned 'nr_pages' always larger than zero

2019-10-16 Thread zhong jiang
On 2019/10/17 8:49, Andrew Morton wrote: > On Wed, 16 Oct 2019 17:07:44 +0800 zhong jiang wrote: > >>>> --- a/mm/gup.c~a >>>> +++ a/mm/gup.c >>>> @@ -1450,6 +1450,7 @@ static long check_and_migrate_cma_pages( >>>> bool dr

[PATCH] staging: rtl8723bs: remove an redundant null check before kfree()

2019-10-16 Thread zhong jiang
kfree() has taken null pointer into account. hence it is safe to remove the unnecessary check. Signed-off-by: zhong jiang --- drivers/staging/rtl8723bs/core/rtw_xmit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers

Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-14 Thread zhong jiang
ate "Silicon Labs wireless chips WF200 and further" > depends on MAC80211 > + depends on MMC || !MMC # do not allow WFX=y if MMC=m > depends on (SPI || MMC) > help > This is a driver for Silicons Labs WFxxx series (WF200 and further) > > It's better and clear. Thanks sincerely, zhong jiang

Re: [PATCH v3] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-13 Thread zhong jiang
On 2019/10/12 23:32, Greg KH wrote: > On Sat, Oct 12, 2019 at 06:54:53PM +0800, zhong jiang wrote: >> I hit the following error when compile the kernel. >> >> drivers/staging/wfx/main.o: In function `wfx_core_init': >> /home/z00352263/linux-next/linux-next/dri

[PATCH v3] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-12 Thread zhong jiang
' Signed-off-by: zhong jiang --- v2->v3: We'd better not use #ifdef in .c file to use IS_ENABLED instead. v1->v2: We should prefer to current dependencies rather than force to enable. drivers/staging/wfx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

Re: [PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread zhong jiang
On 2019/10/12 1:03, Greg KH wrote: > On Sat, Oct 12, 2019 at 12:34:07AM +0800, zhong jiang wrote: >> I hit the following error when compile the kernel. >> >> drivers/staging/wfx/main.o: In function `wfx_core_init': >> /home/z00352263/linux-next/linux-next/dri

[PATCH RESEND v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread zhong jiang
' Signed-off-by: zhong jiang --- drivers/staging/wfx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/wfx/Makefile b/drivers/staging/wfx/Makefile index 0d9c1ed..77d68b7 100644 --- a/drivers/staging/wfx/Makefile +++ b/drivers/staging/wfx/Makefile @@ -19,6

Re: [PATCH] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread zhong jiang
On 2019/10/12 0:16, Greg KH wrote: > On Fri, Oct 11, 2019 at 11:51:16PM +0800, zhong jiang wrote: >> On 2019/10/11 17:02, Greg KH wrote: >>> On Fri, Oct 11, 2019 at 08:40:08AM +, Jerome Pouiller wrote: >>>> On Friday 11 October 2019 06:26:16 CEST Greg KH wr

Re: [PATCH] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread zhong jiang
On 2019/10/11 23:55, Jerome Pouiller wrote: > On Friday 11 October 2019 17:51:29 CEST zhong jiang wrote: > [...] >> How about the following patch ? >> >> diff --git a/drivers/staging/wfx/Makefile b/drivers/staging/wfx/Makefile >> index 0d9c1ed..77d68b7 100644 >>

Re: [PATCH] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread zhong jiang
nts unless you recognize the sender and know the >> content is safe. >>> >>> On Fri, Oct 11, 2019 at 11:02:19AM +0800, zhong jiang wrote: >>>> I hit the following error when compile the kernel. >>>> >>>> drivers/staging/wfx/main.o: In func

Re: [PATCH] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread zhong jiang
nts unless you recognize the sender and know the >> content is safe. >>> >>> On Fri, Oct 11, 2019 at 11:02:19AM +0800, zhong jiang wrote: >>>> I hit the following error when compile the kernel. >>>> >>>> drivers/staging/wfx/main.o: In func

[PATCH v2] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread zhong jiang
:496: undefined reference to `sdio_unregister_driver' drivers/staging/wfx/main.o:(.debug_addr+0x1a8): undefined reference to `sdio_register_driver' drivers/staging/wfx/main.o:(.debug_addr+0x6f0): undefined reference to `sdio_unregister_driver' Signed-off-by: zhong jiang --- drivers/staging/wfx

Re: [PATCH] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-11 Thread zhong jiang
On 2019/10/11 12:26, Greg KH wrote: > On Fri, Oct 11, 2019 at 11:02:19AM +0800, zhong jiang wrote: >> I hit the following error when compile the kernel. >> >> drivers/staging/wfx/main.o: In function `wfx_core_init': >> /home/z00352263/linux-next/linux-next/dri

[PATCH] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-10 Thread zhong jiang
' Signed-off-by: zhong jiang --- drivers/staging/wfx/Kconfig | 3 ++- drivers/staging/wfx/Makefile | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wfx/Kconfig b/drivers/staging/wfx/Kconfig index 9b8a1c7..4d045513 100644 --- a/drivers/staging/wfx/Kconfig +++ b

[PATCH v2 4/4] media: v4l2-dv-timings: Use DIV_ROUND_CLOSEST directly to make it readable

2019-10-09 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/v4l2-core/v4l2-dv-timings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b

[PATCH v2 3/4] media: uvcvideo: Use DIV_ROUND_CLOSEST directly to make it readable

2019-10-09 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/usb/uvc/uvc_ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb

[PATCH v2 0/4] media: Use DIV_ROUND_CLOSEST directly

2019-10-09 Thread zhong jiang
With the help of Coccinelle. I find some place that DIV_ROUND_CLOSEST can replace it directly. v1->v2: patch 1: remove mt312_div() to use the DIV_ROUND_CLOSEST directly. zhong jiang (4): media: dvb-frontends: Use DIV_ROUND_CLOSEST directly to make it readable media: tuners/qm1d1c0

[PATCH v2 2/4] media: tuners/qm1d1c0042: Use DIV_ROUND_CLOSEST directly to make it readable

2019-10-09 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/tuners/qm1d1c0042.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/tuners/qm1d1c0042.c b/drivers/media/tuners

[PATCH v2 1/4] media: dvb-frontends: Use DIV_ROUND_CLOSEST directly to make it readable

2019-10-09 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/dvb-frontends/mt312.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/media/dvb-frontends/mt312.c b

Re: [PATCH 1/4] media: dvb-frontends: Use DIV_ROUND_CLOSEST directly to make it readable

2019-10-09 Thread zhong jiang
On 2019/10/1 19:15, Sean Young wrote: > Hi, > > On Fri, Sep 06, 2019 at 12:14:49AM +0800, zhong jiang wrote: >> The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d >> but is perhaps more readable. >> >> Signed-off-by: zhong jiang >> --

[PATCH] broadcom: Fix an compile warning in nvram_init

2019-09-23 Thread zhong jiang
CC sound/soc/sof/debug.o drivers/firmware/broadcom/bcm47xx_nvram.c:151:30: note: format string is defined here pr_err("nvram on flash (%zu bytes) is bigger than the reserved space in memory, will just copy the first %i bytes\n", Signed-off-by: zhong jiang --- drivers/firmware

[PATCH] smack: fix an compile error in smack_post_notification

2019-09-22 Thread zhong jiang
r each function it appears in Signed-off-by: zhong jiang --- security/smack/smack.h | 1 + 1 file changed, 1 insertion(+) diff --git a/security/smack/smack.h b/security/smack/smack.h index 62529f3..02b05a2 100644 --- a/security/smack/smack.h +++ b/security/smack/smack.h @@ -21,6 +21,7 @@ #i

[PATCH] iio: Fix an undefied reference error in noa1305_probe

2019-09-22 Thread zhong jiang
I hit the following error when compile the kernel. drivers/iio/light/noa1305.o: In function `noa1305_probe': noa1305.c:(.text+0x65): undefined reference to `__devm_regmap_init_i2c' make: *** [vmlinux] Error 1 Signed-off-by: zhong jiang --- drivers/iio/light/Kconfig | 1 + 1 file changed, 1

Re: [PATCH net-next] ixgbe: Use memzero_explicit directly in crypto cases

2019-09-17 Thread zhong jiang
On 2019/9/18 10:36, zhong jiang wrote: > In general, Use kzfree() to replace memset() + kfree() is feasible and > resonable. But It's btter to use memzero_explicit() to replace memset() > in crypto cases. s/btter/better/, will repost. sorry for that. Thanks, zhong jiang > Signed-o

[RESENT PATCH net-next] ixgbe: Use memzero_explicit directly in crypto cases

2019-09-17 Thread zhong jiang
In general, Use kzfree() to replace memset() + kfree() is feasible and resonable. But It's better to use memzero_explicit() to replace memset() in crypto cases. Signed-off-by: zhong jiang --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 9 ++--- 1 file changed, 6 insertions(+), 3

[PATCH net-next] ixgbe: Use memzero_explicit directly in crypto cases

2019-09-17 Thread zhong jiang
In general, Use kzfree() to replace memset() + kfree() is feasible and resonable. But It's btter to use memzero_explicit() to replace memset() in crypto cases. Signed-off-by: zhong jiang --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 9 ++--- 1 file changed, 6 insertions(+), 3

Re: [RESENT PATCH v2] ixgbe: Use memzero_explicit directly in crypto cases

2019-09-17 Thread zhong jiang
On 2019/9/18 2:11, Jakub Kicinski wrote: > On Tue, 17 Sep 2019 22:44:22 +0800, zhong jiang wrote: >> It's better to use memzero_explicit() to replace memset() in crypto cases. >> >> Signed-off-by: zhong jiang > Thank you for the follow up! Your previous patch to use kzfr

[RESENT PATCH v2] ixgbe: Use memzero_explicit directly in crypto cases

2019-09-17 Thread zhong jiang
It's better to use memzero_explicit() to replace memset() in crypto cases. Signed-off-by: zhong jiang --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net

Re: [PATCH v2] ixgbe: Use memset_explicit directly in crypto cases

2019-09-17 Thread zhong jiang
On 2019/9/17 17:59, Sergei Shtylyov wrote: > Hello! > > On 17.09.2019 6:45, zhong jiang wrote: > >> It's better to use memset_explicit() to replace memset() in crypto cases. > >But you're using memzero_explicit() below? Sorry, stupid Oops. I will repost. Thank for y

[PATCH v2] ixgbe: Use memset_explicit directly in crypto cases

2019-09-16 Thread zhong jiang
It's better to use memset_explicit() to replace memset() in crypto cases. Signed-off-by: zhong jiang --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net

Re: [PATCH 1/3] ixgbe: Use kzfree() rather than its implementation.

2019-09-16 Thread zhong jiang
On 2019/9/17 10:43, Jakub Kicinski wrote: > On Wed, 4 Sep 2019 10:39:10 +0800, zhong jiang wrote: >> Use kzfree() instead of memset() + kfree(). >> >> Signed-off-by: zhong jiang >> --- >> drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 9 +++-- >&

Re: [PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics

2019-09-16 Thread zhong jiang
On 2019/9/17 10:45, Jakub Kicinski wrote: > On Wed, 4 Sep 2019 11:46:23 +0800, zhong jiang wrote: >> Continue is not needed at the bottom of a loop. >> >> Signed-off-by: zhong jiang >> --- >> drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 4 +--- >

Re: [PATCH 2/3] wlegacy: Remove unneeded variable and make function to be void

2019-09-15 Thread zhong jiang
On 2019/9/13 1:45, Kalle Valo wrote: > zhong jiang writes: > >> il4965_set_tkip_dynamic_key_info do not need return value to >> cope with different ases. And change functon return type to void. >> >> Signed-off-by: zhong jiang >> --- >> drivers/

[PATCH] misc: rtsx: Remove unneeded variable in rts5260_card_power_on

2019-09-12 Thread zhong jiang
rts5260_card_power_on do not need local variable to store different value, Hence just remove it. Signed-off-by: zhong jiang --- drivers/misc/cardreader/rts5260.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/cardreader/rts5260.c b/drivers/misc/cardreader

[PATCH] drivers/misc: Remove unneeded variable in st_tty_open

2019-09-12 Thread zhong jiang
st_tty_open do not need local variable to store different value, Hence just remove it. Signed-off-by: zhong jiang --- drivers/misc/ti-st/st_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/ti-st/st_core.c b/drivers/misc/ti-st/st_core.c index 7d9e23a

[PATCH] net/mlx5: Remove unneeded variable in mlx5_unload_one

2019-09-12 Thread zhong jiang
mlx5_unload_one do not need local variable to store different value, Hence just remove it. Signed-off-by: zhong jiang --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b

[PATCH 0/3] wireless: Remove unneeded variable

2019-09-12 Thread zhong jiang
With the help of Coccinelle, I find some place to use redundant variable to store the return value, It is unnecessary. Just remove it and make the funtion to be void. zhong jiang (3): brcmsmac: Remove unneeded variable and make function to be void wlegacy: Remove unneeded variable and make

[PATCH 1/3] brcmsmac: Remove unneeded variable and make function to be void

2019-09-12 Thread zhong jiang
brcms_c_set_mac do not need return value to cope with different cases. And change functon return type to void. Signed-off-by: zhong jiang --- drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/wireless

[PATCH 2/3] wlegacy: Remove unneeded variable and make function to be void

2019-09-12 Thread zhong jiang
il4965_set_tkip_dynamic_key_info do not need return value to cope with different ases. And change functon return type to void. Signed-off-by: zhong jiang --- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net

[PATCH 3/3] libertas: Remove unneeded variable and make function to be void

2019-09-12 Thread zhong jiang
lbs_process_event do not need return value to cope with different cases. And change functon return type to void. Signed-off-by: zhong jiang --- drivers/net/wireless/marvell/libertas/cmd.h | 2 +- drivers/net/wireless/marvell/libertas/cmdresp.c | 5 + 2 files changed, 2 insertions(+), 5

Re: [PATCH] ethernet: micrel: Use DIV_ROUND_CLOSEST directly to make it readable

2019-09-06 Thread zhong jiang
On 2019/9/7 3:40, Andrew Lunn wrote: > On Thu, Sep 05, 2019 at 11:53:48PM +0800, zhong jiang wrote: >> The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d >> but is perhaps more readable. > Hi Zhong > > Did you find this by hand, or did you use a

[PATCH] brcmsmac: Use DIV_ROUND_CLOSEST directly to make it readable

2019-09-05 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- .../net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_n.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net

[PATCH 1/4] media: dvb-frontends: Use DIV_ROUND_CLOSEST directly to make it readable

2019-09-05 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/dvb-frontends/mt312.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/dvb-frontends/mt312.c b/drivers/media/dvb

[PATCH 2/4] media: tuners/qm1d1c0042: Use DIV_ROUND_CLOSEST directly to make it readable

2019-09-05 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/tuners/qm1d1c0042.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/tuners/qm1d1c0042.c b/drivers/media/tuners

[PATCH 0/4] media: Use DIV_ROUND_CLOSEST directly

2019-09-05 Thread zhong jiang
With the following help of Coccinelle. I find out some place can be replaced. -(((x) + ((__divisor) / 2)) / (__divisor)) + DIV_ROUND_CLOSEST(x,__divisor) zhong jiang (4): media: dvb-frontends: Use DIV_ROUND_CLOSEST directly to make it readable media: tuners/qm1d1c0042: Use

[PATCH 3/4] media: uvcvideo: Use DIV_ROUND_CLOSEST directly to make it readable

2019-09-05 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/usb/uvc/uvc_ctrl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb

[PATCH 4/4] media: v4l2-dv-timings: Use DIV_ROUND_CLOSEST directly to make it readable

2019-09-05 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/media/v4l2-core/v4l2-dv-timings.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-dv-timings.c b

[PATCH] ethernet: micrel: Use DIV_ROUND_CLOSEST directly to make it readable

2019-09-05 Thread zhong jiang
The kernel.h macro DIV_ROUND_CLOSEST performs the computation (x + d/2)/d but is perhaps more readable. Signed-off-by: zhong jiang --- drivers/net/ethernet/micrel/ksz884x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net

Re: [PATCH] hostap: remove set but not used variable 'copied' in prism2_io_debug_proc_read

2019-09-05 Thread zhong jiang
On 2019/9/5 21:45, Kalle Valo wrote: > zhong jiang writes: > >> Please ignore the patch. Because the hostap_proc.c is marked as 'obsolete'. > You mean marked in the MAINTAINERS file? I don't see that as a problem, > I can (and should) still apply any patches submitted to hosta

[PATCH 0/3] replace code with FIELD_SIZEOF

2019-09-05 Thread zhong jiang
FIELD_SIZEOF() has implemented sizeof(). Hence use FIELD_SIZEOF directly. zhong jiang (3): batman-adv: Use FIELD_SIZEOF directly media: v4l2: Use FIELD_SIZEOF directly IB/mlx5: Use FIELD_SIZEOF directly drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c

[PATCH 3/3] IB/mlx5: Use FIELD_SIZEOF directly

2019-09-05 Thread zhong jiang
It's more clear to use FIELD_SIZEOF instead of its implementation. Signed-off-by: zhong jiang --- drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h index c3ea299

[PATCH 1/3] batman-adv: Use FIELD_SIZEOF directly

2019-09-05 Thread zhong jiang
It's more clear to use FIELD_SIZEOF instead of its implementation. Signed-off-by: zhong jiang --- net/batman-adv/distributed-arp-table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c index

[PATCH 2/3] media: v4l2: Use FIELD_SIZEOF directly

2019-09-05 Thread zhong jiang
It's more clear to use FIELD_SIZEOF instead of its implementation. Signed-off-by: zhong jiang --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 51b9127

Re: [PATCH 4/4] rtc: ds1347: Use PTR_ERR_OR_ZERO rather than its implementation

2019-09-05 Thread zhong jiang
On 2019/9/5 15:39, Alexandre Belloni wrote: > On 05/09/2019 14:43:15+0800, zhong jiang wrote: >> PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to >> use it directly. hence just replace it. >> > Unless you have a more significant contribution to this

[PATCH 3/4] phy: tegra: Use PTR_ERR_OR_ZERO rather than its implementation

2019-09-05 Thread zhong jiang
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to use it directly. hence just replace it. Signed-off-by: zhong jiang --- drivers/phy/tegra/phy-tegra194-p2u.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/phy/tegra/phy-tegra194-p2u.c b/drivers

[PATCH 4/4] rtc: ds1347: Use PTR_ERR_OR_ZERO rather than its implementation

2019-09-05 Thread zhong jiang
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to use it directly. hence just replace it. Signed-off-by: zhong jiang --- drivers/rtc/rtc-ds1347.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c index

[PATCH 0/4] Use PTR_ERR_OR_ZERO directly

2019-09-05 Thread zhong jiang
With the help of ptr_ret.cocci, I find some place to use PTR_ERR_OR_ZERO directly. zhong jiang (4): bus: ti-sysc: Use PTR_ERR_OR_ZERO rather than its implementation misc: mic: Use PTR_ERR_OR_ZERO rather than its implementation phy: tegra: Use PTR_ERR_OR_ZERO rather than its implementation

[PATCH 2/4] misc: mic: Use PTR_ERR_OR_ZERO rather than its implementation

2019-09-05 Thread zhong jiang
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to use it directly. hence just replace it. Signed-off-by: zhong jiang --- drivers/misc/mic/scif/scif_epd.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/mic/scif/scif_epd.h b/drivers/misc

[PATCH 1/4] bus: ti-sysc: Use PTR_ERR_OR_ZERO rather than its implementation

2019-09-05 Thread zhong jiang
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to use it directly. hence just replace it. Signed-off-by: zhong jiang --- drivers/bus/ti-sysc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 9207ac2

Re: [PATCH v2] mm: Unsigned 'nr_pages' always larger than zero

2019-09-05 Thread zhong jiang
On 2019/9/5 11:12, Matthew Wilcox wrote: > On Thu, Sep 05, 2019 at 10:17:51AM +0800, zhong jiang wrote: >> With the help of unsigned_lesser_than_zero.cocci. Unsigned 'nr_pages' >> compare with zero. And __gup_longterm_locked pass an long local variant >> 'rc' to check_and_mig

Re: [PATCH] mm: Unsigned 'nr_pages' always larger than zero

2019-09-05 Thread zhong jiang
On 2019/9/5 2:48, Andrew Morton wrote: > On Wed, 4 Sep 2019 13:24:58 +0200 Vlastimil Babka wrote: > >> On 9/4/19 12:26 PM, zhong jiang wrote: >>> With the help of unsigned_lesser_than_zero.cocci. Unsigned 'nr_pages"' >>> compare with zero. And __get_user_pag

[PATCH v2] drm/amdgpu: Remove two redundant null pointer checks

2019-09-04 Thread zhong jiang
The functions "debugfs_remove" and "kfree" tolerate the passing of null pointers. Hence it is unnecessary to check such arguments around the calls. Thus remove the extra condition check at two places. Signed-off-by: zhong jiang --- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.

Re: drm/amdgpu: remove the redundant null check

2019-09-04 Thread zhong jiang
ng > these update candidates? With the help of Coccinelle. You can find out some example in scripts/coccinelle/. Sincerely, zhong jiang > Regards, > Markus > > . >

[PATCH] cfg80211: Do not compare with boolean in nl80211_common_reg_change_event

2019-09-04 Thread zhong jiang
With the help of boolinit.cocci, we use !nl80211_reg_change_event_fill instead of (nl80211_reg_change_event_fill == false). Meanwhile, Clean up the code. Signed-off-by: zhong jiang --- net/wireless/nl80211.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/net

Re: NFS: remove the redundant check when kfree an object in nfs_netns_client_release

2019-09-04 Thread zhong jiang
On 2019/9/4 23:11, Markus Elfring wrote: >> kfree has taken the null check in account. > I suggest to take another look at a similar patch. How to fast find out the similar patch. Search the key word doesn't work well. Thanks, zhong jiang > NFS: fix ifnullfree.cocci warnings > h

[PATCH v2] mm: Unsigned 'nr_pages' always larger than zero

2019-09-04 Thread zhong jiang
place get_user_pages_longterm() with FOLL_LONGTERM") Signed-off-by: zhong jiang --- mm/gup.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index 23a9f9c..ee0b71f 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1433,13 +1433,13 @@ static struct page *new_no

Re: [PATCH] mm: Unsigned 'nr_pages' always larger than zero

2019-09-04 Thread zhong jiang
On 2019/9/4 19:24, Vlastimil Babka wrote: > On 9/4/19 12:26 PM, zhong jiang wrote: >> With the help of unsigned_lesser_than_zero.cocci. Unsigned 'nr_pages"' >> compare with zero. And __get_user_pages_locked will return an long value. >> Hence, Convert the long to com

Re: net: hsr: remove a redundant null check before kfree_skb

2019-09-04 Thread zhong jiang
he similar patch before sending it. Sincerely, zhong jiang > Regards, > Markus > > . >

[PATCH] mm: Unsigned 'nr_pages' always larger than zero

2019-09-04 Thread zhong jiang
With the help of unsigned_lesser_than_zero.cocci. Unsigned 'nr_pages"' compare with zero. And __get_user_pages_locked will return an long value. Hence, Convert the long to compare with zero is feasible. Signed-off-by: zhong jiang --- mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH] staging: exfat: remove the redundant check when kfree an object in exfat_destroy_inode

2019-09-04 Thread zhong jiang
kfree has taken the null check in account. hence it is unnecessary to add the null check before kfree the object. Just remove it. Signed-off-by: zhong jiang --- drivers/staging/exfat/exfat_super.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/exfat

[PATCH] ath9k: Remove unneeded variable to store return value

2019-09-04 Thread zhong jiang
ath9k_reg_rmw_single do not need return value to cope with different cases. And change functon return type to void. Signed-off-by: zhong jiang --- drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k

[PATCH 1/3] rtlwifi: Remove an unnecessary continue in _rtl8723be_phy_config_bb_with_pgheaderfile

2019-09-03 Thread zhong jiang
Continue is not needed at the bottom of a loop. Hence just drop it. Signed-off-by: zhong jiang --- drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c b/drivers/net/wireless/realtek/rtlwifi

[PATCH 2/3] nfp: Drop unnecessary continue in nfp_net_pf_alloc_vnics

2019-09-03 Thread zhong jiang
Continue is not needed at the bottom of a loop. Signed-off-by: zhong jiang --- drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp

[PATCH 3/3] ath10k: Drop unnecessary continue in ath10k_mac_update_vif_chan

2019-09-03 Thread zhong jiang
Continue is not needed at the bottom of a loop. Hence just remove it. Signed-off-by: zhong jiang --- drivers/net/wireless/ath/ath10k/mac.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index

[PATCH 0/3] net: remove an redundant continue

2019-09-03 Thread zhong jiang
With the help of Coccinelle. we find some place to replace. @@ for (...;...;...) { ... if (...) { ... - continue; } } zhong jiang (3): rtlwifi: Remove an unnecessary continue in _rtl8723be_phy_config_bb_with_pgheaderfile nfp: Drop unnecessary continue

[PATCH] scsi: qedi: remove an redundant null check before kfree_skb

2019-09-03 Thread zhong jiang
kfree_skb has taken null pointer into account. Hence it is unnecessary to check it before kfree_skb. Just remove the condition. Signed-off-by: zhong jiang --- drivers/scsi/qedi/qedi_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/qedi/qedi_main.c b

[PATCH] net: hsr: remove an redundant null check before kfree_skb

2019-09-03 Thread zhong jiang
kfree_skb has taken the null pointer into account. Hence just remove the null check before kfree_skb. Signed-off-by: zhong jiang --- net/hsr/hsr_forward.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/hsr/hsr_forward.c b/net/hsr/hsr_forward.c index ddd9605

[PATCH 2/3] sunrpc: Use kzfree rather than its implementation.

2019-09-03 Thread zhong jiang
Use kzfree instead of memset() + kfree(). Signed-off-by: zhong jiang --- net/sunrpc/auth_gss/gss_krb5_keys.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/sunrpc/auth_gss/gss_krb5_keys.c b/net/sunrpc/auth_gss/gss_krb5_keys.c index 550fdf1..3b7f721 100644

[PATCH 1/3] ixgbe: Use kzfree() rather than its implementation.

2019-09-03 Thread zhong jiang
Use kzfree() instead of memset() + kfree(). Signed-off-by: zhong jiang --- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c

[PATCH 0/3] net: Use kzfree() directly

2019-09-03 Thread zhong jiang
With the help of Coccinelle. We find some place to replace. @@ expression M, S; @@ - memset(M, 0, S); - kfree(M); + kzfree(M); zhong jiang (3): ixgbe: Use kzfree() rather than its implementation. sunrpc: Use kzfree rather than its implementation. net: mpoa: Use kzfree rather than its

[PATCH 3/3] net: mpoa: Use kzfree rather than its implementation.

2019-09-03 Thread zhong jiang
Use kzfree instead of memset() + kfree(). Signed-off-by: zhong jiang --- net/atm/mpoa_caches.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/atm/mpoa_caches.c b/net/atm/mpoa_caches.c index 4bb4183..3286f9d 100644 --- a/net/atm/mpoa_caches.c +++ b/net/atm

Re: [PATCH] fs: omfs: Use kmemdup rather than duplicating its implementation in omfs_get_imap

2019-09-03 Thread zhong jiang
On 2019/9/3 21:25, Bob Copeland wrote: > On Tue, Sep 03, 2019 at 02:39:44PM +0800, zhong jiang wrote: >> kmemdup contains the kmalloc + memcpy. hence it is better to use kmemdup >> directly. Just replace it. >> >> Signed-off-by: zhong jiang > This same patch was alre

Re: [PATCH] hostap: remove set but not used variable 'copied' in prism2_io_debug_proc_read

2019-09-03 Thread zhong jiang
Please ignore the patch. Because the hostap_proc.c is marked as 'obsolete'. Thanks, zhong jiang On 2019/9/3 15:57, zhong jiang wrote: > Obviously, variable 'copied' is initialized to zero. But it is not used. > hence just remove it. > > Signed-off-by: zhong jiang > --- > dr

[PATCH] hostap: remove set but not used variable 'copied' in prism2_io_debug_proc_read

2019-09-03 Thread zhong jiang
Obviously, variable 'copied' is initialized to zero. But it is not used. hence just remove it. Signed-off-by: zhong jiang --- drivers/net/wireless/intersil/hostap/hostap_proc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/intersil/hostap

[PATCH] net/mlx5: Use PTR_ERR_OR_ZERO rather than its implementation

2019-09-03 Thread zhong jiang
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better to use it directly. hence just replace it. Signed-off-by: zhong jiang --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5

[PATCH] fs: omfs: Use kmemdup rather than duplicating its implementation in omfs_get_imap

2019-09-03 Thread zhong jiang
kmemdup contains the kmalloc + memcpy. hence it is better to use kmemdup directly. Just replace it. Signed-off-by: zhong jiang --- fs/omfs/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/omfs/inode.c b/fs/omfs/inode.c index b76ec6b..8867cef 100644 --- a/fs/omfs

[PATCH] NFS: remove the redundant check when kfree an object in nfs_netns_client_release

2019-09-03 Thread zhong jiang
kfree has taken the null check in account. hence it is unnecessary to add the null check before kfree the object. Just remove it. Signed-off-by: zhong jiang --- fs/nfs/sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/nfs/sysfs.c b/fs/nfs/sysfs.c index 4f3390b

Re: [PATCH] mm/mempolicy: Fix an incorrect rebind node in mpol_rebind_nodemask

2019-05-27 Thread zhong jiang
On 2019/5/27 20:23, Vlastimil Babka wrote: > On 5/25/19 8:28 PM, Andrew Morton wrote: >> (Cc Vlastimil) > Oh dear, 2 years and I forgot all the details about how this works. > >> On Sat, 25 May 2019 15:07:23 +0800 zhong jiang wrote: >> >>> We bind an differ

[PATCH] mm/mempolicy: Fix an incorrect rebind node in mpol_rebind_nodemask

2019-05-25 Thread zhong jiang
plify rebinding mempolicies when updating cpusets") Signed-off-by: zhong jiang --- mm/mempolicy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index e3ab1d9..a60a3be 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -345,7 +

Re: [PATCH] mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock

2019-04-07 Thread zhong jiang
I am sorry, It is incorrect. please ignore the patch. I will resent it. Thanks, zhong jiang On 2019/4/8 12:00, zhong jiang wrote: > When adding the memory by probing memory block in sysfs interface, there is an > obvious issue that we will unlock the device_hotplug_lock when fails to

[RESENT PATCH] mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock

2019-04-07 Thread zhong jiang
hould drop out in time when fails to take the device_hotplug_lock. Fixes: 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock") Reported-by: Yang yingliang Signed-off-by: zhong jiang --- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[PATCH] mm/memory_hotplug: Do not unlock when fails to take the device_hotplug_lock

2019-04-07 Thread zhong jiang
hould drop out in time when fails to take the device_hotplug_lock. Fixes: 8df1d0e4a265 ("mm/memory_hotplug: make add_memory() take the device_hotplug_lock") Reported-by: Yang yingliang Signed-off-by: zhong jiang --- drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 del

Re: KASAN: use-after-free Read in get_mem_cgroup_from_mm

2019-03-18 Thread zhong jiang
On 2019/3/17 3:42, Andrea Arcangeli wrote: > On Sat, Mar 16, 2019 at 05:38:54PM +0800, zhong jiang wrote: >> On 2019/3/16 5:39, Andrea Arcangeli wrote: >>> On Fri, Mar 08, 2019 at 03:10:08PM +0800, zhong jiang wrote: >>>> I can reproduce the issue in arm64 qemu

Re: KASAN: use-after-free Read in get_mem_cgroup_from_mm

2019-03-16 Thread zhong jiang
On 2019/3/16 5:39, Andrea Arcangeli wrote: > On Fri, Mar 08, 2019 at 03:10:08PM +0800, zhong jiang wrote: >> I can reproduce the issue in arm64 qemu machine. The issue will leave after >> applying the >> patch. >> >> Tested-by: zhong jiang > Thanks a lot f

  1   2   3   4   5   6   7   8   >