Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp941037pxb; Wed, 3 Mar 2021 21:54:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJxhrv0ssq51D/q9xxfx9zonVBnEh43vcG+htd5RwGnmvwse5x8Ugtin5YrCPdY9Op1Carjk X-Received: by 2002:a50:fe89:: with SMTP id d9mr2589787edt.57.1614837262419; Wed, 03 Mar 2021 21:54:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614837262; cv=none; d=google.com; s=arc-20160816; b=oH9Gf5SV46bze9PkTCeKFn/e7o2F7MLgUIPLTxF+241/nqAlbEiCynDXqfCHb4TG2s wWdlG/JNMSuVPJmDHMGW9KB7GiTi27jrABcpZAqYAd2MXjC/1Y3Gi1yP7KPl6V0TnJwP CWhG5erHUcHI4WylpkKsCDNdGLvhu2LlGHDQcFtfzacixAYnI3XMygTEvueZih5jvpjp DUBRKEq7U4axa5f0UzAXtqjq4bKY+M0y2rl6wP1zKdEfFLlP1rPor73Akpz1UkUlkRC8 agRf8DK/ObLY12f9H1aWryVOTb37rIQOw8eFlWMEk2YOj54MKiK36tBETIVlWe67aet5 hLqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FcRYWpK0IMVf9qyY92pXCswFOXbRFUmJtsBD57RIpn8=; b=qe+JcXMGxyeAOmW7Fw8mKu8whaRxGzmuVMS6jI21ROT1TDCPdBHp4MG00a5+Js+TkU ZHJg6QjCyPkbgVl5NMu86yCU0JqaS+1QJd6S31mu3ePKpGt7nNGHcOdo7vt+BPgEa33e OzjNSHLCPUckoCINfyVp3fHIHAcPM3Egv04c7OrnDAia+RyG0MEQuQPzVuEA0uCclQ6x sGVtgDcooPG7rZuwxHSzPMiyCL74WFS5dKChSHhCBOw52Ue7i008YfE7O3zX64bVBEyx J2PascRekUS0rmOvNwI0nAy0lPHPNHYfhC7SsrGx+7TrY8lFNa3xBrM8u/FvYEbC390T ZHAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si4984095edr.596.2021.03.03.21.53.59; Wed, 03 Mar 2021 21:54:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381349AbhCBHRp (ORCPT + 99 others); Tue, 2 Mar 2021 02:17:45 -0500 Received: from mx2.suse.de ([195.135.220.15]:39920 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1835892AbhCBGYq (ORCPT ); Tue, 2 Mar 2021 01:24:46 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 232A7B035; Tue, 2 Mar 2021 06:22:21 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby , Chris Zankel , Max Filippov , linux-xtensa@linux-xtensa.org Subject: [PATCH 32/44] tty: xtensa/iss, setup the timer statically Date: Tue, 2 Mar 2021 07:22:02 +0100 Message-Id: <20210302062214.29627-32-jslaby@suse.cz> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210302062214.29627-1-jslaby@suse.cz> References: <20210302062214.29627-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use DEFINE_TIMER and avoid runtime initialization of the serial_timer. Signed-off-by: Jiri Slaby Cc: Chris Zankel Cc: Max Filippov Cc: linux-xtensa@linux-xtensa.org --- arch/xtensa/platforms/iss/console.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index 3b89d9ceb06a..8ea261b8c022 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c @@ -31,21 +31,18 @@ #define SERIAL_MAX_NUM_LINES 1 #define SERIAL_TIMER_VALUE (HZ / 10) +static void rs_poll(struct timer_list *); + static struct tty_driver *serial_driver; static struct tty_port serial_port; -static struct timer_list serial_timer; - +static DEFINE_TIMER(serial_timer, rs_poll); static DEFINE_SPINLOCK(timer_lock); -static void rs_poll(struct timer_list *); - static int rs_open(struct tty_struct *tty, struct file * filp) { spin_lock_bh(&timer_lock); - if (tty->count == 1) { - timer_setup(&serial_timer, rs_poll, 0); + if (tty->count == 1) mod_timer(&serial_timer, jiffies + SERIAL_TIMER_VALUE); - } spin_unlock_bh(&timer_lock); return 0; -- 2.30.1