Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1690973

[PATCH] video: fbdev: uvesafb: constify attribute_group structures.

Path csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod
From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] video: fbdev: uvesafb: constify attribute_group structures.
Date Wed, 19 Jul 2017 07:20:01 +0200
Message-ID <u4PyV-3WT-5@gated-at.bofh.it> (permalink)
X-Original-To spock@gentoo.org, b.zolnierkie@samsung.com
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=utqkLX82yQXaQ+dRtyvOjSZeSruX0IuY/WQi2oySeoY=; b=mLf5NW8HvEsK6YrODHH+SYsjTmSdShwWEucfyIMcMRvnA10hwE0FYJEu8OXs09AI5J pJge1+tGiIR5e6gvfMdlCkusw6QIpcagVhNnF4f+bRZxbfzMTrz25oDPoPlzmTb0jwyZ bjm/QDdwO5arXQe7w5g1Sn5SXLp/uEqCasefZJoskCmkHhWfUhoJiFMmhcdiMRyoomzh 5EXhXEA0p3s/e+zuFTpZICfneGLxPcEsH+S0NpCCkg/fqviA98CKbzejj5apZ1Cta0Tb IYPWha0pa+LI7l40VzhVspXGtkuPFEKcl9ocS37OZba9rrPrpNw54M0/+mInuNM/iW5h njRQ==
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=utqkLX82yQXaQ+dRtyvOjSZeSruX0IuY/WQi2oySeoY=; b=kOTaV9hltqc+uZUsZWZQzMYFPJEZB/XAwfFHpiPI0mS7higI3pB/3TyoxjbJ6vlfMy 3x1usyBSQWT372r4y2Nb9BCSSHFjjqi6JqFFiDohLl9h8MoYzh8SEPKKMTBVgXr/tQUa ZOIcDYwQE1oKuNtY4OOGGRyjQ63NJXK8bzk2zNGtkxDGJ81ChY/l58YHYS/fmVdaljzr o/XdVkeFM8/GmHpcb23XkHPSggtHkAvOY2EbNhKnhCfOfUjx/8Xw5jta2198yii9BQ8k Wo7J8YgbD62wyd73GbZvw7Y5mECx8+iKVcip5QLvtqYAHJMIfUQy99B/upr2XoCGA4yA bVAw==
X-Gm-Message-State AIVw112D1aaROzSYkF4ysnB8D6TTnOGy9sQnVKpS+EtZQFWM9gNiCQfD dU1ll6o0S6cQxmE7kHI=
X-Received by 10.98.87.93 with SMTP id l90mr1220853pfb.3.1500441454095; Tue, 18 Jul 2017 22:17:34 -0700 (PDT)
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 32
Organization linux.* mail to news gateway
X-Original-Cc linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Wed, 19 Jul 2017 10:46:55 +0530
X-Original-Message-ID <aa3e89c4a81699a5e7799f9c20cc7a123e2fce37.1500441256.git.arvind.yadav.cs@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1690973

Show key headers only | View raw


attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
  15426	   4952	    187	  20565	   5055	drivers/video/fbdev/uvesafb.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  15490	   4888	    187	  20565	   5055	drivers/video/fbdev/uvesafb.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/video/fbdev/uvesafb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index dc0e8d9..ad05d25f 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -1666,7 +1666,7 @@ static DEVICE_ATTR(nocrtc, S_IRUGO | S_IWUSR, uvesafb_show_nocrtc,
 	NULL,
 };
 
-static struct attribute_group uvesafb_dev_attgrp = {
+static const struct attribute_group uvesafb_dev_attgrp = {
 	.name = NULL,
 	.attrs = uvesafb_dev_attrs,
 };
-- 
1.9.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] video: fbdev: uvesafb: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-19 07:20 +0200

csiph-web