Thread (15 messages) 15 messages, 6 authors, 2016-09-27

Re: [PATCH 00/26] constify local structures

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2016-09-12 13:57:49
Also in: alsa-devel, kernel-janitors, linux-acpi, linux-can, linux-media, linux-pm, linux-rdma, linux-renesas-soc, linux-scsi, linux-spi, linux-wireless, lkml, netdev, platform-driver-x86

On Mon, Sep 12, 2016 at 3:43 PM, Felipe Balbi
[off-list ref] wrote:
Jarkko Sakkinen [off-list ref] writes:
quoted
On Mon, Sep 12, 2016 at 10:54:07AM +0200, Julia Lawall wrote:
quoted
On Sun, 11 Sep 2016, Jarkko Sakkinen wrote:
quoted
On Sun, Sep 11, 2016 at 03:05:42PM +0200, Julia Lawall wrote:
quoted
Constify local structures.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
Just my two cents but:

1. You *can* use a static analysis too to find bugs or other issues.
2. However, you should manually do the commits and proper commit
   messages to subsystems based on your findings. And I generally think
   that if one contributes code one should also at least smoke test changes
   somehow.

I don't know if I'm alone with my opinion. I just think that one should
also do the analysis part and not blindly create and submit patches.
All of the patches are compile tested.  And the individual patches are
Compile-testing is not testing. If you are not able to test a commit,
you should explain why.
Dude, Julia has been doing semantic patching for years already and
nobody has raised any concerns so far. There's already an expectation
that Coccinelle *works* and Julia's sematic patches are sound.
+1
Besides, adding 'const' is something that causes virtually no functional
changes to the point that build-testing is really all you need. Any
problems caused by adding 'const' to a definition will be seen by build
errors or warnings.
Unfortunately in this particular case they could lead to failures that can only
be detected at runtime, when failing o write to a read-only piece of memory,
due to the casting away of the constness of the pointers later.
Fortunately this was detected during code review (doh...).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help