Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932869AbbLNXxl (ORCPT ); Mon, 14 Dec 2015 18:53:41 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:36295 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932453AbbLNXxk (ORCPT ); Mon, 14 Dec 2015 18:53:40 -0500 Date: Tue, 15 Dec 2015 01:53:36 +0200 From: Aya Mahfouz To: Greg Kroah-Hartman , Jiri Slaby , Julia Lawall , linux-kernel@vger.kernel.org Subject: [PATCH] tty: constify tty_port_operations structs Message-ID: <20151214235336.GA6202@waves> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1601 Lines: 51 Constifies tty_port_operations structures in the tty driver since they are not modified after their initialization. Detected and found using Coccinelle. Suggested-by: Julia Lawall Signed-off-by: Aya Mahfouz --- drivers/tty/goldfish.c | 2 +- drivers/tty/mxser.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c index 0f82c0b..752232c 100644 --- a/drivers/tty/goldfish.c +++ b/drivers/tty/goldfish.c @@ -162,7 +162,7 @@ static int goldfish_tty_console_setup(struct console *co, char *options) return 0; } -static struct tty_port_operations goldfish_port_ops = { +static const struct tty_port_operations goldfish_port_ops = { .activate = goldfish_tty_activate, .shutdown = goldfish_tty_shutdown }; diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 4c4a236..29851a4 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -2337,7 +2337,7 @@ static const struct tty_operations mxser_ops = { .get_icount = mxser_get_icount, }; -static struct tty_port_operations mxser_port_ops = { +static const struct tty_port_operations mxser_port_ops = { .carrier_raised = mxser_carrier_raised, .dtr_rts = mxser_dtr_rts, .activate = mxser_activate, -- 2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/