From: Fernando Fernandez Mancera <fmancera@suse.de>
To: linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org, chleroy@kernel.org,
npiggin@gmail.com, mpe@ellerman.id.au, maddy@linux.ibm.com,
gregkh@linuxfoundation.org, arnd@arndb.de,
sjitindarsingh@gmail.com,
Fernando Fernandez Mancera <fmancera@suse.de>
Subject: [PATCH] char: powernv-op-panel: remove unnecessary reset of position pointer
Date: Fri, 17 Jul 2026 11:45:19 +0200 [thread overview]
Message-ID: <20260717094519.20656-1-fmancera@suse.de> (raw)
The position pointer is only advanced if the return value of the write
operation is positive at ksys_write(). Therefore no need to manually
reset it when doing error handling.
Assisted-by: coccinelle # to find it
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
---
Note: i found this while fixing the same pattern in ipv6/ipv4 sysctl
proc handlers. This is not my area of expertise but I thought it was
worth contributing it :-)
---
drivers/char/powernv-op-panel.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/char/powernv-op-panel.c b/drivers/char/powernv-op-panel.c
index 63175b765c90..a98acb199805 100644
--- a/drivers/char/powernv-op-panel.c
+++ b/drivers/char/powernv-op-panel.c
@@ -89,7 +89,6 @@ static int __op_panel_update_display(void)
static ssize_t oppanel_write(struct file *filp, const char __user *userbuf,
size_t len, loff_t *f_pos)
{
- loff_t f_pos_prev = *f_pos;
ssize_t ret;
int rc;
@@ -105,7 +104,6 @@ static ssize_t oppanel_write(struct file *filp, const char __user *userbuf,
if (rc != OPAL_SUCCESS) {
pr_err_ratelimited("OPAL call failed to write to op panel display [rc=%d]\n",
rc);
- *f_pos = f_pos_prev;
return -EIO;
}
}
--
2.55.0
reply other threads:[~2026-07-17 12:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260717094519.20656-1-fmancera@suse.de \
--to=fmancera@suse.de \
--cc=arnd@arndb.de \
--cc=chleroy@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=sjitindarsingh@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