[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

[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 51

[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 c3

[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

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 sub

[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

[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 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 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] 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 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

[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 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] 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] 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] 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

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/

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 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 +++-- >&

[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/driver

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. T

[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/driver

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

[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(

[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(

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 > Sig

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 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

[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 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 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] 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

[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] broadcom: Fix an compile warning in nvram_init

2019-09-22 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] staging: wfx: fix an undefined reference error when CONFIG_MMC=m

2019-10-10 Thread zhong jiang
`sdio_unregister_driver' 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/dri

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

2019-10-10 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-nex

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

2019-10-10 Thread zhong jiang
ging/wfx/main.c: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 j

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

2019-10-11 Thread zhong jiang
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
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
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
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

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

2019-10-11 Thread zhong jiang
`sdio_unregister_driver' 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

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-nex

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

2019-10-12 Thread zhong jiang
`sdio_unregister_driver' 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 insertio

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-nex

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

2019-10-14 Thread zhong jiang
tate "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

[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] 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

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

2019-10-16 Thread zhong jiang
tate "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

[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

[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/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/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 delet

[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 delet

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

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

2019-03-03 Thread zhong jiang
Thanks, zhong jiang On 2018/12/4 23:43, syzbot wrote: > syzbot has found a reproducer for the following crash on: > > HEAD commit:0072a0c14d5b Merge tag 'media/v4.20-4' of git://git.kernel.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/lo

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

2019-03-04 Thread zhong jiang
On 2019/3/4 15:40, Dmitry Vyukov wrote: > On Sun, Mar 3, 2019 at 5:19 PM zhong jiang wrote: >> Hi, guys >> >> I also hit the following issue. but it fails to reproduce the issue by the >> log. >> >> it seems to the case that we access the mm->owner a

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

2019-03-04 Thread zhong jiang
On 2019/3/4 22:11, Dmitry Vyukov wrote: > On Mon, Mar 4, 2019 at 3:00 PM zhong jiang wrote: >> On 2019/3/4 15:40, Dmitry Vyukov wrote: >>> On Sun, Mar 3, 2019 at 5:19 PM zhong jiang wrote: >>>> Hi, guys >>>> >>>> I also hit the follo

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

2019-03-04 Thread zhong jiang
On 2019/3/5 5:51, Matthew Wilcox wrote: > On Mon, Mar 04, 2019 at 12:19:32AM +0800, zhong jiang wrote: >> I also hit the following issue. but it fails to reproduce the issue by the >> log. >> >> it seems to the case that we access the mm->owner and deference it will

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

2019-03-04 Thread zhong jiang
On 2019/3/5 14:26, Dmitry Vyukov wrote: > On Mon, Mar 4, 2019 at 4:32 PM zhong jiang wrote: >> On 2019/3/4 22:11, Dmitry Vyukov wrote: >>> On Mon, Mar 4, 2019 at 3:00 PM zhong jiang wrote: >>>> On 2019/3/4 15:40, Dmitry Vyukov wrote: >>>>> On S

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

2019-03-05 Thread zhong jiang
On 2019/3/6 10:05, Andrea Arcangeli wrote: > Hello everyone, > > [ CC'ed Mike and Peter ] > > On Tue, Mar 05, 2019 at 02:42:00PM +0800, zhong jiang wrote: >> On 2019/3/5 14:26, Dmitry Vyukov wrote: >>> On Mon, Mar 4, 2019 at 4:32 PM zhong jiang wrote: >>

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

2019-03-05 Thread zhong jiang
On 2019/3/6 14:26, Mike Rapoport wrote: > Hi, > > On Wed, Mar 06, 2019 at 01:53:12PM +0800, zhong jiang wrote: >> On 2019/3/6 10:05, Andrea Arcangeli wrote: >>> Hello everyone, >>> >>> [ CC'ed Mike and Peter ] >>> >>> On Tue, Mar 05,

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

2019-03-06 Thread zhong jiang
On 2019/3/6 16:12, Peter Xu wrote: > On Wed, Mar 06, 2019 at 03:41:06PM +0800, zhong jiang wrote: >> On 2019/3/6 14:26, Mike Rapoport wrote: >>> Hi, >>> >>> On Wed, Mar 06, 2019 at 01:53:12PM +0800, zhong jiang wrote: >>>> On 2019/3/6 10:

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

2019-03-06 Thread zhong jiang
On 2019/3/7 2:29, Andrea Arcangeli wrote: > Hello Zhong, > > On Wed, Mar 06, 2019 at 09:07:00PM +0800, zhong jiang wrote: >> The patch use call_rcu to delay free the task_struct, but It is possible to >> free the task_struct >> ahead of get_mem_cgroup_from_mm. is it rig

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

2019-03-07 Thread zhong jiang
On 2019/3/6 10:05, Andrea Arcangeli wrote: > Hello everyone, > > [ CC'ed Mike and Peter ] > > On Tue, Mar 05, 2019 at 02:42:00PM +0800, zhong jiang wrote: >> On 2019/3/5 14:26, Dmitry Vyukov wrote: >>> On Mon, Mar 4, 2019 at 4:32 PM zhong jiang wrote: >>

[PATCH] staging: remove unneeded static set .owner field in platform_driver

2018-09-11 Thread zhong jiang
platform_driver_register will set the .owner field. So it is safe to remove the redundant assignment. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang --- drivers/staging/greybus/audio_codec.c| 1 - drivers/staging/mt7621-eth/gsw_mt7621.c | 1 - drivers

[PATCH] ASoC: remove unneeded static set .owner field in platform_driver

2018-09-11 Thread zhong jiang
platform_driver_register will set the .owner field. So it is safe to remove the redundant assignment. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang --- sound/soc/mediatek/mt2701/mt2701-wm8960.c | 1 - sound/soc/mediatek/mt6797/mt6797-mt6351.c | 1 - sound/soc

[PATCH] brcm80211: remove redundant condition check before debugfs_remove_recursive

2018-09-12 Thread zhong jiang
debugfs_remove_recursive has taken IS_ERR_OR_NULL into account. So just remove the condition check before debugfs_remove_recursive. Signed-off-by: zhong jiang --- drivers/net/wireless/broadcom/brcm80211/brcmsmac/debug.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a

Re: [PATCH 0/2] arm64: remove some extra semicolon

2018-09-12 Thread zhong jiang
On 2018/9/4 0:59, Will Deacon wrote: > On Thu, Aug 09, 2018 at 10:20:39PM +0800, zhong jiang wrote: >> There are some extra semicolon in arm64 architecture. Just remove them. > These are trivial but certainly not urgent, so I guess Catalin can pick > them up for 4.20. Thanks, C

[PATCH] x86: common: fix unused variable warning

2018-09-12 Thread zhong jiang
Fix the following compile warning: rch/x86/kernel/cpu/common.c: In function 'syscall_init': arch/x86/kernel/cpu/common.c:1534:6: warning: unused variable 'cpu' [-Wunused-variable] int cpu = smp_processor_id(); Signed-off-by: zhong jiang --- arch/x86/kernel/cpu/common

[PATCH] HID: logitech: fix a used uninitialized GCC warning

2018-09-12 Thread zhong jiang
ier = multiplier; Signed-off-by: zhong jiang --- drivers/hid/hid-logitech-hidpp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 5f0c080..83c43dd 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/

Re: [PATCH] HID: logitech: fix a used uninitialized GCC warning

2018-09-13 Thread zhong jiang
On 2018/9/13 15:01, Benjamin Tissoires wrote: > On Thu, Sep 13, 2018 at 6:04 AM zhong jiang wrote: >> Fix the following compile warning: >> >> drivers/hid/hid-logitech-hidpp.c: In function ‘hi_res_scroll_enable’: >> drivers/hid/hid-logitech-hidpp.c:2714:54: warnin

[PATCH v2] HID: logitech: fix a used uninitialized GCC warning

2018-09-13 Thread zhong jiang
r.resolution_multiplier = multiplier; Signed-off-by: zhong jiang --- v1->v2: According to Benjamin's suggestion, To initialize the value and remove the duplicated assignement. drivers/hid/hid-logitech-hidpp.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dri

[PATCH] sched: Fix a GCC compiled warning.

2018-09-14 Thread zhong jiang
Fix the following compile warning: kernel/sched/core.c: In function ‘update_rq_clock_task’: kernel/sched/core.c:139:6: warning: unused variable ‘steal’ [-Wunused-variable] s64 steal = 0, irq_delta = 0; Signed-off-by: zhong jiang --- kernel/sched/core.c | 2 +- 1 file changed, 1 insertion

[PATCH] drm: i2c: use match_string() helper to simplify the code

2018-09-14 Thread zhong jiang
match_string() returns the index of an array for a matching string, which can be used intead of open coded implementation. Signed-off-by: zhong jiang --- drivers/gpu/drm/i2c/ch7006_drv.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/i2c

[PATCH] bus: fsl-mc: use match_string() helper to simplify the code

2018-09-14 Thread zhong jiang
match_string() returns the index of an array for a matching string, which can be used intead of open coded implementation. Signed-off-by: zhong jiang --- drivers/bus/fsl-mc/fsl-mc-allocator.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/bus/fsl-mc

[PATCH] arm: common: use match_string() helper to simplify the code

2018-09-14 Thread zhong jiang
match_string() returns the index of an array for a matching string, which can be used instead of open coded implementation. Signed-off-by: zhong jiang --- arch/arm/plat-orion/common.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/arm/plat-orion/common.c b

Re: [PATCH] sched: Fix a GCC compiled warning.

2018-09-14 Thread zhong jiang
On 2018/9/15 0:43, Miguel Ojeda wrote: > Hi Zhong, > > On Fri, Sep 14, 2018 at 4:49 PM, zhong jiang wrote: >> Fix the following compile warning: >> >> kernel/sched/core.c: In function ‘update_rq_clock_task’: >> kernel/sched/core.c:139:6: warning: unused variab

[PATCH] mm: use match_string() helper to simplify the code

2018-09-14 Thread zhong jiang
match_string() returns the index of an array for a matching string, which can be used intead of open coded implementation. Signed-off-by: zhong jiang --- mm/mempolicy.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 2e76a8f

Re: [PATCH] arm: common: use match_string() helper to simplify the code

2018-09-14 Thread zhong jiang
us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/zhong-jiang/arm-common-use-match_string-helper-to-simplify-the-code/20180915-035510 > base: https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git > for-next > config: a

Re: [PATCH] soc: qcom: qdsp6: remove duplicated include from q6adm.c

2018-09-25 Thread zhong jiang
On 2018/9/22 0:22, Mark Brown wrote: > On Fri, Sep 21, 2018 at 06:24:58PM +0800, zhong jiang wrote: >> We include wait.h twice in q6adm.c. it is unnecessary. hence remove >> it. Further, order the include files as alphabet. > Please use subject lines matching the style for th

Re: [PATCH] media: card_utils: remove duplicated include file

2018-09-25 Thread zhong jiang
On 2018/9/26 2:20, Greg KH wrote: > On Thu, Sep 20, 2018 at 01:04:02PM +0800, zhong jiang wrote: >> delay.h and dma-mapping.h have duplicated include. hence just remove >> redundant file. >> >> Signed-off-by: zhong jiang >> --- >> drivers/misc/genwqe/ca

[PATCHv2] misc: genwqe: remove duplicated include and order header files alphabetically in card_utils.c

2018-09-25 Thread zhong jiang
dma-mapping.h and delay.h have included twice. It is unnecessary. Meanwhile, Arrange header files in alphabetical sequence to improve readability. Signed-off-by: zhong jiang --- drivers/misc/genwqe/card_utils.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff

Re: [PATCH] acpi: remove a meaningless null check before debugfs_remove

2018-09-06 Thread zhong jiang
+to maintainers On 2018/8/18 18:49, zhong jiang wrote: > debugfs_remove has taken null pointer into account. So it is safe > to remove the check before debugfs_remove. > > Signed-off-by: zhong jiang > --- > drivers/acpi/custom_method.c | 3 +-- > 1 file changed, 1 inse

[PATCH] ASoC: wm8731: Fix a unused function gcc warning

2018-09-29 Thread zhong jiang
Fix the following compile warning: sound/soc/codecs/wm8731.c:575:12: warning: 'wm8731_request_supplies' defined but not used [-Wunused-function] sound/soc/codecs/wm8731.c:600:12: warning: 'wm8731_hw_init' defined but not used [-Wunused-function] Signed-off-by: zhong j

Re: [PATCH] ASoC: wm8731: Fix a unused function gcc warning

2018-09-29 Thread zhong jiang
On 2018/9/30 10:17, Joe Perches wrote: > On Sun, 2018-09-30 at 09:45 +0800, zhong jiang wrote: >> Fix the following compile warning: >> >> sound/soc/codecs/wm8731.c:575:12: warning: 'wm8731_request_supplies' defined >> but not used [-Wunused-function] >>

[PATCH v2] ASoC: wm8731: Fix a unused function gcc warning

2018-09-29 Thread zhong jiang
Fix the following compile warning: sound/soc/codecs/wm8731.c:575:12: warning: 'wm8731_request_supplies' defined but not used [-Wunused-function] sound/soc/codecs/wm8731.c:600:12: warning: 'wm8731_hw_init' defined but not used [-Wunused-function] Signed-off-by: zhong jiang

[STABLE PATCH] slub: make ->cpu_partial unsigned int

2018-09-30 Thread zhong jiang
Kim Cc: # 4.4.x Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: zhong jiang --- include/linux/slub_def.h | 3 ++- mm/slub.c| 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/linux/slub_def.h b/include/linux/slub_def

[PATCH] sched: psi: Fix a GCC uninitialized warning

2018-09-18 Thread zhong jiang
I find the following warning when compiling the kernel. kernel/sched/psi.c:639:13: warning: 'rq' may be used uninitialized in this function [-Wmaybe-uninitialized] struct rq *rq; Signed-off-by: zhong jiang --- kernel/sched/psi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH] soc: qcom: cmd-db: Fix some uninitialized warning.

2018-09-18 Thread zhong jiang
his function [-Wmaybe-uninitialized] return ret < 0 ? 0 : le16_to_cpu(ent.len); drivers/soc/qcom/cmd-db.c:269:24: warning: ‘ent.addr’ may be used uninitialized in this function [-Wmaybe-uninitialized] addr = le32_to_cpu(ent.addr); Signed-off-by: zhong jiang --- drivers/soc/qcom/cmd-db

Re: [PATCH] drm: sun4i: Fix a uninitialized variable warning.

2018-09-19 Thread zhong jiang
On 2018/9/19 16:47, Maxime Ripard wrote: > On Tue, Sep 18, 2018 at 03:25:20PM +0800, zhong jiang wrote: >> Fix the following compile warning: >> >> drivers/gpu/drm/sun4i/sun4i_tcon.c:1088: warning: 'has_lvds_alt' may be used >> uninitialized in this fun

Re: [PATCH] net: iucv: Use FIELD_SIZEOF directly instead of reimplementing its function

2018-09-19 Thread zhong jiang
On 2018/9/19 17:52, zhong jiang wrote: > FIELD_SIZEOF is defined as a macro to calculate the specified vaule. > Therefore, > We prefer to use the macro rather than calculating its vaule. s/vaule/value . will resend . Thanks, zhong jiang > Signed-off-by: zhong jiang >

[PATCH] misc: genwqe: should return proper error value.

2018-09-19 Thread zhong jiang
The function should return -EFAULT when copy_from_user fails. Even though the caller does not distinguish them. but we should keep backward compatibility. Signed-off-by: zhong jiang --- drivers/misc/genwqe/card_utils.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff

[PATCH] media: card_utils: remove duplicated include file

2018-09-19 Thread zhong jiang
delay.h and dma-mapping.h have duplicated include. hence just remove redundant file. Signed-off-by: zhong jiang --- drivers/misc/genwqe/card_utils.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c index f0961ec..3fcb9a2

[PATCH] misc: genwqe: remove duplicated include file

2018-09-19 Thread zhong jiang
module.h has duplicated include. hence just remove redundant include file. Signed-off-by: zhong jiang --- drivers/misc/genwqe/card_base.c | 1 - drivers/misc/genwqe/card_ddcb.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/misc/genwqe/card_base.c b/drivers/misc/genwqe/card_base.c

[PATCH] RDMA/cxgb4: remove redundant null pointer check before kfree_skb

2018-09-20 Thread zhong jiang
kfree_skb has taken the null pointer into account. hence it is safe to remove the redundant null pointer check before kfree_skb. Signed-off-by: zhong jiang --- drivers/infiniband/hw/cxgb4/cm.c | 3 +-- drivers/infiniband/hw/cxgb4/qp.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions

<    1   2   3   4   5   >