linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Michael Neuling <mikey@neuling.org>
Cc: Mathieu Malaterre <malat@debian.org>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v4 2/2] powerpc: Fix compile issue with force DAWR
Date: Tue, 28 May 2019 23:28:42 -0700	[thread overview]
Message-ID: <20190529062842.GA4787@infradead.org> (raw)
In-Reply-To: <20190529020115.14201-2-mikey@neuling.org>

> +config PPC_DAWR
> +	bool
> +	default n

"default n" is the default default.  No need to write this line.

> +++ b/arch/powerpc/kernel/dawr.c
> @@ -0,0 +1,100 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +//
> +// DAWR infrastructure
> +//
> +// Copyright 2019, Michael Neuling, IBM Corporation.

Normal top of file header should be /* */, //-style comments are only
for the actual SPDX heder line.

> +	/* Send error to user if they hypervisor won't allow us to write DAWR */
> +	if ((!dawr_force_enable) &&
> +	    (firmware_has_feature(FW_FEATURE_LPAR)) &&
> +	    (set_dawr(&null_brk) != H_SUCCESS))

None of the three inner brace sets here are required, and the code
becomes much easier to read without them.

> +		return -1;

What about returning a proper error code?

> +static int __init dawr_force_setup(void)
> +{
> +	dawr_force_enable = false;

This variable already is initialized to alse by default, so this line
is not required.

> +	if (PVR_VER(mfspr(SPRN_PVR)) == PVR_POWER9) {
> +		/* Turn DAWR off by default, but allow admin to turn it on */
> +		dawr_force_enable = false;

.. and neither is this one.

  reply	other threads:[~2019-05-29  6:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29  2:01 [PATCH v4 1/2] powerpc: silence a -Wcast-function-type warning in dawr_write_file_bool Michael Neuling
2019-05-29  2:01 ` [PATCH v4 2/2] powerpc: Fix compile issue with force DAWR Michael Neuling
2019-05-29  6:28   ` Christoph Hellwig [this message]
2019-06-04  3:00     ` Michael Neuling

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=20190529062842.GA4787@infradead.org \
    --to=hch@infradead.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=malat@debian.org \
    --cc=mikey@neuling.org \
    /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;
as well as URLs for NNTP newsgroup(s).