From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Hogan Subject: Re: [PATCH] tty: metag_da: Convert timers to use timer_setup() Date: Tue, 17 Oct 2017 13:12:27 +0100 Message-ID: <20171017121226.GN15235@jhogan-linux> References: <20171016232836.GA101212@beast> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="hTKW8p8tUZ/8vLMe" Return-path: Content-Disposition: inline In-Reply-To: <20171016232836.GA101212@beast> Sender: linux-kernel-owner@vger.kernel.org List-ID: To: Kees Cook Cc: Greg Kroah-Hartman , Jiri Slaby , linux-metag@vger.kernel.org, linux-kernel@vger.kernel.org --hTKW8p8tUZ/8vLMe Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 16, 2017 at 04:28:36PM -0700, Kees Cook wrote: > In preparation for unconditionally passing the struct timer_list pointer = to > all timer callbacks, switch to using the new timer_setup() and from_timer= () > to pass the timer pointer explicitly. >=20 > Cc: James Hogan > Cc: Greg Kroah-Hartman > Cc: Jiri Slaby > Cc: linux-metag@vger.kernel.org > Signed-off-by: Kees Cook Looks good to me and seems to work. Acked-by: James Hogan Cheers James > --- > drivers/tty/metag_da.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/tty/metag_da.c b/drivers/tty/metag_da.c > index 25ccef2fe748..82ccf3982b25 100644 > --- a/drivers/tty/metag_da.c > +++ b/drivers/tty/metag_da.c > @@ -309,7 +309,7 @@ static int put_data(void *arg) > /* > * This gets called every DA_TTY_POLL and polls the channels for data > */ > -static void dashtty_timer(unsigned long ignored) > +static void dashtty_timer(struct timer_list *poll_timer) > { > int channel; > =20 > @@ -323,12 +323,12 @@ static void dashtty_timer(unsigned long ignored) > if (channel >=3D 0) > fetch_data(channel); > =20 > - mod_timer(&poll_timer, jiffies + DA_TTY_POLL); > + mod_timer(poll_timer, jiffies + DA_TTY_POLL); > } > =20 > static void add_poll_timer(struct timer_list *poll_timer) > { > - setup_pinned_timer(poll_timer, dashtty_timer, 0); > + timer_setup(poll_timer, dashtty_timer, TIMER_PINNED); > poll_timer->expires =3D jiffies + DA_TTY_POLL; > =20 > /* > @@ -461,7 +461,7 @@ static void dashtty_hangup(struct tty_struct *tty) > * buffers. It is used to delay the expensive writeout until the writer = has > * stopped writing. > */ > -static void dashtty_put_timer(unsigned long ignored) > +static void dashtty_put_timer(struct timer_list *unused) > { > if (atomic_read(&dashtty_xmit_cnt)) > wake_up_interruptible(&dashtty_waitqueue); > @@ -603,7 +603,7 @@ static int __init dashtty_init(void) > complete(&dport->xmit_empty); > } > =20 > - setup_timer(&put_timer, dashtty_put_timer, 0); > + timer_setup(&put_timer, dashtty_put_timer, 0); > =20 > init_waitqueue_head(&dashtty_waitqueue); > dashtty_thread =3D kthread_create(put_data, NULL, "ttyDA"); > --=20 > 2.7.4 >=20 >=20 > --=20 > Kees Cook > Pixel Security --hTKW8p8tUZ/8vLMe Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEd80NauSabkiESfLYbAtpk944dnoFAlnl86MACgkQbAtpk944 dnq4Og/8DazzMsRD0kdPG5QREzTBIuMOQ+2aIeexf4d2t+OoFmACxUYu5BTgiUvu L8+UeYuSI+uNxRC/4rND1C71C6IFb12GWUxOQp0EfEqfnB73ryoGahLzpx3Kb8ME 6ypmlHZ8ho7htZsMigXSksGTD8sXShthNEki27ASjJFoc5KtN9EM0HeTthg3u4eU 4dL1ObP44ygxV/rXEODnVibTD4b9qSuK3Au3wqP9GmiZwteSMGOEJs2IpU15KEKA piIIKMAmK8H4OCFeVNSvR82yPa4tNHVL69X0omdVdXohlL7RpJ0GnWgZTWEytDsC dP5xL84URildg6AgWyxFrGUKgmGbcmxQD+9lgWNeY6ZNvttNzmJeUnP4PX+T+48h pUSvwiiy12izTkq061SoTUy9HbLj1JaLkkDQiuKdQZJYxolMJR15rzt3zKVPSD2w w0HhCe+itTB9ocZNF6U1AnpmkvQ8/i/AoG7V39acys9NWBlPAVr63nIEkhdaIkhW xXbS3EJ/g3nKXBB1K7P0JtyN7ryajLbs8Bd6JvxtRE9+LWRdLSACzEGWtkyKSgyk ih1Nve7EZHbZLqd3q2Nnq7agr1dBCFSUpc6AA/vjFuQ8VFz55wdKSmiuhrhEfeau 9vXcyzwXU9gWAhYhqgN4FkGrk/ZVqxR00bOs3M8QTv0szjHUznU= =bmwr -----END PGP SIGNATURE----- --hTKW8p8tUZ/8vLMe--