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


Groups > linux.kernel > #1684011

Re: [PATCH] kernel: cpu: hotplug: constify attribute_group structures.

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] kernel: cpu: hotplug: constify attribute_group structures.
Date Mon, 10 Jul 2017 09:40:01 +0200
Message-ID <u1Bst-236-1@gated-at.bofh.it> (permalink)
References <tXGAr-7t8-41@gated-at.bofh.it> <u1B97-1VK-3@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=tj8Lvj+zSME3XWPlEHH37CqmiZDL68zr70uif+N9+Bw=; b=uwPBNBkPofwN6GXsmUOY1yVku/87LffEkwn+LwlfFqE7SRekWuY3sWTluss2kQqsAI FoWmTR/UCXzB0VD8ro+8D9GPUGYp+eg4FEwsPo2wE0W18Fwm/wB1l9BwcPj1mylc4wva dRjTtSzKI1cwJRb1vYRAgf/Ez7SKFxNlI3LMHhvbhEWY5v3lwSmQs4AWzOHf01zE+ovk B3IW4Y7SCgNz3NXhxZBKH562TaC6hRng8hZof/QpOrOild2l4EDQkWDxS7RHME0mAq7B iFMpD/S6YUq5eGKp65PPFwijnlyotYvvpppvfcMmNabXy9ZaN9Q/nGpG0l9ul26tF818 s9yQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=tj8Lvj+zSME3XWPlEHH37CqmiZDL68zr70uif+N9+Bw=; b=oX22bDPgckn7k86TYCvqtgD7pv2MPretNbNbTbkpUOhOGcQRLY54imgj8bFZsAOm4j KQUtlBvFzHSWvuiG7KJlYME/lFdDJwG9I1CmVYmuwYbhpb35/afLD5gh9h4n89aRu2TY BKvnQIqpgQqEqqMpGgo1T8XorUEEgkHdUh/aPL7xKXSxhqBhdHNN2WardkpNExQy3/3h A3shQIXlBEp4PghjYEHrsxrh6b1Ee1eoRfn0cnX+7cD0zL8+Xgozl/IFS3kaWZUuCqMM 7/OYBzxO7yhhXf1aU9tQHWTBVeLu57SEhKXxstqwvYnar0X0t0/ZRK3K7gl9251w9XsZ aVcg==
X-Gm-Message-State AIVw110lEpsEeT4K/Q4g7NjWJj+48EYXPm8FmOh/caQEQniJV44GA7DZ 4Tf48jBOxLlPEKVhxEO0/Q==
X-Received by 10.84.218.204 with SMTP id g12mr16354198plm.153.1499671790208; Mon, 10 Jul 2017 00:29:50 -0700 (PDT)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1
MIME-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
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 34
Organization linux.* mail to news gateway
X-Original-Cc tglx@linutronix.de, mingo@kernel.org, anna-maria@linutronix.de, boris.ostrovsky@oracle.com, rcochran@linutronix.de, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
X-Original-Date Mon, 10 Jul 2017 12:59:27 +0530
X-Original-Message-ID <76ac9ca0-34cb-21d4-5cd6-9839a0d9a6eb@gmail.com>
X-Original-References <f9079e94e12b36d245e7adbf67d312bc5d0250c6.1498737970.git.arvind.yadav.cs@gmail.com> <20170710071442.pvfbfknsn5hmjqk4@linutronix.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1684011

Show key headers only | View raw


Hi Sebastian,


On Monday 10 July 2017 12:44 PM, Sebastian Andrzej Siewior wrote:
> On 2017-06-29 17:40:47 [+0530], Arvind Yadav wrote:
>> attribute_groups are not supposed to change at runtime. All functions
>> working with attribute_groups 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
>>    12582	  15361	     20	  27963	   6d3b	kernel/cpu.o
>>
>> File size After adding 'const':
>>     text	   data	    bss	    dec	    hex	filename
>>    12710	  15265	     20	  27995	   6d5b	kernel/cpu.o
> While there does not seem to be anything wrong with it, why did the file
> grow after the patch was applied?
Yes, You are right. I have added few more changes for some experiment.
Which is increasing size of file. Sorry for that, Correct comparison
is this.
File size before:
    text       data        bss        dec        hex    filename
   12909      15361         20      28290       6e82    kernel/cpu.o

File size After adding 'const':
    text       data        bss        dec        hex    filename
   12973      15297         20      28290       6e82    kernel/cpu.o

I will send updated patch.
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> Sebastian
Thanks
~arvind

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


Thread

Re: [PATCH] kernel: cpu: hotplug: constify attribute_group  structures. Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2017-07-10 09:20 +0200
  Re: [PATCH] kernel: cpu: hotplug: constify attribute_group  structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-10 09:40 +0200

csiph-web