Skip to content

Commit

Permalink
s390/sclp: convert list_for_each to entry variant
Browse files Browse the repository at this point in the history
convert list_for_each() to list_for_each_entry() where
applicable.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
Link: https://lore.kernel.org/r/1623740220-15846-1-git-send-email-zou_wei@huawei.com
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
  • Loading branch information
Zou Wei authored and Vasily Gorbik committed Jun 18, 2021
1 parent 0a9d947 commit 87929ca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/s390/char/sclp_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,14 @@ static int
sclp_tty_chars_in_buffer(struct tty_struct *tty)
{
unsigned long flags;
struct list_head *l;
struct sclp_buffer *t;
int count;

spin_lock_irqsave(&sclp_tty_lock, flags);
count = 0;
if (sclp_ttybuf != NULL)
count = sclp_chars_in_buffer(sclp_ttybuf);
list_for_each(l, &sclp_tty_outqueue) {
t = list_entry(l, struct sclp_buffer, list);
list_for_each_entry(t, &sclp_tty_outqueue, list) {
count += sclp_chars_in_buffer(t);
}
spin_unlock_irqrestore(&sclp_tty_lock, flags);
Expand Down

0 comments on commit 87929ca

Please sign in to comment.