{"id":2221966,"url":"http://patchwork.ozlabs.org/api/patches/2221966/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/patch/20260410133739.1632-1-hechushiguitu666@gmail.com/","project":{"id":3,"url":"http://patchwork.ozlabs.org/api/projects/3/?format=json","name":"Linux MTD development","link_name":"linux-mtd","list_id":"linux-mtd.lists.infradead.org","list_email":"linux-mtd@lists.infradead.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260410133739.1632-1-hechushiguitu666@gmail.com>","list_archive_url":null,"date":"2026-04-10T13:37:34","name":"[1/2] mtd: mtdoops: replace simple_strtoul with kstrtouint","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"581382a706d5fe97e9f22f75217d364d3fe49f5e","submitter":{"id":92759,"url":"http://patchwork.ozlabs.org/api/people/92759/?format=json","name":"Haoyu Lu","email":"hechushiguitu666@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-mtd/patch/20260410133739.1632-1-hechushiguitu666@gmail.com/mbox/","series":[{"id":499461,"url":"http://patchwork.ozlabs.org/api/series/499461/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-mtd/list/?series=499461","date":"2026-04-10T13:37:34","name":"[1/2] mtd: mtdoops: replace simple_strtoul with kstrtouint","version":1,"mbox":"http://patchwork.ozlabs.org/series/499461/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2221966/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2221966/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=eiJJPiNz;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=kvRzAsE/;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsdDS307xz1yGb\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 23:38:31 +1000 (AEST)","from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wBC3q-0000000CKId-1AmQ;\n\tFri, 10 Apr 2026 13:38:14 +0000","from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wBC3n-0000000CKIH-1Qw8\n\tfor linux-mtd@lists.infradead.org;\n\tFri, 10 Apr 2026 13:38:12 +0000","by mail-pj1-x1033.google.com with SMTP id\n 98e67ed59e1d1-35d9923eec5so1283456a91.2\n        for <linux-mtd@lists.infradead.org>;\n Fri, 10 Apr 2026 06:38:10 -0700 (PDT)","from ZC-202510311500 ([123.139.41.116])\n        by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-35e4122314dsm3442353a91.6.2026.04.10.06.38.04\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Fri, 10 Apr 2026 06:38:09 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc\n\t:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=oALX3wnGB4Ilwuj1yF5V6URC73w65GLiygb5QBL0Ko4=; b=eiJJPiNzh1Q6ob\n\tSBXShFz6t1tpvxAB6yqKETE5n8X5R2Y7dqTFEzZ2E5jTpUonfPHqWdwsa0Tmx+Kocp7kKE7vc7xeQ\n\tEKfgFI6FYpr/XeH07JNA0gJa1PmmWx0lQS3i5W2bD8CMGakrYZa/L/RgesbbiKbxrzHygmZULZmsC\n\tWffnoTV3t11S5gJaqrpbG8MBkZq0sYx9GY8U5Rp8CbkClLp/RK/4mt6OBYMxUz6nil2LuE8DdIrHH\n\toGOSA2DxeTtSSs0Azmh4Ft7fX5DrGYl9V8AkdNRvp7rHhWJsCXz7+tS2CSVpZ9RoieKA1m5CrSUSf\n\tMOWPduoqS1gqWsUgOPJQ==;","v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1775828290; x=1776433090;\n darn=lists.infradead.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=15jM9BdqvKF6hlZCm8Bhf8yzyGOuJv3FUIc4LIiXT04=;\n        b=kvRzAsE/5xWx9CTBPC886XnVttm8L2yhAI3/KqFLLWVdmy6SrM5kHHxj/XtzNLsfnv\n         LKrMlotgLwlCfyUuPSPIF6hKBzao9VmD+lk2+/69KyVTekeo/pjTgvvJJVnkNovq0QNL\n         lso+IadvGZKHxWEq9IQvEJpH8BK1BgzkDnNCuAbunRAgKw+OfzubeubVMz6z2Rkda8je\n         3MpC0E6mKU6dHiy958mMjJa0laTS8nRI0yDhnJhZPOxx5CfayAJ/UO6x0Tn58gTh6JuC\n         QOhbqC0+Ui+tvg9sPN1IEH2Xtr+WW08WFACJXPlxgzgIBtUFFKrKJ+OmDHQToTyMl0sK\n         WNcQ=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1775828290; x=1776433090;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=15jM9BdqvKF6hlZCm8Bhf8yzyGOuJv3FUIc4LIiXT04=;\n        b=Txta+/NvaCsywnLZnauj8yEz4Xss/+H+abZl1+sDzO2WgfRddp7u3CSfp+1UNca4f6\n         1DVHrQt/etRV8uVX31CrRXz/S8fuIHz89khHb/LqKB+1bA2Qh22/jGn1IlsTZZoRdrZq\n         BiGv8kg3nP35ZTyWdSv6LdrjiQF30fPxJU/S4R+1+aaSW1arRYcuhz10TyWRBZwwnZ7x\n         0FHbDIoeyqVuOeRubB+HBK4RrbzTD5MyFvfHha+1qkwkLch/KS8ENHGyArKoQLsWMWev\n         eIWR23/vQXgxiyh2zr2epLKk4xu76Rg0n167r9sANwPsffkqQzUs2HujEUsmMr/7RgL6\n         yuyA==","X-Gm-Message-State":"AOJu0YyI1DepGyUsOeWeNp3kb/8iDL9dau9M4m+uYHFj7LEM9wdfhqMn\n\t7AZrc+OkhXnKnkx9vhRPGCGkH1atCvMKuFEmokm3I4iqEFFmroA7NuNW1drOaM04QUE=","X-Gm-Gg":"AeBDietD8GYfEJQakwp3/YK6gHH//tPoEuFCVDRfxMqcQCVFOoGoYdAAhIllpakHTxn\n\tRBf4JZSP050XiOTpkmams2t9CH49AgoWV5AsRcHQe9Vsm5fHnsFFQO0fwrajS/CdfTC/nDfdsKi\n\tYT6YY6tWxwjBck4b57TwjM0YoRCBcvpOEk6rAJlzdB1jm6Cxg9iGw0eHoMKzOIH37yUrHd6x23g\n\tCYjVNSjXPMV0N266VUosYoiei54zggc7SES7c4Hda1hihtSCVfdPjAY2y2HD8gaOKkV5RnX1Lrd\n\tcoeH+97SthrNP5n+PqtfA0L5FN2PSSpZUh2SDblaSggZstk5kSqGF50aZpc+MndnKz8z0j1vSCq\n\tQ7Ku6QcQEieEg8m0ewkj85whW6NbZhG7/3XivML8YG4wOvvzGci6c/qjsGgOZg+O6Vgg/sVXjOQ\n\tSoqeNHpQI46Wdx8cF2+zk+ChpjK/SLh4p1e23yK72ICssA7kpZ8n179fbcuGcbvYvP","X-Received":"by 2002:a17:90b:3d4f:b0:35d:a5cb:95c1 with SMTP id\n 98e67ed59e1d1-35e42837793mr3681773a91.23.1775828289900;\n        Fri, 10 Apr 2026 06:38:09 -0700 (PDT)","From":"Haoyu Lu <hechushiguitu666@gmail.com>","To":"Miquel Raynal <miquel.raynal@bootlin.com>,\n\tRichard Weinberger <richard@nod.at>,\n\tVignesh Raghavendra <vigneshr@ti.com>","Cc":"linux-mtd@lists.infradead.org,\n\tlinux-kernel@vger.kernel.org,\n\tHaoyu Lu <hechushiguitu666@gmail.com>","Subject":"[PATCH 1/2] mtd: mtdoops: replace simple_strtoul with kstrtouint","Date":"Fri, 10 Apr 2026 21:37:34 +0800","Message-ID":"<20260410133739.1632-1-hechushiguitu666@gmail.com>","X-Mailer":"git-send-email 2.53.0.windows.1","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20260410_063811_381695_35664DBE ","X-CRM114-Status":"GOOD (  12.99  )","X-Spam-Score":"-1.8 (-)","X-Spam-Report":"Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam.  The original\n message has been attached to this so you can view it or label\n similar future email.  If you have any questions, see\n the administrator of that system for details.\n Content preview:  Replace deprecated simple_strtoul with kstrtouint for\n better\n    error handling and type safety. The kstrtouint function provides stricter\n    validation, automatically rejecting inputs like \"123abc\" that sim [...]\n Content analysis details:   (-1.8 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\n -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/, no\n                             trust\n                             [2607:f8b0:4864:20:0:0:0:1033 listed in]\n                             [list.dnswl.org]\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in\n                             digit\n                             [hechushiguitu666(at)gmail.com]\n  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail\n provider\n                             [hechushiguitu666(at)gmail.com]","X-BeenThere":"linux-mtd@lists.infradead.org","X-Mailman-Version":"2.1.34","Precedence":"list","List-Id":"Linux MTD discussion mailing list <linux-mtd.lists.infradead.org>","List-Unsubscribe":"<http://lists.infradead.org/mailman/options/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=unsubscribe>","List-Archive":"<http://lists.infradead.org/pipermail/linux-mtd/>","List-Post":"<mailto:linux-mtd@lists.infradead.org>","List-Help":"<mailto:linux-mtd-request@lists.infradead.org?subject=help>","List-Subscribe":"<http://lists.infradead.org/mailman/listinfo/linux-mtd>,\n <mailto:linux-mtd-request@lists.infradead.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Sender":"\"linux-mtd\" <linux-mtd-bounces@lists.infradead.org>","Errors-To":"linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org"},"content":"Replace deprecated simple_strtoul with kstrtouint for better error\nhandling and type safety. The kstrtouint function provides stricter\nvalidation, automatically rejecting inputs like \"123abc\" that\nsimple_strtoul would partially accept.\n\nUsing kstrtouint avoids unsigned long to int conversion and is more\nappropriate for MTD device indices which are non-negative integers.\n\nSigned-off-by: Haoyu Lu <hechushiguitu666@gmail.com>\n---\n drivers/mtd/mtdoops.c | 9 +++------\n 1 file changed, 3 insertions(+), 6 deletions(-)\n\n--\n2.53.0.windows.1","diff":"diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c\nindex b88083751a0c..39df7ce8f55f 100644\n--- a/drivers/mtd/mtdoops.c\n+++ b/drivers/mtd/mtdoops.c\n@@ -403,8 +403,7 @@ static struct mtd_notifier mtdoops_notifier = {\n static int __init mtdoops_init(void)\n {\n \tstruct mtdoops_context *cxt = &oops_cxt;\n-\tint mtd_index;\n-\tchar *endp;\n+\tunsigned int mtd_index;\n\n \tif (strlen(mtddev) == 0) {\n \t\tpr_err(\"mtd device (mtddev=name/number) must be supplied\\n\");\n@@ -421,9 +420,9 @@ static int __init mtdoops_init(void)\n\n \t/* Setup the MTD device to use */\n \tcxt->mtd_index = -1;\n-\tmtd_index = simple_strtoul(mtddev, &endp, 0);\n-\tif (*endp == '\\0')\n+\tif (kstrtouint(mtddev, 0, &mtd_index) == 0) {\n \t\tcxt->mtd_index = mtd_index;\n+\t}\n\n \tcxt->oops_buf = vmalloc(record_size);\n \tif (!cxt->oops_buf)\n","prefixes":["1/2"]}