From: Dan Carpenter <dan.carpenter@oracle.com>
To: "John B. Wyatt IV" <jbwyatt4@gmail.com>
Cc: outreachy-kernel@googlegroups.com,
Rob Springer <rspringer@google.com>,
Todd Poynor <toddpoynor@google.com>,
Ben Chan <benchan@chromium.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] staging: gasket: Fix 4 over 80 char warnings
Date: Fri, 3 Apr 2020 11:32:25 +0300 [thread overview]
Message-ID: <20200403083225.GX2001@kadam> (raw)
In-Reply-To: <20200402053617.826678-2-jbwyatt4@gmail.com>
On Wed, Apr 01, 2020 at 10:36:16PM -0700, John B. Wyatt IV wrote:
> Fix 4 over 80 char warnings by caching long enum values into local
> variables.
>
> All enums are only used once inside each function (and once inside
> the entire file).
>
> Reported by checkpatch.
>
> Signed-off-by: John B. Wyatt IV <jbwyatt4@gmail.com>
> ---
> drivers/staging/gasket/apex_driver.c | 13 +++++++++----
> 1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c
> index 46199c8ca441..f48209ec7d24 100644
> --- a/drivers/staging/gasket/apex_driver.c
> +++ b/drivers/staging/gasket/apex_driver.c
> @@ -253,6 +253,8 @@ static int apex_get_status(struct gasket_dev *gasket_dev)
> /* Enter GCB reset state. */
> static int apex_enter_reset(struct gasket_dev *gasket_dev)
> {
> + int idle_gen_reg = APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER;
> +
Sorry, but I also hate these where we have a one time use temporary
variable to get around the 80 character rule. Generally, avoid pointless
indirection. The original code is better.
regards,
dan carpenter
next prev parent reply other threads:[~2020-04-03 8:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-02 5:36 [PATCH 0/2] staging: gasket: Fix style issues in apex_driver.c John B. Wyatt IV
2020-04-02 5:36 ` [PATCH 1/2] staging: gasket: Fix 4 over 80 char warnings John B. Wyatt IV
2020-04-02 5:54 ` Joe Perches
2020-04-03 7:24 ` Greg Kroah-Hartman
2020-04-03 8:32 ` Dan Carpenter [this message]
2020-04-02 5:36 ` [PATCH 2/2] staging: gasket: Fix comment 75 character limit warning John B. Wyatt IV
2020-04-03 7:25 ` Greg Kroah-Hartman
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=20200403083225.GX2001@kadam \
--to=dan.carpenter@oracle.com \
--cc=benchan@chromium.org \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=jbwyatt4@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=outreachy-kernel@googlegroups.com \
--cc=rspringer@google.com \
--cc=toddpoynor@google.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.