A question about toot1/vm/page-type.c

2016-07-20 Thread zhong jiang
Hi, guys My system have 4G memory. I print the following memssage. I execute the command (page-types) to obtain all pfn status. I check 784272 pfn about 3063M from page-types , but I ought to obtain all pfn status in the whole memory space, is right ? The Memtotal is ~2932M. therefore, I

Re: [PATCH] mm/huge_memory: fix the memory leak due to the race

2016-06-21 Thread zhong jiang
On 2016/6/21 23:29, Kirill A. Shutemov wrote: > On Tue, Jun 21, 2016 at 11:19:07PM +0800, zhong jiang wrote: >> On 2016/6/21 22:37, Kirill A. Shutemov wrote: >>> On Tue, Jun 21, 2016 at 10:05:56PM +0800, zhongjiang wrote: >>>> From: zhong jiang >>>> >&

[RFC] remove unnecessary condition in remove_inode_hugepages

2016-09-22 Thread zhong jiang
At present, we need to call hugetlb_fix_reserve_count when hugetlb_unrserve_pages fails, and PagePrivate will decide hugetlb reserves counts. we obtain the page from page cache. and use page both lock_page and mutex_lock. alloc_huge_page add page to page chace always hold lock page, then bail ou

Re: [RFC] remove unnecessary condition in remove_inode_hugepages

2016-09-23 Thread zhong jiang
On 2016/9/24 1:19, Mike Kravetz wrote: > On 09/22/2016 06:53 PM, zhong jiang wrote: >> At present, we need to call hugetlb_fix_reserve_count when >> hugetlb_unrserve_pages fails, >> and PagePrivate will decide hugetlb reserves counts. >> >> we obtain the page f

Re: [RFC] remove unnecessary condition in remove_inode_hugepages

2016-09-24 Thread zhong jiang
On 2016/9/25 8:06, Mike Kravetz wrote: > On 09/23/2016 07:56 PM, zhong jiang wrote: >> On 2016/9/24 1:19, Mike Kravetz wrote: >>> On 09/22/2016 06:53 PM, zhong jiang wrote: >>>> At present, we need to call hugetlb_fix_reserve_count when >>>> hugetlb_unrse

Re: [PATCH] fs: wipe off the compiler warn

2016-07-29 Thread zhong jiang
On 2016/7/30 7:02, Andrew Morton wrote: > On Fri, 29 Jul 2016 22:46:39 +0800 zhongjiang wrote: > >> From: zhong jiang >> >> when compile the kenrel code, I happens to the following warn. >> fs/reiserfs/ibalance.c:1156:2: warning: ___new_insert_key___ may be used >

Re: [PATCH] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-19 Thread zhong jiang
On 2017/6/19 23:05, Andy Lutomirski wrote: > On Mon, Jun 19, 2017 at 6:33 AM, zhong jiang wrote: >> On 2017/6/19 12:48, Andy Lutomirski wrote: >>> It was historically possible to have two concurrent TLB flushes >>> targeting the same CPU: one initiated locally and

Re: [PATCH] mm/vmalloc: a slight change of compare target in __insert_vmap_area()

2017-05-25 Thread zhong jiang
On 2017/5/26 9:36, Wei Yang wrote: > On Thu, May 25, 2017 at 11:04:44AM +0800, zhong jiang wrote: >> I hit the overlap issue, but it is hard to reproduced. if you think it is >> safe. and the situation >> is not happen. AFAIC, it is no need to add the code. >> &g

is it a problem when cat /proc/pid/status

2015-08-31 Thread zhong jiang
I want to know whether the NUMA bound memory node with CONFIG_CGROUPS related or associted with NUMA binding. I wrote an example test,the results are as follows. > euler-linux:/home/zhongjiang # numactl --membind=1 ./new & > [1] 6529 > euler-linux:/home/zhongjiang # ps -ef | grep new > root

some problems about kasan

2015-10-15 Thread zhong jiang
1、 I feel confused about one of the cases when testing the cases kasan can solve . the function come from the kernel in the /lib/test_kasan.c. static noinline void __init kmalloc_uaf2(void) { char *ptr1, *ptr2; size_t size = 43; pr_info("use-after-free after another k

memory-hotplug have such a problem.

2015-10-26 Thread zhong jiang
when I test the memory online or offline, I find the problem that memory online always return an error. I peform the operation as follow: cd /sys/device/system/memory/ echo online > state it always print "-bash: echo: write error: Operation not permitted

Re: [Question] A novel case happened when using mempool allocate memory.

2018-08-02 Thread zhong jiang
On 2018/8/2 21:31, Matthew Wilcox wrote: > On Thu, Aug 02, 2018 at 02:22:03PM +0800, zhong jiang wrote: >> On 2018/8/1 23:37, Matthew Wilcox wrote: >>> Please post the code. >> when module is loaded. we create the specific mempool. The code flow is as >> follows. >

Re: [PATCH linux-next] driver/gpu: Fix mismatch in funciton argument type

2018-08-03 Thread zhong jiang
On 2018/7/22 13:41, zhong jiang wrote: > Fix the following warning: > > drivers/gpu/drm/nouveau/dispnv50/wndw.c:570:1: error: symbol 'nv50_wndw_new_' > redeclared with different type > (originally declared at drivers/gpu/drm/nouveau/dispnv50/wndw.h:39) - > incomp

[PATCH] sched/topology: Make some local variable static

2018-08-03 Thread zhong jiang
Fix the following warning. kernel/sched/topology.c:10:15: warning: symbol 'sched_domains_tmpmask' was not declared. Should it be static? kernel/sched/topology.c:11:15: warning: symbol 'sched_domains_tmpmask2' was not declared. Should it be static? Signed-off-by: zhong jian

[PATCH] kernel/kthread: Make function __kthread_queue_delayed_work static

2018-08-03 Thread zhong jiang
Fix the following warning. kernel/kthread.c:859:6: warning: symbol '__kthread_queue_delayed_work' was not declared. Should it be static? Signed-off-by: zhong jiang --- kernel/kthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/kthread.c b/kernel

[PATCH] ext4/mballoc: Remove unneeded variable "err"

2018-08-04 Thread zhong jiang
The err is not used after initalization. So just remove the variable. Signed-off-by: zhong jiang --- fs/ext4/mballoc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 8b24d3d..e29fce2 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4

Re: [PATCH] ext4/mballoc: Remove unneeded variable "err"

2018-08-05 Thread zhong jiang
On 2018/8/5 5:24, Theodore Y. Ts'o wrote: > On Sat, Aug 04, 2018 at 07:04:56PM +0800, zhong jiang wrote: >> The err is not used after initalization. So just remove the variable. >> >> Signed-off-by: zhong jiang > I'll apply this patch, but how did you generate t

Re: [PATCH] kernel/kthread: Make function __kthread_queue_delayed_work static

2018-08-05 Thread zhong jiang
On 2018/8/3 21:21, Steven Rostedt wrote: > On Fri, 3 Aug 2018 20:40:02 +0800 > zhong jiang wrote: > >> Fix the following warning. >> >> kernel/kthread.c:859:6: warning: symbol '__kthread_queue_delayed_work' was >> not declared. Should it be stat

[PATCH] drivers/staging: Remove some unneeded semicolon

2018-08-05 Thread zhong jiang
That semicolons are unneeded, JUst remove them. Signed-off-by: zhong jiang --- drivers/staging/erofs/unzip_vle.c | 2 +- drivers/staging/gasket/gasket_interrupt.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers

Re: [PATCH] drivers/staging: Remove some unneeded semicolon

2018-08-05 Thread zhong jiang
On 2018/8/6 9:27, Gao Xiang wrote: > Hi Jiang, > > On 2018/8/5 21:57, zhong jiang wrote: >> That semicolons are unneeded, JUst remove them. >> >> Signed-off-by: zhong jiang > Thanks for your patch. Since erofs and gasket are different feature, it is > better to

Re: [PATCH] net/bridge/br_multicast: remove redundant variable "err"

2018-08-05 Thread zhong jiang
On 2018/8/6 8:33, David Miller wrote: > From: zhong jiang > Date: Sun, 5 Aug 2018 22:18:43 +0800 > >> @@ -1797,7 +1795,7 @@ static int br_multicast_ipv4_rcv(struct net_bridge *br, >> struct sk_buff *skb_trimmed = NULL; >> const unsigned char *src; >>

Re: [PATCH 0/3] Remove uneeded variable "err"

2018-08-05 Thread zhong jiang
On 2018/8/6 3:14, Nikolay Borisov wrote: > > On 5.08.2018 18:02, zhong jiang wrote: >> zhong jiang (3): >> fs/btrfs/disk-io: Remove unneeded variable "err" >> fs/btrfs/extent-tree: remove redudant variable "err" >> fs/btrfs/tree-log: remov

Re: [PATCH 1/3] fs/btrfs/disk-io: Remove unneeded variable "err"

2018-08-05 Thread zhong jiang
On 2018/8/5 23:27, Joe Perches wrote: > On Sun, 2018-08-05 at 23:02 +0800, zhong jiang wrote: >> The err is not used after initalization, So remove it and make >> the function to be void function. > [] >> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c > [] >>

[PATCH] staging: gasket: remove some extra semicolon

2018-08-05 Thread zhong jiang
That semicolons are unneeded, Just remove them. Signed-off-by: zhong jiang --- drivers/staging/gasket/gasket_interrupt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gasket/gasket_interrupt.c b/drivers/staging/gasket/gasket_interrupt.c index 09c3d07

[PATCH v2] drivers/thermal/tegra: Fix a double free on the device node

2018-08-27 Thread zhong jiang
ned-off-by: zhong jiang --- v1->v2: According to Daniel's suggestion. I modify the subject and commit log. drivers/thermal/tegra/soctherm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/thermal/tegra/soctherm.c b/drivers/thermal/tegra/soctherm.c index ed28110..3aa55c9 100644 ---

[PATCH] drivers/block/mtip32xx: remove the null check for debugfs_remove_recursive

2018-08-08 Thread zhong jiang
debugfs_remove_recursive has taken null pointer into account. So it is safe to drop the null check before calling the funtion. Signed-off-by: zhong jiang --- drivers/block/mtip32xx/mtip32xx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c

[PATCH] drivers/block/aoe/aoedev: NULL check is not needed for mempool_destroy

2018-08-08 Thread zhong jiang
mempool_destroy has taken the null pointer into account. So it is safe to remove the null check. Signed-off-by: zhong jiang --- drivers/block/aoe/aoedev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index

[PATCH] drivers/block/drbd: remove the null check for kmem_cache_destroy

2018-08-08 Thread zhong jiang
kmem_cache_destroy has taken null pointer into account. So it is safe to drop the null check before calling the function. Signed-off-by: zhong jiang --- drivers/block/drbd/drbd_main.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/block/drbd/drbd_main.c

[PATCH] drivers/thermal/tegra: fix a doule free devce node

2018-08-09 Thread zhong jiang
Device node iterators will get the return node. Meawhile, It is also put the previous device node. An explicit put will cause a double put. Signed-off-by: zhong jiang --- drivers/thermal/tegra/soctherm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/thermal/tegra/soctherm.c b

[PATCH 1/2] arm64/kprobes: remove an extra semicolon in arch_prepare_kprobe

2018-08-09 Thread zhong jiang
There is an extra semicolon in arch_prepare_kprobe, remove it. Signed-off-by: zhong jiang --- arch/arm64/kernel/probes/kprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index e78c3ef..9b65132

[PATCH 2/2] arm64:guest: remove some extra semicolon in kvm_target_cpu

2018-08-09 Thread zhong jiang
There are some extra semicolon in kvm_target_cpu, remove it. Signed-off-by: zhong jiang --- arch/arm64/kvm/guest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 07256b0..a74f84d 100644 --- a/arch/arm64/kvm/guest.c

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

2018-08-09 Thread zhong jiang
There are some extra semicolon in arm64 architecture. Just remove them. zhong jiang (2): arm64/kprobes: remove an extra semicolon in arch_prepare_kprobe arm64:guest: remove some extra semicolon in kvm_target_cpu arch/arm64/kernel/probes/kprobes.c | 2 +- arch/arm64/kvm/guest.c

[PATCH] arm:pmsa-v8: remove some extra semicolon

2018-08-09 Thread zhong jiang
There are some extra semicolon in pmsa-v8.c. So just remove them. I detect the issue with the help of Coccinelle. Signed-off-by: zhong jiang --- arch/arm/mm/pmsa-v8.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mm/pmsa-v8.c b/arch/arm/mm/pmsa-v8.c index

[PATCH] ia64:tioce_provider: Use kmemdup rather than implement the function

2018-08-09 Thread zhong jiang
The kmemdup has implemented the function that kmalloc() + memcpy will do. So just replace them to make the code concise. Signed-off-by: zhong jiang --- arch/ia64/sn/pci/tioce_provider.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/ia64/sn/pci/tioce_provider.c b

[PATCH] arm:pm: Use kmemdup to replace duplicating its implementation

2018-08-09 Thread zhong jiang
kmemdup is better than kmalloc() + memcpy(), and we do not like open code. So just use kmemdup instead. Signed-off-by: zhong jiang --- arch/arm/mach-lpc32xx/pm.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-lpc32xx/pm.c b/arch/arm/mach-lpc32xx/pm.c

[PATCH] staging:pci-mt7621: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-13 Thread zhong jiang
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So just replace them rather than duplicating its implement. Signed-off-by: zhong jiang --- drivers/staging/mt7621-pci/pci-mt7621.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/mt7621-pci/pci

Re: [PATCH] staging:pci-mt7621: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-13 Thread zhong jiang
On 2018/8/13 19:26, Sergio Paracuellos wrote: > On Mon, Aug 13, 2018 at 12:54 PM, zhong jiang wrote: >> PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So >> just replace them rather than duplicating its implement. >> >> Signed-off-by: zhong jiang >&g

[PATCH 2/2] phy:phy-lantiq-rcu-usb2: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-13 Thread zhong jiang
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So just replace them rather than duplicating its implement. Signed-off-by: zhong jiang --- drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/phy/lantiq/phy-lantiq

[PATCH 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-13 Thread zhong jiang
The issue is detected with the help of Coccinelle. zhong jiang (2): phy:phy-brcm-us: Use PTR_ERR_OR_ZERO to replace the open code phy:phy-lantiq-rcu-usb2: Use PTR_ERR_OR_ZERO to replace the open code drivers/phy/broadcom/phy-brcm-usb.c | 4 +--- drivers/phy/lantiq/phy-lantiq-rcu-usb2.c

[PATCH 1/2] phy:phy-brcm-us: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-13 Thread zhong jiang
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So just replace them rather than duplicating its implement. Signed-off-by: zhong jiang --- drivers/phy/broadcom/phy-brcm-usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/phy/broadcom/phy-brcm

[PATCH 0/2] rtc: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-13 Thread zhong jiang
The issue is detected with the help of Coccinelle. zhong jiang (2): rtc:rtc-digicolor: Use PTR_ERR_OR_ZERO to replace the open code rtc:rtc-ds1347: Use PTR_ERR_OR_ZERO to replace the open code drivers/rtc/rtc-digicolor.c | 4 +--- drivers/rtc/rtc-ds1347.c| 5 + 2 files changed, 2

[PATCH 1/2] rtc:rtc-digicolor: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-13 Thread zhong jiang
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So just replace them rather than duplicating its implement. Signed-off-by: zhong jiang --- drivers/rtc/rtc-digicolor.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-digicolor.c b/drivers/rtc

[PATCH 2/2] rtc:rtc-ds1347: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-13 Thread zhong jiang
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So just replace them rather than duplicating its implement. 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

[PATCH] scsi: Use vmemdup_user to replace the open code

2018-08-13 Thread zhong jiang
vmemdup_user is better than duplicating its implementation, So just replace the open code. Signed-off-by: zhong jiang --- drivers/scsi/hpsa.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 58bb70b..948576a 100644

Re: [PATCH] scsi: Use vmemdup_user to replace the open code

2018-08-13 Thread zhong jiang
Please ignore the patch, will repost . Thanks On 2018/8/13 20:22, zhong jiang wrote: > vmemdup_user is better than duplicating its implementation, So just > replace the open code. > > Signed-off-by: zhong jiang > --- > drivers/scsi/hpsa.c | 10 +++--- > 1 file change

[PATCH v2] scsi: Use vmemdup_user to replace the open code

2018-08-13 Thread zhong jiang
vmemdup_user is better than duplicating its implementation, So just replace the open code. The issue is detected with the help of Coccinelle. Signed-off-by: zhong jiang --- drivers/scsi/hpsa.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/hpsa.c

Re: [PATCH] arm:pm: Use kmemdup to replace duplicating its implementation

2018-08-13 Thread zhong jiang
On 2018/8/13 20:28, Vladimir Zapolskiy wrote: > Hi zhong jiang, > > On 08/10/2018 05:40 AM, zhong jiang wrote: >> kmemdup is better than kmalloc() + memcpy(), and we do not like >> open code. So just use kmemdup instead. >> >> Signed-off-by: zhong jiang >>

[PATCH] arm/mach-at91/pm: Do not double put the device node

2018-08-13 Thread zhong jiang
Device node iterators put the previous value of the index variable, so an explicit put causes a double put. I detect the issue with the help of Coccinelle. Signed-off-by: zhong jiang --- arch/arm/mach-at91/pm.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/arm

Re: [PATCH] drivers/thermal/tegra: fix a doule free devce node

2018-08-13 Thread zhong jiang
On 2018/8/14 14:39, Daniel Lezcano wrote: > On 09/08/2018 15:40, zhong jiang wrote: >> Device node iterators will get the return node. Meawhile, It is >> also put the previous device node. An explicit put will cause >> a double put. > What about: > > Subject: drive

[PATCH v2] ia64: Use ARRAY_SIZE to replace its implementation

2018-08-14 Thread zhong jiang
We prefer to ARRAY_SIZE rather than duplicating its implementation. And just one place use the #define variable, therefore, remove PFM_CMD_COUNT definition altogether. Signed-off-by: zhong jiang --- v1->v2: - According to Joe's suggestion. remove the #define variable, and use AR

Re: [PATCHv2 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open coded version

2018-08-23 Thread zhong jiang
Ping , Anyone has any objection with the patchset ? Thanks, zhong jiang On 2018/8/16 23:58, zhong jiang wrote: > The issue is detected with the help of Coccinelle. > > v1->v2: > - According to Florian's suggestion, change the subject of the patch. > > zhong jiang (2):

Re: [PATCH v2] scsi: Use vmemdup_user to replace the open code

2018-08-23 Thread zhong jiang
On 2018/8/13 22:20, don.br...@microchip.com wrote: >> -Original Message- >> From: zhong jiang [mailto:zhongji...@huawei.com] >> Sent: Monday, August 13, 2018 7:43 AM >> To: don.br...@microsemi.com; j...@linux.vnet.ibm.com; >> martin.peter...@oracle.com >&

Re: [PATCH] arm: pm: call put_device instead of of_node_put in at91_pm_config_ws

2018-08-23 Thread zhong jiang
Hi, alexandre Can you pick up the patch? Thanks Best wishes, zhong jiang On 2018/8/16 18:26, zhong jiang wrote: > of_find_device_by_node takes a reference to the struct device when it > finds a match via get_device. but it fails to put_device in > at91_pm_

Re: [PATCH] arm: pm: call put_device instead of of_node_put in at91_pm_config_ws

2018-08-23 Thread zhong jiang
On 2018/8/23 20:19, Alexandre Belloni wrote: > On 23/08/2018 19:44:38+0800, zhong jiang wrote: >> Hi, alexandre >> >> Can you pick up the patch? Thanks >> > We are still in the merge window, this has to wait for v4.19-rc1. Fine. Thank you for let me know .

[PATCH] x86/boot/KASLR: Make local variable mem_limit static

2018-07-30 Thread zhong jiang
Fix the following sparse warning: arch/x86/boot/compressed/kaslr.c:102:20: warning: symbol 'mem_limit' was not declared. Should it be static? Signed-off-by: zhong jiang --- arch/x86/boot/compressed/kaslr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arc

[PATCH linux-next] mm/tlb: make some function static to avoid warning

2018-07-21 Thread zhong jiang
Fixes the following sparse warnings: arch/x86/mm/tlb.c:38:6: warning: symbol 'clear_asid_other' was not declared. Should it be static? Signed-off-by: zhong jiang --- arch/x86/mm/tlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/mm/tlb.c b/arch/x8

[PATCH linux-next] x86: should use NULL pointer to replace plain integer

2018-07-21 Thread zhong jiang
Fixes the following sparse warnings: arch/x86/kernel/pci-iommu_table.c:63:37: warning: Using plain integer as NULL pointer Signed-off-by: zhong jiang --- arch/x86/kernel/pci-iommu_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/pci-iommu_table.c b

[PATCH linux-next] kernel/exit: fix mismatch in function argument types

2018-07-21 Thread zhong jiang
Fix following warning: kernel/exit.c:1634:6: error: symbol 'kernel_wait4' redeclared with different type (originally declared at ./include/linux/sched/task.h:78) - incompatible argument 2 (different address spaces) Signed-off-by: zhong jiang --- include/linux/sched/task.h | 2

[PATCH linux-next] driver/gpu: Fix mismatch in funciton argument type

2018-07-21 Thread zhong jiang
Fix the following warning: drivers/gpu/drm/nouveau/dispnv50/wndw.c:570:1: error: symbol 'nv50_wndw_new_' redeclared with different type (originally declared at drivers/gpu/drm/nouveau/dispnv50/wndw.h:39) - incompatible argument 7 (different signedness) Signed-off-by: zhong jiang --

[PATCH] driver/hwtracing: use ERR_CAST instead of ERR_PTR

2018-07-31 Thread zhong jiang
Use ERR_CAT inlined function to replace the ERR_PTR(PTR_ERR). It make the code more concise. Signed-off-by: zhong jiang --- drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b

[PATCH] lib/sg_pool,debugobjects: remove unnecessary null check when free the object

2018-07-31 Thread zhong jiang
kmem_cache_destroy/mempool_destroy has taken null check into account. so remove the redundant check. Signed-off-by: zhong jiang --- lib/debugobjects.c | 3 +-- lib/sg_pool.c | 7 +++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c

[PATCH] x86/platform/olpc: Use the PTR_ERR_OR_ZERO to simplify the code

2018-07-31 Thread zhong jiang
use PTR_ERR_OR_ZERO is better than the open code Signed-off-by: zhong jiang --- arch/x86/platform/olpc/olpc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/x86/platform/olpc/olpc.c b/arch/x86/platform/olpc/olpc.c index 7c3077e..f0e920f 100644 --- a/arch/x86

Re: [PATCH] lib/sg_pool,debugobjects: remove unnecessary null check when free the object

2018-07-31 Thread zhong jiang
On 2018/8/1 0:21, Thomas Gleixner wrote: > On Tue, 31 Jul 2018, zhong jiang wrote: > >> kmem_cache_destroy/mempool_destroy has taken null check into account. >> so remove the redundant check. > Please split the patch so they can be applied independently by the relevant >

[PATCH] lib/sg_pool: remove unnecessary null check when free the object

2018-07-31 Thread zhong jiang
kmem_cache_destroy/mempool_destroy has taken null check into account. so remove the redundant check. Signed-off-by: zhong jiang --- lib/sg_pool.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/sg_pool.c b/lib/sg_pool.c index 6dd3061..d1c1e63 100644 --- a/lib

[PATCH] lib/debugobjects: remove redundant check when free the object

2018-07-31 Thread zhong jiang
kmem_cache_destroy has taken the null check into account. so just remove the unnecessary check. Signed-off-by: zhong jiang --- lib/debugobjects.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 994be48..7a6d80b 100644 --- a/lib

[PATCH] kernel/module: Use kmemdup to replace kmalloc+memcpy

2018-07-31 Thread zhong jiang
we prefer to the kmemdup rather than kmalloc+memcpy. so just replace them. Signed-off-by: zhong jiang --- kernel/module.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/module.c b/kernel/module.c index 20344e4..6746c85 100644 --- a/kernel/module.c +++ b/kernel

[PATCH] drivers/staging/mt7621-eth: Use dma_zalloc_coherent to replace dma_alloc_coherent+memset

2018-08-01 Thread zhong jiang
we prefer to use dma_zalloc_coherent rather than dam_alloc_coherent+memset Signed-off-by: zhong jiang --- drivers/staging/mt7621-eth/mtk_eth_soc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/mt7621-eth/mtk_eth_soc.c b/drivers/staging/mt7621-eth

[Question] A novel case happened when using mempool allocate memory.

2018-08-01 Thread zhong jiang
gister the moudle. but I check the code(mm/slub.c) carefully . I can not find any clue to prove my assumption. I will be appreciate if anyone have any idea about the case. Thanks zhong jiang

[PATCH] fs/binfmt_elf: remove the same condition check

2018-08-01 Thread zhong jiang
dump_align is used to double check in a expression. It is redundant. so just remove one of them. Signed-off-by: zhong jiang --- fs/binfmt_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index efae2fb..b6c5b02 100644 --- a/fs

[PATCH] fs/binfmt_elf_fdpic: remove redundant condition check in writenote

2018-08-01 Thread zhong jiang
It is unncessary to use double test for a expression. so just remove one of them. Signed-off-by: zhong jiang --- fs/binfmt_elf_fdpic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index b53bb37..5162372 100644 --- a/fs

Re: [PATCH] fs/binfmt_elf_fdpic: remove redundant condition check in writenote

2018-08-01 Thread zhong jiang
plese ingore it. On 2018/8/2 10:04, zhong jiang wrote: > It is unncessary to use double test for a expression. so just > remove one of them. > > Signed-off-by: zhong jiang > --- > fs/binfmt_elf_fdpic.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-

Re: [PATCH] fs/binfmt_elf: remove the same condition check

2018-08-01 Thread zhong jiang
On 2018/8/2 10:34, Matthew Wilcox wrote: > On Thu, Aug 02, 2018 at 10:00:28AM +0800, zhong jiang wrote: >> dump_align is used to double check in a expression. It is redundant. >> so just remove one of them. > You're wrong. Functions in C can have side-effects (and this one

Re: [PATCH] fs/binfmt_elf: remove the same condition check

2018-08-01 Thread zhong jiang
On 2018/8/2 11:04, Al Viro wrote: > On Thu, Aug 02, 2018 at 10:00:28AM +0800, zhong jiang wrote: >> dump_align is used to double check in a expression. It is redundant. >> so just remove one of them. > > What makes you think that it is redundant? > I am sorry for that.

Re: [Question] A novel case happened when using mempool allocate memory.

2018-08-01 Thread zhong jiang
On 2018/8/1 23:37, Matthew Wilcox wrote: > On Wed, Aug 01, 2018 at 11:31:15PM +0800, zhong jiang wrote: >> Hi, Everyone >> >> I ran across the following novel case similar to memory leak in linux-4.1 >> stable when allocating >> memory object by kmem_cache_all

[PATCH v2 3/4] drivers/scsi/snic/snic_trc: Use kvcalloc instead of vmalloc+memset

2018-08-02 Thread zhong jiang
The kvcalloc is better than vmalloc() + memset() , So replace them. Signed-off-by: zhong jiang --- drivers/scsi/snic/snic_trc.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/snic/snic_trc.c b/drivers/scsi/snic/snic_trc.c index fc60c93..e766fa2 100644

[PATCH v2 0/4] Use dma_zalloc_coherent and kvcalloc to replace open code

2018-08-02 Thread zhong jiang
4/4] do nothing. just add Andy's review-by. zhong jiang (4): driver/scsi/fnic/fnic_trace: Use kvcalloc instead of vmalloc+memset drivers/scsi/dpt_i2o: Use dma_zalloc_coherent to repalce dma_alloc_coherent+memset drivers/scsi/snic/snic_trc: Use kvcalloc instead of vmalloc+memset drive

[PATCH linux-next] gpio: fix meaningless return expression

2018-07-24 Thread zhong jiang
Fix the following sparse error: drivers/gpio/gpio-ath79.c:54:16: error: return expression in void function Signed-off-by: zhong jiang --- drivers/gpio/gpio-ath79.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c index

Re: [PATCH v11 19/26] mm: provide speculative fault infrastructure

2018-07-25 Thread zhong jiang
On 2018/7/25 0:10, Laurent Dufour wrote: > > On 24/07/2018 16:26, zhong jiang wrote: >> On 2018/5/17 19:06, Laurent Dufour wrote: >>> From: Peter Zijlstra >>> >>> Provide infrastructure to do a speculative fault (not holding >>> mmap_sem). >&

Re: [PATCH v11 19/26] mm: provide speculative fault infrastructure

2018-07-25 Thread zhong jiang
On 2018/7/25 18:44, Laurent Dufour wrote: > > On 25/07/2018 11:04, zhong jiang wrote: >> On 2018/7/25 0:10, Laurent Dufour wrote: >>> On 24/07/2018 16:26, zhong jiang wrote: >>>> On 2018/5/17 19:06, Laurent Dufour wrote: >>>>> From: Peter Zijl

[PATCH] misc: cxl: Move a deference below a NULL test

2018-09-26 Thread zhong jiang
It is safe to move a deference below a NULL test. Signed-off-by: zhong jiang --- drivers/misc/cxl/guest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/cxl/guest.c b/drivers/misc/cxl/guest.c index 3bc0c15..559e835 100644 --- a/drivers/misc/cxl/guest.c

Re: [PATCH v2] NFC: st-nci: remove a redundant null pointer check

2018-09-26 Thread zhong jiang
On 2018/9/26 22:03, Andy Shevchenko wrote: > On Wed, Sep 26, 2018 at 08:30:50PM +0800, zhong jiang wrote: >> The dev is impossible is NULL. hence the check is redundant. We >> never will hit it. >> > Reviewed-by: Andy Shevchenko Thanks. >> Signed-off-by:

Re: [PATCH] powerpc: Move a dereference below a NULL test

2018-09-26 Thread zhong jiang
On 2018/9/26 22:22, Michal Suchánek wrote: > On Wed, 26 Sep 2018 19:46:08 +0800 > zhong jiang wrote: > >> It is safe to move dereference below a NULL test. >> >> Signed-off-by: zhong jiang >> --- >> arch/powerpc/kernel/cacheinfo.c | 5 ++--- >>

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

2018-09-26 Thread zhong jiang
On 2018/9/26 11:05, zhong jiang wrote: > 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 +

[RESEND PATCH v2] misc: card_utils: remove duplicated include file

2018-09-27 Thread zhong jiang
delay.h and dma-mapping.h have duplicated include. hence just remove redundant file. Signed-off-by: zhong jiang --- v1->v2: - modify the subject drivers/misc/genwqe/card_utils.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/gen

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

2018-09-27 Thread zhong jiang
he patch is a effective bugfix. It should go into stable. Signed-off-by: Alexey Dobriyan Acked-by: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: sta...@vger.kernel.org Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: zhong jiang ---

Re: [PATCH] ieee802154: remove a redundant local variable 'i'

2018-09-27 Thread zhong jiang
On 2018/9/27 22:47, Stefan Schmidt wrote: > Hello. > > On 19/09/2018 16:41, zhong jiang wrote: >> The local variable 'i' is never used after being assigned. >> hence it should be redundant adn can be removed. >> >> Signed-off-by: zhong jiang >> --

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

2018-09-28 Thread zhong jiang
On 2018/9/27 23:46, Greg KH wrote: > On Thu, Sep 27, 2018 at 10:43:40PM +0800, zhong jiang wrote: >> From: Alexey Dobriyan >> >> /* >> * cpu_partial determined the maximum number of objects >> * kept in the per cpu partial lists of a proc

[PATCH] fs/dax.c: Use vmf_error() helper

2018-09-28 Thread zhong jiang
These codes can be replaced with new inline vmf_error(). Signed-off-by: zhong jiang --- fs/dax.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index b68ce48..e732f70 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -1311,9 +1311,8 @@ static vm_fault_t

Re: [PATCH] mm: use this_cpu_cmpxchg_double in put_cpu_partial

2018-11-19 Thread zhong jiang
s more to call for ideas. Have you hit the really issue or just review the code ? I did hit the issue and fixed in the upstream patch unpredictably by the following patch. e5d9998f3e09 ("slub: make ->cpu_partial unsigned int") Thanks, zhong jiang > Signed-off-by: Wengang Wang >

Re: [Question] There is a thp count left when the process exits

2018-11-08 Thread zhong jiang
+LKML I can not find the possibility when I check the code. because the mmap_sem and spin_lock will protect the concurrence. I will be appreciated if anyone has some clue. Thanks, zhong jiang On 2018/11/8 23:01, zhong jiang wrote: > Hi, > > Recently, I hit the following issue

Re: [PATCH 1/2] rtc:rtc-digicolor: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-15 Thread zhong jiang
On 2018/8/15 0:15, Alexandre Belloni wrote: > Hi, > > On 13/08/2018 19:31:24+0800, zhong jiang wrote: >> PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So >> just replace them rather than duplicating its implement. >> >> Signed-off-by: zhong

Re: [PATCH 1/2] phy:phy-brcm-us: Use PTR_ERR_OR_ZERO to replace the open code

2018-08-15 Thread zhong jiang
On 2018/8/16 7:23, Florian Fainelli wrote: > On 08/13/2018 04:24 AM, zhong jiang wrote: >> PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So >> just replace them rather than duplicating its implement. > Subject should be: > > phy: phy-brcm-usb: Use PTR_ERR

Re: [PATCH] arm/mach-at91/pm: Do not double put the device node

2018-08-16 Thread zhong jiang
On 2018/8/16 17:32, Claudiu Beznea wrote: > Hi Alexandre, > > On 14.08.2018 15:59, Alexandre Belloni wrote: >> On 14/08/2018 09:54:56+0800, zhong jiang wrote: >>> Device node iterators put the previous value of the index variable, >>> so an explicit put

[PATCH] arm: pm: call put_device instead of of_node_put in at91_pm_config_ws

2018-08-16 Thread zhong jiang
instead of of_node_put in at91_pm_config_ws. Fixes: d7484f5c6b3b ("ARM: at91: pm: configure wakeup sources for ULP1 mode") Suggested-by: Claudiu Beznea Signed-off-by: zhong jiang --- arch/arm/mach-at91/pm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm

[PATCHv2 2/2] phy:phy-lantiq-rcu-usb2: Use PTR_ERR_OR_ZERO to replace the open coded version

2018-08-16 Thread zhong jiang
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So just replace them rather than duplicating its implement. Signed-off-by: zhong jiang --- drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/phy/lantiq/phy-lantiq

[PATCHv2 0/2] phy: Use PTR_ERR_OR_ZERO to replace the open coded version

2018-08-16 Thread zhong jiang
The issue is detected with the help of Coccinelle. v1->v2: - According to Florian's suggestion, change the subject of the patch. zhong jiang (2): phy:phy-brcm-usb: Use PTR_ERR_OR_ZERO to replace the open coded version phy:phy-lantiq-rcu-usb2: Use PTR_ERR_OR_ZERO to replace

[PATCHv2 1/2] phy:phy-brcm-usb: Use PTR_ERR_OR_ZERO to replace the open coded version

2018-08-16 Thread zhong jiang
PTR_ERR_OR_ZERO has implemented the if(IS_ERR(...)) + PTR_ERR, So just replace them rather than duplicating its implement. Signed-off-by: zhong jiang --- drivers/phy/broadcom/phy-brcm-usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/phy/broadcom/phy-brcm

Re: [PATCH] drivers/thermal/tegra: fix a doule free devce node

2018-08-16 Thread zhong jiang
On 2018/8/14 14:39, Daniel Lezcano wrote: > On 09/08/2018 15:40, zhong jiang wrote: >> Device node iterators will get the return node. Meawhile, It is >> also put the previous device node. An explicit put will cause >> a double put. > What about: > > Subject: drive

[PATCH] misc: remove meanless null check before kfree

2018-08-16 Thread zhong jiang
kfree has taken null pointer into account. so check the null pointer before kfree is meanless. Signed-off-by: zhong jiang --- drivers/misc/sgi-xp/xpc_partition.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/misc/sgi-xp/xpc_partition.c b/drivers/misc/sgi-xp

[PATCH] drviers: intel_ips: remove the unneeded null pointer check before debugfs_remove_recursive

2018-08-16 Thread zhong jiang
debugfs_remove_recursive has taken the null pointer into account. just remove the null check before debugfs_remove_recursive. Signed-off-by: zhong jiang --- drivers/platform/x86/intel_ips.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel_ips.c b

  1   2   3   4   5   >