public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Shreenidhi Shedi <yesshedi@gmail.com>
Cc: dhowells@redhat.com, dwmw2@infradead.org,
	gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org,
	sshedi@vmware.com
Subject: Re: [ PATCH v4 2/6] sign-file: move file signing logic to its own function
Date: Tue, 14 Mar 2023 16:10:23 +0000	[thread overview]
Message-ID: <3754750.1678810223@warthog.procyon.org.uk> (raw)
In-Reply-To: <20230221170804.3267242-2-sshedi@vmware.com>

Shreenidhi Shedi <yesshedi@gmail.com> wrote:

> Keep the main function bare minimal and do less in main function.

I would recommend repeating the subject here and expanding on it.  You also
need to say what the goal is.

> +	char *hash_algo = opts->hash_algo;
> +	char *dest_name = opts->dest_name;
> +	char *private_key_name = opts->private_key_name;
> +	char *raw_sig_name = opts->raw_sig_name;
> +	char *x509_name = opts->x509_name;
> +	char *module_name = opts->module_name;

I suggest just using opts-> everywhere rather than copying everything out into
stack variables.

> +	OpenSSL_add_all_algorithms();
> +	ERR_load_crypto_strings();
> +	ERR_clear_error();

That would seem like it belongs in main().

> +	struct cmd_opts opts = {0};

It would be better to do "struct cmd_opts opts = {};"

David


  reply	other threads:[~2023-03-14 16:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 17:07 [ PATCH v4 1/6] sign-file: refactor argument parsing logic Shreenidhi Shedi
2023-02-21 17:08 ` [ PATCH v4 2/6] sign-file: move file signing logic to its own function Shreenidhi Shedi
2023-03-14 16:10   ` David Howells [this message]
2023-02-21 17:08 ` [ PATCH v4 3/6] sign-file: add support sign modules in bulk Shreenidhi Shedi
2023-03-14 16:13   ` David Howells
2023-02-21 17:08 ` [ PATCH v4 4/6] sign-file: cosmetic fix Shreenidhi Shedi
2023-03-14 16:14   ` David Howells
2023-02-21 17:08 ` [ PATCH v4 5/6] sign-file: use const with a global string constant Shreenidhi Shedi
2023-03-14 16:15   ` David Howells
2023-02-21 17:08 ` [ PATCH v4 6/6] sign-file: improve help message Shreenidhi Shedi
2023-03-14 16:20   ` David Howells
2023-02-21 17:18 ` [ PATCH v4 1/6] sign-file: refactor argument parsing logic Greg KH
2023-03-14 16:02 ` David Howells
2023-03-14 16:21 ` David Howells
2023-03-20 15:47   ` Shreenidhi Shedi

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=3754750.1678810223@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=dwmw2@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sshedi@vmware.com \
    --cc=yesshedi@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox