* [PATCH] sock: use hlist_entry_safe @ 2017-01-20 14:27 Geliang Tang 2017-01-20 14:27 ` Geliang Tang 2017-01-20 16:39 ` [PATCH] sock: use hlist_entry_safe David Miller 0 siblings, 2 replies; 6+ messages in thread From: Geliang Tang @ 2017-01-20 14:27 UTC (permalink / raw) To: David S. Miller; +Cc: Geliang Tang, netdev, linux-kernel Use hlist_entry_safe() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@gmail.com> --- include/net/sock.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/net/sock.h b/include/net/sock.h index 4077ec4..c4e1caf1 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -544,8 +544,7 @@ static inline struct sock *sk_nulls_head(const struct hlist_nulls_head *head) static inline struct sock *sk_next(const struct sock *sk) { - return sk->sk_node.next ? - hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL; + return hlist_entry_safe(sk->sk_node.next, struct sock, sk_node); } static inline struct sock *sk_nulls_next(const struct sock *sk) -- 2.9.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] video/mbx: use simple_open() 2017-01-20 14:27 [PATCH] sock: use hlist_entry_safe Geliang Tang @ 2017-01-20 14:27 ` Geliang Tang 2017-01-20 16:39 ` [PATCH] sock: use hlist_entry_safe David Miller 1 sibling, 0 replies; 6+ messages in thread From: Geliang Tang @ 2017-01-20 14:27 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: Geliang Tang, linux-fbdev, linux-kernel Drop open_file_generic(), use simple_open() instead of it. Signed-off-by: Geliang Tang <geliangtang@gmail.com> --- drivers/video/fbdev/mbx/mbxdebugfs.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/video/fbdev/mbx/mbxdebugfs.c b/drivers/video/fbdev/mbx/mbxdebugfs.c index e3bc00a..2528d3e 100644 --- a/drivers/video/fbdev/mbx/mbxdebugfs.c +++ b/drivers/video/fbdev/mbx/mbxdebugfs.c @@ -15,12 +15,6 @@ struct mbxfb_debugfs_data { struct dentry *misc; }; -static int open_file_generic(struct inode *inode, struct file *file) -{ - file->private_data = inode->i_private; - return 0; -} - static ssize_t write_file_dummy(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { @@ -174,42 +168,42 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf, static const struct file_operations sysconf_fops = { .read = sysconf_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations clock_fops = { .read = clock_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations display_fops = { .read = display_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations gsctl_fops = { .read = gsctl_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations sdram_fops = { .read = sdram_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations misc_fops = { .read = misc_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; -- 2.9.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] video/mbx: use simple_open() @ 2017-01-20 14:27 ` Geliang Tang 0 siblings, 0 replies; 6+ messages in thread From: Geliang Tang @ 2017-01-20 14:27 UTC (permalink / raw) To: Bartlomiej Zolnierkiewicz; +Cc: Geliang Tang, linux-fbdev, linux-kernel Drop open_file_generic(), use simple_open() instead of it. Signed-off-by: Geliang Tang <geliangtang@gmail.com> --- drivers/video/fbdev/mbx/mbxdebugfs.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/video/fbdev/mbx/mbxdebugfs.c b/drivers/video/fbdev/mbx/mbxdebugfs.c index e3bc00a..2528d3e 100644 --- a/drivers/video/fbdev/mbx/mbxdebugfs.c +++ b/drivers/video/fbdev/mbx/mbxdebugfs.c @@ -15,12 +15,6 @@ struct mbxfb_debugfs_data { struct dentry *misc; }; -static int open_file_generic(struct inode *inode, struct file *file) -{ - file->private_data = inode->i_private; - return 0; -} - static ssize_t write_file_dummy(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { @@ -174,42 +168,42 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf, static const struct file_operations sysconf_fops = { .read = sysconf_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations clock_fops = { .read = clock_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations display_fops = { .read = display_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations gsctl_fops = { .read = gsctl_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations sdram_fops = { .read = sdram_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; static const struct file_operations misc_fops = { .read = misc_read_file, .write = write_file_dummy, - .open = open_file_generic, + .open = simple_open, .llseek = default_llseek, }; -- 2.9.3 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] video/mbx: use simple_open() 2017-01-20 14:27 ` Geliang Tang @ 2017-01-30 16:22 ` Bartlomiej Zolnierkiewicz -1 siblings, 0 replies; 6+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2017-01-30 16:22 UTC (permalink / raw) To: Geliang Tang; +Cc: linux-fbdev, linux-kernel Hi, On Friday, January 20, 2017 10:27:05 PM Geliang Tang wrote: > Drop open_file_generic(), use simple_open() instead of it. > > Signed-off-by: Geliang Tang <geliangtang@gmail.com> Thanks, patch queued for 4.11. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics > --- > drivers/video/fbdev/mbx/mbxdebugfs.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/video/fbdev/mbx/mbxdebugfs.c b/drivers/video/fbdev/mbx/mbxdebugfs.c > index e3bc00a..2528d3e 100644 > --- a/drivers/video/fbdev/mbx/mbxdebugfs.c > +++ b/drivers/video/fbdev/mbx/mbxdebugfs.c > @@ -15,12 +15,6 @@ struct mbxfb_debugfs_data { > struct dentry *misc; > }; > > -static int open_file_generic(struct inode *inode, struct file *file) > -{ > - file->private_data = inode->i_private; > - return 0; > -} > - > static ssize_t write_file_dummy(struct file *file, const char __user *buf, > size_t count, loff_t *ppos) > { > @@ -174,42 +168,42 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf, > static const struct file_operations sysconf_fops = { > .read = sysconf_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations clock_fops = { > .read = clock_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations display_fops = { > .read = display_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations gsctl_fops = { > .read = gsctl_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations sdram_fops = { > .read = sdram_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations misc_fops = { > .read = misc_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] video/mbx: use simple_open() @ 2017-01-30 16:22 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 6+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2017-01-30 16:22 UTC (permalink / raw) To: Geliang Tang; +Cc: linux-fbdev, linux-kernel Hi, On Friday, January 20, 2017 10:27:05 PM Geliang Tang wrote: > Drop open_file_generic(), use simple_open() instead of it. > > Signed-off-by: Geliang Tang <geliangtang@gmail.com> Thanks, patch queued for 4.11. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics > --- > drivers/video/fbdev/mbx/mbxdebugfs.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/video/fbdev/mbx/mbxdebugfs.c b/drivers/video/fbdev/mbx/mbxdebugfs.c > index e3bc00a..2528d3e 100644 > --- a/drivers/video/fbdev/mbx/mbxdebugfs.c > +++ b/drivers/video/fbdev/mbx/mbxdebugfs.c > @@ -15,12 +15,6 @@ struct mbxfb_debugfs_data { > struct dentry *misc; > }; > > -static int open_file_generic(struct inode *inode, struct file *file) > -{ > - file->private_data = inode->i_private; > - return 0; > -} > - > static ssize_t write_file_dummy(struct file *file, const char __user *buf, > size_t count, loff_t *ppos) > { > @@ -174,42 +168,42 @@ static ssize_t misc_read_file(struct file *file, char __user *userbuf, > static const struct file_operations sysconf_fops = { > .read = sysconf_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations clock_fops = { > .read = clock_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations display_fops = { > .read = display_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations gsctl_fops = { > .read = gsctl_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations sdram_fops = { > .read = sdram_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; > > static const struct file_operations misc_fops = { > .read = misc_read_file, > .write = write_file_dummy, > - .open = open_file_generic, > + .open = simple_open, > .llseek = default_llseek, > }; ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sock: use hlist_entry_safe 2017-01-20 14:27 [PATCH] sock: use hlist_entry_safe Geliang Tang 2017-01-20 14:27 ` Geliang Tang @ 2017-01-20 16:39 ` David Miller 1 sibling, 0 replies; 6+ messages in thread From: David Miller @ 2017-01-20 16:39 UTC (permalink / raw) To: geliangtang; +Cc: netdev, linux-kernel From: Geliang Tang <geliangtang@gmail.com> Date: Fri, 20 Jan 2017 22:27:04 +0800 > Use hlist_entry_safe() instead of open-coding it. > > Signed-off-by: Geliang Tang <geliangtang@gmail.com> Applied. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-01-30 16:23 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-01-20 14:27 [PATCH] sock: use hlist_entry_safe Geliang Tang 2017-01-20 14:27 ` [PATCH] video/mbx: use simple_open() Geliang Tang 2017-01-20 14:27 ` Geliang Tang 2017-01-30 16:22 ` Bartlomiej Zolnierkiewicz 2017-01-30 16:22 ` Bartlomiej Zolnierkiewicz 2017-01-20 16:39 ` [PATCH] sock: use hlist_entry_safe David Miller
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.