[lkml]   [2017]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] ata: make ata_port_operations const
On Mon, Aug 7, 2017 at 10:04 PM, Joe Perches <> wrote:
> On Mon, 2017-08-07 at 09:29 -0700, Tejun Heo wrote:
>> Hello,
>> On Mon, Aug 07, 2017 at 08:54:21PM +0530, Bhumika Goyal wrote:
>> > I compiled the .o files and checked the size before and after
>> > compilation. After making the structure const, bytes should move from
>> > data to text segment of the memory and this is what happened. So, this
>> > is how I tested it.
>> Ah, I see, so the port_operations is never used directly. I'm not
>> sure whether it'd be a good idea to selectively pick these and makr
>> them const. Let's just leave them be.
> Why?
> Things that are never accessed as other than const should
> be const no?

I think it would be better to leave them as in most situations the
ata_port_operations structures cannot be const as they are only used
in the port_ops field of an ata_port_info structure and this field is
not const. Having two ata_port_operations const and others non-const
will cause code inconsistency.


> Why leave unnecessary exposure for muckery?

 \ /
  Last update: 2017-08-08 10:12    [W:0.029 / U:6.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site