From nobody Thu Oct 9 02:54:18 2025 Received: from outbound.pv.icloud.com (p-west1-cluster6-host10-snip4-10.eps.apple.com [57.103.67.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A1E128F51C for ; Fri, 20 Jun 2025 14:41:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.67.103 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750430466; cv=none; b=DgE/oaPrVpJu0E4q2Tseh+K64fmWEZHCjl1tGZMb+fgKjCzO1aj83FymJS6oOPGgvKuoeS7d37AhS77LbkBCJtYE1iBCMncwoyOoWxXpzBoE2XwjiPsTH6JJHatTaTL44WeybxJxxQMc6bp+4Ig4H6YlcfOAOKHaok6qgvWxiUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750430466; c=relaxed/simple; bh=LcjSt/nGvmhhZqhV1lbIlUfcRdmY1AVKoDE4Y0rZ778=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YDOU3SiVrfwC/JggIaivIllnenc0O1ahPTzjytgwGUgk4Ofu3sUsdHTU2ib4t/58gQ2I//ago1pK++lP/JQNTMs3JcK8Tt9lNgqbNpD/FD2BbPvFiIxnAMTzotSC1/i2ngWhOtjmiq8hWAVrOzIinGKyOrlgNR/A7EatgaVW9aU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=eEpw3Row; arc=none smtp.client-ip=57.103.67.103 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="eEpw3Row" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=5/FS7i6cquSDZ1MGYBD/5C+ATw4jDtBL80jA52quSRE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=eEpw3RowqRWvDRng5yO8Tk9PhFhD8bC2arA5GNrtExPIbDshOG2dIdFOMLBAQ9rUI Xxqsrl4stmrvAQr0LZ7RwpAdSqxb3f0C1C3fM3tEsbZfqX3Bez+tqUwMf57fgagQsw eXhSKELBApjaTVM3FNnf0xuqX2nvF3S3L2lsh8Ij+PiCXPKclb7mdxLKVL2q3zZoIg 0QIzWcvopCJwGVGIWzvV5KcNTy8YiVx9o4ZYW5a83qG+skZZpgwQHpgelnp2EtXz/m Ocbio96hdBb0TLYICWc0UBG6Jv1tAUYiQ2lCNOjaylmVLmKUIqzVPY1TvwNY9gsCCd i+1VfRt4nCq2Q== Received: from outbound.pv.icloud.com (localhost [127.0.0.1]) by outbound.pv.icloud.com (Postfix) with ESMTPS id 7D4011803BE5; Fri, 20 Jun 2025 14:41:03 +0000 (UTC) Received: from [192.168.1.26] (pv-asmtp-me-k8s.p00.prod.me.com [17.56.9.36]) by outbound.pv.icloud.com (Postfix) with ESMTPSA id AEF97180B565; Fri, 20 Jun 2025 14:35:44 +0000 (UTC) From: Zijun Hu Date: Fri, 20 Jun 2025 22:35:18 +0800 Subject: [PATCH 1/3] char: misc: Remove redundant forward declarations Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250620-fix_mischar-v1-1-6c2716bbf1fa@oss.qualcomm.com> References: <20250620-fix_mischar-v1-0-6c2716bbf1fa@oss.qualcomm.com> In-Reply-To: <20250620-fix_mischar-v1-0-6c2716bbf1fa@oss.qualcomm.com> To: Arnd Bergmann , Greg Kroah-Hartman Cc: Zijun Hu , linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-GUID: XDqqMO63qnK1jeRaF1pOA8Zw7036sNkg X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIwMDEwNCBTYWx0ZWRfX0pe9SC4zM4yE 16neVigBTlcuOF/+0SDZzHhkTKpndT75MNgf+UDT8kKBWUL9KPdEmzKyH2glQXm3r4D4acvfYxR WxZgZJhT0WOFNOSoCogihBp13jC7sj5WDsiJfqb6Sy+mjZL9lA+E0JqVP1Zl61oud/JAirWRtuk fjtA/VS3vmUotOxj3fAy/vWk/buRSN7ykzqnvxKzaJ+hgIkjW/detFIk0vBcIJycOXTMXmnhRoP 712tD7B9peYz1/Mjozz85EQJcMruSP/Q1zshpE2Aefa1NQ5QGIaMDQrAkKKpfVa1rEm9D5GOc= X-Proofpoint-ORIG-GUID: XDqqMO63qnK1jeRaF1pOA8Zw7036sNkg X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-20_05,2025-06-20_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506060001 definitions=main-2506200104 From: Zijun Hu Header miscdevice.h includes linux/device.h which has definations for below two forward declarations directly or indirectly: struct device; struct attribute_group; Remove these redundant forward declarations from miscdevice.h Signed-off-by: Zijun Hu --- include/linux/miscdevice.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 69e110c2b86a9b16c1637778a25e1eebb3fd0111..3e6deb00fc8535a7571f85489c7= 4979e18385bad 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -73,9 +73,6 @@ #define RFKILL_MINOR 242 #define MISC_DYNAMIC_MINOR 255 =20 -struct device; -struct attribute_group; - struct miscdevice { int minor; const char *name; --=20 2.34.1 From nobody Thu Oct 9 02:54:18 2025 Received: from outbound.pv.icloud.com (p-west1-cluster6-host8-snip4-10.eps.apple.com [57.103.67.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBB3928DF1F for ; Fri, 20 Jun 2025 14:41:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.67.123 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750430469; cv=none; b=bmHHIVtUyZXx3lEjx48vQp035s3pUbUG7l71TLiOAWStTDebZXvoqzwsWRy8sptZr/gnL7JgpDRWYcD4aZYBLpp+Nv7TaG9GOtpHlZ+bPFpNd2ZEh7r6JzyK5cuI8mHZxopRlRnBlDVnPmfsSfdUot6eoXxd2ovxRVtHzeTm7Ng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750430469; c=relaxed/simple; bh=X03KB+RH5mwo070dIJFHE6kF45MlVsqH8EHPa6qxoQw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=p55sqw6Ex5ZGKphOrfl8BEzgCiSXzYC/YBteZZnwLMSG1aveTNBCvHZlOI3qTJK+tXwnT41Ofc0GsicHgiSkOSEV5WQe0CaYH1fPiSc4QB5tiqLvzPbg/ASIfDgX8VpVuHEx9An3pQdE5O6cVfBUHI20qkC9m6ajy6A0OXpx7Mg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=JQHsND3m; arc=none smtp.client-ip=57.103.67.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="JQHsND3m" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=dNEEdxNrBt65g5PqF4MlzGBFoBQ175abVJZVvz5pNUo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=JQHsND3maG3g3pfWnRAh471jeIbGQQP/0cKIOtMDfF5A3rP1j0CK9udTMYmwQfLEL Il8cSASlr2yB+qlB1cnPCN5GLrzj5VijaGdcwmYDEZLZ3m6MxMd1HI+ayYxA52+fnh vt5uar7JelUQwfbkj64nb0zzkL49hhza8IZrInR4FUMwnTMDCvhmQ4VxAbqX0EQU4F tWKBCDTYtniqg9ou/XwGW3y6fVrfvJO5aTYJVl6/4tBKCT2GSlFpIt4NXVFgmLHXmu RbdqIyNcXirQjC/GaGJWX/Q+neYc8R+1W/zsEnKMGHux9K8/UGvtYt04j1UumezkzI OyahzExOh4ugw== Received: from outbound.pv.icloud.com (localhost [127.0.0.1]) by outbound.pv.icloud.com (Postfix) with ESMTPS id 7F25D1804DF3; Fri, 20 Jun 2025 14:41:05 +0000 (UTC) Received: from [192.168.1.26] (pv-asmtp-me-k8s.p00.prod.me.com [17.56.9.36]) by outbound.pv.icloud.com (Postfix) with ESMTPSA id 0FF96180BD4B; Fri, 20 Jun 2025 14:35:45 +0000 (UTC) From: Zijun Hu Date: Fri, 20 Jun 2025 22:35:19 +0800 Subject: [PATCH 2/3] char: misc: Rename a local variable in misc_init() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250620-fix_mischar-v1-2-6c2716bbf1fa@oss.qualcomm.com> References: <20250620-fix_mischar-v1-0-6c2716bbf1fa@oss.qualcomm.com> In-Reply-To: <20250620-fix_mischar-v1-0-6c2716bbf1fa@oss.qualcomm.com> To: Arnd Bergmann , Greg Kroah-Hartman Cc: Zijun Hu , linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIwMDEwNCBTYWx0ZWRfXzrvUNaQRgKoz hc85ONLL6JNxAK9fr99oW5QS/yKUjryFQ5wXT/GlTBWQXg2A/XjZ73htXTwu8F5zDbu9ZSL9rdt CvC/Nc3AkIO67J3dMKJ3uGzwPiDogDZQUNxEY0Vxznbza2cbuHn0zVuhg8j/fwy8mSQ8tCJ29Fh aSjlMQUpoBdqlsJTFdPK+A5skzyB0xEfojcxmZ/3zLcmt+2LXZILRYZfRDRqVuvTWG65TnUTD71 tvyAFoXfMgo2TIgWm5RZccq1k7lqekks9atf1LZyswWV54tHBX13bO2wimGlWGVUlprGLv4lI= X-Proofpoint-ORIG-GUID: vo3e49z3c53qg19k-gV6eIW6WVASQ1th X-Proofpoint-GUID: vo3e49z3c53qg19k-gV6eIW6WVASQ1th X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-20_05,2025-06-20_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 phishscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506060001 definitions=main-2506200104 From: Zijun Hu Local variable @ret is not used for return value in misc_init(). Give it a different name @pde. Signed-off-by: Zijun Hu --- drivers/char/misc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/char/misc.c b/drivers/char/misc.c index d5accc10a110098f7090dd0f900bc5fae5f75f74..f5ef8c175adb559e67dfe905d43= d1404b249cc9e 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -289,9 +289,9 @@ EXPORT_SYMBOL(misc_deregister); static int __init misc_init(void) { int err; - struct proc_dir_entry *ret; + struct proc_dir_entry *pde; =20 - ret =3D proc_create_seq("misc", 0, NULL, &misc_seq_ops); + pde =3D proc_create_seq("misc", 0, NULL, &misc_seq_ops); err =3D class_register(&misc_class); if (err) goto fail_remove; @@ -305,7 +305,7 @@ static int __init misc_init(void) pr_err("unable to get major %d for misc devices\n", MISC_MAJOR); class_unregister(&misc_class); fail_remove: - if (ret) + if (pde) remove_proc_entry("misc", NULL); return err; } --=20 2.34.1 From nobody Thu Oct 9 02:54:18 2025 Received: from outbound.pv.icloud.com (p-west1-cluster6-host10-snip4-1.eps.apple.com [57.103.67.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3148B28E56B for ; Fri, 20 Jun 2025 14:41:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=57.103.67.94 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750430470; cv=none; b=kpNku7jD8uDxh+WNpM6oSyBoTZvox+3Ye+pETsw3X27KLEbgfmsLf+ThVL8GfL2FTylayI0vL/OVQonx2ZgxW+jfDr4lypkJ9nt94il/HAqxkYoVG9R9iWiU95VO2b0EmydbIJtF2DgO0B9PX1NydR1HFLp2+H8Ijtign4/mMBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750430470; c=relaxed/simple; bh=AQ13IoXC4m9v9P31XZtq4ZiBTRTh4WHYPGE7vsqSEIg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fEmSOyW0vEtsgZjqTYqK89vBOaaqpCF/z99AyqHnLC8ZnULZyxYKo3L/d0pG7p+aSEqv0qLS39FFPDIVvdPvIYxUj85rHfWA7NlQb6YVY9mszSW7gzU3b9fO0YTDyOssI4jrSrzDy8lpQfyMNipzRfD8/nbGXb7XTxA/R4d87FI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com; spf=pass smtp.mailfrom=icloud.com; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b=CAF35you; arc=none smtp.client-ip=57.103.67.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=icloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=icloud.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=icloud.com header.i=@icloud.com header.b="CAF35you" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=icloud.com; s=1a1hai; bh=M13rf6LOK4dwBAi3S0xkl4YinwqU742jKuz44rSZnmg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:x-icloud-hme; b=CAF35your7xlkBXvDPWSMT06Cf20vP1pKOKZKtIekrGDC6UB/knIUsXJX2k5PUfUr aL/dT11iG24ainLodRg612uxk99p+lV01tGmEQSEUybBdurjz7jjpWS2X6XStpqISC ldfft5VQ5T26riLrvxzuGl779poEfS0QPqxGpWEsjq/VyLlzfa96U5KKsKevy/5kHs fpayAdyFBB8ZHkrZfFWDZM4Zjc0lPnRb97wwPM4OEGsd5R98p4y1i8DW27AW8XRFef nNpjJHr9osKPhrLHyvOVOsaiAzNqxis75VP78+gQ20JcO/WieYQsrq4Wlohfli2xVO fB3G/ymop45MQ== Received: from outbound.pv.icloud.com (localhost [127.0.0.1]) by outbound.pv.icloud.com (Postfix) with ESMTPS id 730D01807E93; Fri, 20 Jun 2025 14:41:06 +0000 (UTC) Received: from [192.168.1.26] (pv-asmtp-me-k8s.p00.prod.me.com [17.56.9.36]) by outbound.pv.icloud.com (Postfix) with ESMTPSA id 4EA20180B554; Fri, 20 Jun 2025 14:35:47 +0000 (UTC) From: Zijun Hu Date: Fri, 20 Jun 2025 22:35:20 +0800 Subject: [PATCH 3/3] char: misc: Fix improper and inaccurate error code returned by misc_init() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250620-fix_mischar-v1-3-6c2716bbf1fa@oss.qualcomm.com> References: <20250620-fix_mischar-v1-0-6c2716bbf1fa@oss.qualcomm.com> In-Reply-To: <20250620-fix_mischar-v1-0-6c2716bbf1fa@oss.qualcomm.com> To: Arnd Bergmann , Greg Kroah-Hartman Cc: Zijun Hu , linux-kernel@vger.kernel.org, Zijun Hu X-Mailer: b4 0.14.2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNjIwMDEwNCBTYWx0ZWRfX6yq2+zIZcv9X KVPO81Fwv6FJvk6IaUQHLntsXIGKCDMJ2LrKqLba+hZ6FZen7CCXv2syjURioA49xKEswiZtDTH WnMxRkU0tDDZtZlcux6RyZiucwDbYqFEbkwlNCmO5+Nd6NiwfS+P2StGGafs9Bt65UJ7nnUgnxh BD1LN88buvJIOOsC2ZS9POtgZdiEhsqXwGncHl1/9mJLvDeaeOK5cyi4dDw+PbkkngUdC+iIWDC NgzJD6RyiaLuGnC5FH+YqmVhytdbjWc7O6lEkkEe9MmBQYb6G1BD7r359rv60fnona1qm70Ig= X-Proofpoint-GUID: 8pIuE0yExZG1nCgiMKhMSt8em4PdDAHf X-Proofpoint-ORIG-GUID: 8pIuE0yExZG1nCgiMKhMSt8em4PdDAHf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 definitions=2025-06-20_05,2025-06-20_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 bulkscore=0 mlxscore=0 phishscore=0 mlxlogscore=999 clxscore=1015 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.22.0-2506060001 definitions=main-2506200104 From: Zijun Hu misc_init() returns -EIO for __register_chrdev() invocation failure, but: - -EIO is for I/O error normally, but __register_chrdev() does not do I/O. - -EIO can not cover various error codes returned by __register_chrdev(). Fix by returning error code of __register_chrdev(). Signed-off-by: Zijun Hu --- drivers/char/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/char/misc.c b/drivers/char/misc.c index f5ef8c175adb559e67dfe905d43d1404b249cc9e..e5ea36bbf6b3d1313eb35d32596= 17bf90c55727d 100644 --- a/drivers/char/misc.c +++ b/drivers/char/misc.c @@ -296,8 +296,8 @@ static int __init misc_init(void) if (err) goto fail_remove; =20 - err =3D -EIO; - if (__register_chrdev(MISC_MAJOR, 0, MINORMASK + 1, "misc", &misc_fops)) + err =3D __register_chrdev(MISC_MAJOR, 0, MINORMASK + 1, "misc", &misc_fop= s); + if (err < 0) goto fail_printk; return 0; =20 --=20 2.34.1