From patchwork Sat Aug 26 15:25:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhumika Goyal X-Patchwork-Id: 9923553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C33776022E for ; Sat, 26 Aug 2017 15:26:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B341A285D3 for ; Sat, 26 Aug 2017 15:26:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A83CB285D9; Sat, 26 Aug 2017 15:26:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75E02285E0 for ; Sat, 26 Aug 2017 15:26:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751050AbdHZPZt (ORCPT ); Sat, 26 Aug 2017 11:25:49 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36050 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbdHZPZs (ORCPT ); Sat, 26 Aug 2017 11:25:48 -0400 Received: by mail-pf0-f194.google.com with SMTP id a2so1099354pfj.3; Sat, 26 Aug 2017 08:25:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=HBCue5KVBFHTTY4zWojsI+l4ogUZGSae4RsxVr3UeUs=; b=jkbLlOGa4k9wnDAZwwFR59uJvLhlThyDTqSpNGeoJNggRiiy9zuxL9+cnMG5s4MEfM oWLz9tZGIpheaL8R1PHW2TOsSF6v0ru3vrM06ZKrKKz6l6ElpncCNHy6iadjMyjvgtOu qSLEjEPR9n7hrsA7kxgbfBBd3XBmYxm5pEunySElQCh6xST4lJi0DcUMey8OB2q8//O/ 6ppWT1fNQGWFAsYE5VcLkRznVmrnz4tASbmWQWOELoU0GSeXiOUY58QO7br8lQD5vKVz JgqoYfVfuWszT83y8fb00r1g33TFeFOwtH4Z2oXCBtFaPRq0MiMV054kyS/0arT7v7LQ 1Vkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HBCue5KVBFHTTY4zWojsI+l4ogUZGSae4RsxVr3UeUs=; b=Ek0zdKiZuF2SretdROYRYiJ3ep5h8oYk7olqY9ErNPPoI2fkKngGtcVfYq8OMCw4+X mUuQM7OPV4dA6+/L7IB3Y3L9JKSrpdWn4Av/N4AwNDjtj9m0/YL7lbQn4rZ8FK0TVItk EgTi0i8unnOCxAERlrRhmpSxtbfTeSEs5yoUyuDFAlRqfpkrrlme5KGGxGVydtMDUU7W eOoOSEAhaBDld0PwvR4k0dyUeX3OnQEOMIJnCMYa6nC5U1//xVcfkPbfLb/VUmPzNaPn etFZqyxS9+Rt0gbBY3HX0pSZQQPj2m1i9cRptgjEin4Md63SQN1QnoWJBsXNh4B3DEi4 3J1A== X-Gm-Message-State: AHYfb5jf5JuVTjySHAVB+E8SzEgTCWp0x4RlPiDK5TUX9gJMd6bZicLz JGQcz9CbTKehNg== X-Received: by 10.84.130.9 with SMTP id 9mr2263738plc.388.1503761148112; Sat, 26 Aug 2017 08:25:48 -0700 (PDT) Received: from gmail.com ([117.196.107.182]) by smtp.gmail.com with ESMTPSA id t12sm17942383pfg.12.2017.08.26.08.25.43 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 26 Aug 2017 08:25:47 -0700 (PDT) Received: by gmail.com (sSMTP sendmail emulation); Sat, 26 Aug 2017 20:55:39 +0530 From: Bhumika Goyal To: julia.lawall@lip6.fr, paulus@samba.org, b.zolnierkie@samsung.com, linux@armlinux.org.uk, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Bhumika Goyal Subject: [PATCH] video: fbdev: make fb_videomode const Date: Sat, 26 Aug 2017 20:55:37 +0530 Message-Id: <1503761137-25263-1-git-send-email-bhumirks@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make these const as they are only passed to a const argument of the function fb_find_mode. Done using Coccinelle. @match disable optional_qualifier@ identifier s; @@ static struct fb_videomode s = {...}; @ref@ position p; identifier match.s; @@ s@p @good1@ identifier match.s; expression list[5] es; position ref.p; @@ fb_find_mode(es,&s@p,...) @bad depends on !good1@ position ref.p; identifier match.s; @@ s@p @depends on forall !bad disable optional_qualifier@ identifier match.s; @@ static + const struct fb_videomode s; Signed-off-by: Bhumika Goyal --- drivers/video/fbdev/aty/aty128fb.c | 2 +- drivers/video/fbdev/aty/atyfb_base.c | 2 +- drivers/video/fbdev/cyber2000fb.c | 2 +- drivers/video/fbdev/matrox/matroxfb_base.c | 2 +- drivers/video/fbdev/sm501fb.c | 2 +- drivers/video/fbdev/vermilion/vermilion.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/fbdev/aty/aty128fb.c b/drivers/video/fbdev/aty/aty128fb.c index ba64e26..db18474 100644 --- a/drivers/video/fbdev/aty/aty128fb.c +++ b/drivers/video/fbdev/aty/aty128fb.c @@ -116,7 +116,7 @@ /* default modedb mode */ /* 640x480, 60 Hz, Non-Interlaced (25.172 MHz dotclock) */ -static struct fb_videomode defaultmode = { +static const struct fb_videomode defaultmode = { .refresh = 60, .xres = 640, .yres = 480, diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index 1681d2d..f49efb2 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -274,7 +274,7 @@ static int aty_crtc_to_var(const struct crtc *crtc, 0, FB_VMODE_NONINTERLACED }; -static struct fb_videomode defmode = { +static const struct fb_videomode defmode = { /* 640x480 @ 60 Hz, 31.5 kHz hsync */ NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, 0, FB_VMODE_NONINTERLACED diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 99acf53..9a5751c 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -1336,7 +1336,7 @@ static void cyber2000fb_i2c_unregister(struct cfb_info *cfb) * These parameters give * 640x480, hsync 31.5kHz, vsync 60Hz */ -static struct fb_videomode cyber2000fb_default_mode = { +static const struct fb_videomode cyber2000fb_default_mode = { .refresh = 60, .xres = 640, .yres = 480, diff --git a/drivers/video/fbdev/matrox/matroxfb_base.c b/drivers/video/fbdev/matrox/matroxfb_base.c index 49ef48d..b9b284d7 100644 --- a/drivers/video/fbdev/matrox/matroxfb_base.c +++ b/drivers/video/fbdev/matrox/matroxfb_base.c @@ -1573,7 +1573,7 @@ struct video_board { NULL}}; #ifndef MODULE -static struct fb_videomode defaultmode = { +static const struct fb_videomode defaultmode = { /* 640x480 @ 60Hz, 31.5 kHz */ NULL, 60, 640, 480, 39721, 40, 24, 32, 11, 96, 2, 0, FB_VMODE_NONINTERLACED diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index 67e314f..076dd27 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -46,7 +46,7 @@ static char *fb_mode = "640x480-16@60"; static unsigned long default_bpp = 16; -static struct fb_videomode sm501_default_mode = { +static const struct fb_videomode sm501_default_mode = { .refresh = 60, .xres = 640, .yres = 480, diff --git a/drivers/video/fbdev/vermilion/vermilion.c b/drivers/video/fbdev/vermilion/vermilion.c index 3fde493..6f8d444 100644 --- a/drivers/video/fbdev/vermilion/vermilion.c +++ b/drivers/video/fbdev/vermilion/vermilion.c @@ -55,7 +55,7 @@ static struct fb_ops vmlfb_ops; static struct vml_sys *subsys = NULL; static char *vml_default_mode = "1024x768@60"; -static struct fb_videomode defaultmode = { +static const struct fb_videomode defaultmode = { NULL, 60, 1024, 768, 12896, 144, 24, 29, 3, 136, 6, 0, FB_VMODE_NONINTERLACED };