All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aaron Tomlin <atomlin@redhat.com>
To: Petr Mladek <pmladek@suse.com>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	"Lameter, Christoph" <cl@linux.com>,
	Miroslav Benes <mbenes@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>,
	jeyu@kernel.org, linux-kernel <linux-kernel@vger.kernel.org>,
	linux-modules@vger.kernel.org, void@manifault.com,
	Aaron Tomlin <atomlin@atomlin.com>, Allen <allen.lkml@gmail.com>,
	Joe Perches <joe@perches.com>,
	Michal Suchanek <msuchanek@suse.de>,
	oleksandr@natalenko.name
Subject: Re: [PATCH v8 04/13] module: Move livepatch support to a separate file
Date: Fri, 25 Feb 2022 10:33:49 +0000	[thread overview]
Message-ID: <CANfR36ho7ccXWSU0+ZP3yN39WDgoKS-2WvVQdM1ONG_15Vk=8Q@mail.gmail.com> (raw)
In-Reply-To: <Yhiik2ledqAfGuN2@alley>

On Fri 2022-02-25 10:34 +0100, Petr Mladek wrote:
> This code include several other well hidden changes:
>
> --- del.p    2022-02-24 16:55:26.570054922 +0100
> +++ add.p    2022-02-24 16:56:04.766781394 +0100
> @@ -3,14 +3,14 @@
>   * section header table, section string table, and symtab section
>   * index from info to mod->klp_info.
>   */
> -static int copy_module_elf(struct module *mod, struct load_info *info)
> +int copy_module_elf(struct module *mod, struct load_info *info)
>  {
>      unsigned int size, symndx;
>      int ret;
>
>      size = sizeof(*mod->klp_info);
>      mod->klp_info = kmalloc(size, GFP_KERNEL);
> -    if (mod->klp_info == NULL)
> +    if (!mod->klp_info)
>          return -ENOMEM;
>
>      /* Elf header */
> @@ -20,7 +20,7 @@ static int copy_module_elf(struct module
>      /* Elf section header table */
>      size = sizeof(*info->sechdrs) * info->hdr->e_shnum;
>      mod->klp_info->sechdrs = kmemdup(info->sechdrs, size, GFP_KERNEL);
> -    if (mod->klp_info->sechdrs == NULL) {
> +    if (!mod->klp_info->sechdrs) {
>          ret = -ENOMEM;
>          goto free_info;
>      }
> @@ -28,7 +28,7 @@ static int copy_module_elf(struct module
>      /* Elf section name string table */
>      size = info->sechdrs[info->hdr->e_shstrndx].sh_size;
>      mod->klp_info->secstrings = kmemdup(info->secstrings, size, GFP_KERNEL);
> -    if (mod->klp_info->secstrings == NULL) {
> +    if (!mod->klp_info->secstrings) {
>          ret = -ENOMEM;
>          goto free_sechdrs;
>      }
> @@ -43,8 +43,7 @@ static int copy_module_elf(struct module
>       * to core_kallsyms.symtab since the copy of the symtab in module
>       * init memory is freed at the end of do_init_module().
>       */
> -    mod->klp_info->sechdrs[symndx].sh_addr = \
> -        (unsigned long) mod->core_kallsyms.symtab;
> +    mod->klp_info->sechdrs[symndx].sh_addr = (unsigned long)mod->core_kallsyms.symtab;
>
>      return 0;
>
>
> Please do not do these small coding style changes. It complicates the
> review and increases the risk of regressions. Different people
> have different preferences. Just imagine that every half a year
> someone update style of a code by his personal preferences. The
> real changes will then get lost in a lot of noise.
>
> Coding style changes might be acceptable only when the code is
> reworked or when it significantly improves readability.
>
>
> That said. I reviewed and tested this patch and did not find any
> problem. Feel free to use:
>
> Reviewed-by: Petr Mladek <pmladek@suse.com>
> Tested-by: Petr Mladek <pmladek@suse.com>
>
> Please, take the above as an advice for your future work.

Hi Petr,

Firstly, thank you for your feedback. Fair enough and noted.


Kind regards,

-- 
Aaron Tomlin


  reply	other threads:[~2022-02-25 10:34 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 14:12 [PATCH v8 00/13] module: core code clean up Aaron Tomlin
2022-02-22 14:12 ` [PATCH v8 01/13] module: Move all into module/ Aaron Tomlin
2022-02-22 17:58   ` Christophe Leroy
2022-02-22 20:00   ` Allen
2022-02-22 14:12 ` [PATCH v8 02/13] module: Simple refactor in preparation for split Aaron Tomlin
2022-02-22 17:58   ` Christophe Leroy
2022-02-22 14:12 ` [PATCH v8 03/13] module: Make internal.h and decompress.c more compliant Aaron Tomlin
2022-02-22 14:12 ` [PATCH v8 04/13] module: Move livepatch support to a separate file Aaron Tomlin
2022-02-22 17:58   ` Christophe Leroy
2022-02-25  9:34   ` Petr Mladek
2022-02-25 10:33     ` Aaron Tomlin [this message]
2022-02-25 16:49     ` Christophe Leroy
2022-02-28 10:56       ` Petr Mladek
2022-02-28 11:46         ` Christophe Leroy
2022-02-28 13:05           ` Petr Mladek
2022-02-22 14:12 ` [PATCH v8 05/13] module: Move latched RB-tree " Aaron Tomlin
2022-02-22 17:58   ` Christophe Leroy
2022-02-22 14:12 ` [PATCH v8 06/13] module: Move strict rwx " Aaron Tomlin
2022-02-22 17:59   ` Christophe Leroy
2022-02-22 14:12 ` [PATCH v8 07/13] module: Move extra signature support out of core code Aaron Tomlin
2022-02-22 17:59   ` Christophe Leroy
2022-02-22 14:12 ` [PATCH v8 08/13] module: Move kmemleak support to a separate file Aaron Tomlin
2022-02-22 17:59   ` Christophe Leroy
2022-02-22 14:12 ` [PATCH v8 09/13] module: Move kallsyms support into " Aaron Tomlin
2022-02-22 17:59   ` Christophe Leroy
2022-02-25  9:15   ` Petr Mladek
2022-02-25  9:27     ` Christophe Leroy
2022-02-25 10:15       ` Petr Mladek
2022-02-25 10:27         ` Aaron Tomlin
2022-02-25 12:21           ` Aaron Tomlin
2022-02-25 12:57             ` Christophe Leroy
2022-02-26 20:27               ` Luis Chamberlain
2022-02-28  9:02                 ` Christophe Leroy
2022-02-28  9:31                   ` Aaron Tomlin
2022-02-28  9:33                     ` Christophe Leroy
2022-02-22 14:13 ` [PATCH v8 10/13] module: Move procfs " Aaron Tomlin
2022-02-22 17:59   ` Christophe Leroy
2022-02-22 14:13 ` [PATCH v8 11/13] module: Move sysfs " Aaron Tomlin
2022-02-22 17:59   ` Christophe Leroy
2022-02-22 14:13 ` [PATCH v8 12/13] module: Move kdb_modules list out of core code Aaron Tomlin
2022-02-22 18:05   ` Christophe Leroy
2022-02-22 14:13 ` [PATCH v8 13/13] module: Move version support into a separate file Aaron Tomlin
2022-02-22 18:06   ` Christophe Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANfR36ho7ccXWSU0+ZP3yN39WDgoKS-2WvVQdM1ONG_15Vk=8Q@mail.gmail.com' \
    --to=atomlin@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=allen.lkml@gmail.com \
    --cc=atomlin@atomlin.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=cl@linux.com \
    --cc=jeyu@kernel.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=mcgrof@kernel.org \
    --cc=msuchanek@suse.de \
    --cc=oleksandr@natalenko.name \
    --cc=pmladek@suse.com \
    --cc=void@manifault.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.