Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1706139
| From | Bhumika Goyal <bhumirks@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] ata: make ata_port_operations const |
| Date | 2017-08-08 10:20 +0200 |
| Message-ID | <uc7U6-5eH-21@gated-at.bofh.it> (permalink) |
| References | <ubNC1-714-5@gated-at.bofh.it> <ubRPl-1xo-33@gated-at.bofh.it> <ubS8H-1Uh-49@gated-at.bofh.it> <ubT4K-2E7-37@gated-at.bofh.it> <ubTeq-2HP-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Aug 7, 2017 at 10:04 PM, Joe Perches <joe@perches.com> 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. Thanks, Bhumika > Why leave unnecessary exposure for muckery?
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] ata: make ata_port_operations const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-07 12:40 +0200
Re: [PATCH] ata: make ata_port_operations const Tejun Heo <tj@kernel.org> - 2017-08-07 17:10 +0200
Re: [PATCH] ata: make ata_port_operations const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-07 17:30 +0200
Re: [PATCH] ata: make ata_port_operations const Tejun Heo <tj@kernel.org> - 2017-08-07 18:30 +0200
Re: [PATCH] ata: make ata_port_operations const Joe Perches <joe@perches.com> - 2017-08-07 18:40 +0200
Re: [PATCH] ata: make ata_port_operations const Bhumika Goyal <bhumirks@gmail.com> - 2017-08-08 10:20 +0200
csiph-web