LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: "mirimmad@outlook.com" <mirimmad@outlook.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	open list <linux-kernel@vger.kernel.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	"open list:LINUX FOR POWERPC \(32-BIT AND 64-BIT\)"
	<linuxppc-dev@lists.ozlabs.org>, Immad Mir <mirimmad17@gmail.com>
Subject: Re: [PATCH] powerpc/powernv: use appropiate error code
Date: Fri, 1 Sep 2023 17:40:31 +0000	[thread overview]
Message-ID: <fdb8d83d-84ce-76d6-db9a-bb232492170c@csgroup.eu> (raw)
In-Reply-To: <CY5PR12MB64550ACC0B90FDD120D21E47C6E4A@CY5PR12MB6455.namprd12.prod.outlook.com>



Le 01/09/2023 à 19:19, mirimmad@outlook.com a écrit :
> [Vous ne recevez pas souvent de courriers de mirimmad@outlook.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
> 
> From: Immad Mir <mirimmad17@gmail.com>
> 
> -1 is not a valid error code. This patch replaces it with -EPERM.

Can you explain how it will work ?
In scom_debug_init() rc is built by oring the value returned by 
scom_debug_init_one().
What will be the result when oring some valid values with -EPERM ?
It was working well with -1 because when you or -1 with anything you get 
-1 as result. But with your change I don't think it will work.

Christophe

> 
> Signed-off-by: Immad Mir <mirimmad17@gmail.com>
> ---
>   arch/powerpc/platforms/powernv/opal-xscom.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c
> index 262cd6fac..ce4b089dd 100644
> --- a/arch/powerpc/platforms/powernv/opal-xscom.c
> +++ b/arch/powerpc/platforms/powernv/opal-xscom.c
> @@ -171,7 +171,7 @@ static int scom_debug_init_one(struct dentry *root, struct device_node *dn,
>          if (IS_ERR(dir)) {
>                  kfree(ent->path.data);
>                  kfree(ent);
> -               return -1;
> +               return -EPERM;
>          }
> 
>          debugfs_create_blob("devspec", 0400, dir, &ent->path);
> @@ -191,7 +191,7 @@ static int scom_debug_init(void)
> 
>          root = debugfs_create_dir("scom", arch_debugfs_dir);
>          if (IS_ERR(root))
> -               return -1;
> +               return -EPERM;
> 
>          rc = 0;
>          for_each_node_with_property(dn, "scom-controller") {
> --
> 2.40.0
> 

  reply	other threads:[~2023-09-01 17:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-01 17:19 [PATCH] powerpc/powernv: use appropiate error code mirimmad
2023-09-01 17:40 ` Christophe Leroy [this message]
2023-09-01 17:57   ` Immad Mir
2023-09-01 18:03   ` Immad Mir
2023-10-13 13:03     ` 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=fdb8d83d-84ce-76d6-db9a-bb232492170c@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mirimmad17@gmail.com \
    --cc=mirimmad@outlook.com \
    --cc=npiggin@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