* RE: [Intel-wired-lan] [PATCH 25/61] net/bluetooth: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 9:21 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
In-Reply-To: <20260310-b4-is_err_or_null-v1-25-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Marcel Holtmann <marcel@holtmann.org>; Johan Hedberg
> <johan.hedberg@gmail.com>; Luiz Augusto von Dentz
> <luiz.dentz@gmail.com>
> Subject: [Intel-wired-lan] [PATCH 25/61] net/bluetooth: Prefer
> IS_ERR_OR_NULL over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Marcel Holtmann <marcel@holtmann.org>
> To: Johan Hedberg <johan.hedberg@gmail.com>
> To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
> Cc: linux-bluetooth@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> net/bluetooth/mgmt.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index
> a7238fd3b03bb54f39af1afee74dc1acd931c324..06d2da67bbe14e17ee478aa939de
> 26526c333d91 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -4169,7 +4169,7 @@ static void set_default_phy_complete(struct
> hci_dev *hdev, void *data, int err)
> mgmt_phy_configuration_changed(hdev, cmd->sk);
> }
>
> - if (skb && !IS_ERR(skb))
> + if (!IS_ERR_OR_NULL(skb))
> kfree_skb(skb);
>
> mgmt_pending_free(cmd);
> @@ -5730,7 +5730,7 @@ static void read_local_oob_data_complete(struct
> hci_dev *hdev, void *data,
> MGMT_STATUS_SUCCESS, &mgmt_rp, rp_size);
>
> remove:
> - if (skb && !IS_ERR(skb))
> + if (!IS_ERR_OR_NULL(skb))
> kfree_skb(skb);
>
> mgmt_pending_free(cmd);
> @@ -8277,7 +8277,7 @@ static void
> read_local_oob_ext_data_complete(struct hci_dev *hdev, void *data,
> mgmt_rp, sizeof(*mgmt_rp) + eir_len,
> HCI_MGMT_OOB_DATA_EVENTS, cmd->sk);
> done:
> - if (skb && !IS_ERR(skb))
> + if (!IS_ERR_OR_NULL(skb))
> kfree_skb(skb);
>
> kfree(mgmt_rp);
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 24/61] net/9p: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 9:19 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
Christian Schoenebeck, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Simon Horman
In-Reply-To: <20260310-b4-is_err_or_null-v1-24-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Eric Van Hensbergen <ericvh@kernel.org>; Latchesar Ionkov
> <lucho@ionkov.net>; Dominique Martinet <asmadeus@codewreck.org>;
> Christian Schoenebeck <linux_oss@crudebyte.com>; David S. Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Simon
> Horman <horms@kernel.org>
> Subject: [Intel-wired-lan] [PATCH 24/61] net/9p: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Eric Van Hensbergen <ericvh@kernel.org>
> To: Latchesar Ionkov <lucho@ionkov.net>
> To: Dominique Martinet <asmadeus@codewreck.org>
> To: Christian Schoenebeck <linux_oss@crudebyte.com>
> To: "David S. Miller" <davem@davemloft.net>
> To: Eric Dumazet <edumazet@google.com>
> To: Jakub Kicinski <kuba@kernel.org>
> To: Paolo Abeni <pabeni@redhat.com>
> To: Simon Horman <horms@kernel.org>
> Cc: v9fs@lists.linux.dev
> Cc: netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> include/net/9p/client.h | 2 +-
> net/9p/trans_rdma.c | 8 ++++----
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/net/9p/client.h b/include/net/9p/client.h index
> 838a94218b593f3fb19e6827c472753380193461..4bde6bd716f323c819745e64c7aa
> c0dea7beb72f 100644
> --- a/include/net/9p/client.h
> +++ b/include/net/9p/client.h
> @@ -364,7 +364,7 @@ static inline struct p9_fid *p9_fid_get(struct
> p9_fid *fid)
>
> static inline int p9_fid_put(struct p9_fid *fid) {
> - if (!fid || IS_ERR(fid))
> + if (IS_ERR_OR_NULL(fid))
> return 0;
>
> if (tracepoint_enabled(9p_fid_ref))
> diff --git a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c index
> aa5bd74d333f3b5e6fd1e4344d26bc0201ff7f7f..60461344b536bcb6e94112aace75
> a88b6a99ad86 100644
> --- a/net/9p/trans_rdma.c
> +++ b/net/9p/trans_rdma.c
> @@ -252,16 +252,16 @@ static void rdma_destroy_trans(struct
> p9_trans_rdma *rdma)
> if (!rdma)
> return;
>
> - if (rdma->qp && !IS_ERR(rdma->qp))
> + if (!IS_ERR_OR_NULL(rdma->qp))
> ib_destroy_qp(rdma->qp);
>
> - if (rdma->pd && !IS_ERR(rdma->pd))
> + if (!IS_ERR_OR_NULL(rdma->pd))
> ib_dealloc_pd(rdma->pd);
>
> - if (rdma->cq && !IS_ERR(rdma->cq))
> + if (!IS_ERR_OR_NULL(rdma->cq))
> ib_free_cq(rdma->cq);
>
> - if (rdma->cm_id && !IS_ERR(rdma->cm_id))
> + if (!IS_ERR_OR_NULL(rdma->cm_id))
> rdma_destroy_id(rdma->cm_id);
>
> kfree(rdma);
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 22/61] md: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 9:19 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Alasdair Kergon, Mike Snitzer, Mikulas Patocka,
Benjamin Marzinski
In-Reply-To: <20260310-b4-is_err_or_null-v1-22-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Alasdair Kergon <agk@redhat.com>; Mike Snitzer
> <snitzer@kernel.org>; Mikulas Patocka <mpatocka@redhat.com>; Benjamin
> Marzinski <bmarzins@redhat.com>
> Subject: [Intel-wired-lan] [PATCH 22/61] md: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Alasdair Kergon <agk@redhat.com>
> To: Mike Snitzer <snitzer@kernel.org>
> To: Mikulas Patocka <mpatocka@redhat.com>
> To: Benjamin Marzinski <bmarzins@redhat.com>
> Cc: dm-devel@lists.linux.dev
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> drivers/md/dm-cache-metadata.c | 2 +-
> drivers/md/dm-crypt.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/md/dm-cache-metadata.c b/drivers/md/dm-cache-
> metadata.c index
> 57158c02d096ed38759d563bf27e7f1b3fe58ccc..32f7d25b83a181a30a78c663d48f
> 7882cb97f7b5 100644
> --- a/drivers/md/dm-cache-metadata.c
> +++ b/drivers/md/dm-cache-metadata.c
> @@ -1819,7 +1819,7 @@ int dm_cache_metadata_abort(struct
> dm_cache_metadata *cmd)
> WRITE_UNLOCK(cmd);
> dm_block_manager_destroy(old_bm);
> out:
> - if (new_bm && !IS_ERR(new_bm))
> + if (!IS_ERR_OR_NULL(new_bm))
> dm_block_manager_destroy(new_bm);
>
> return r;
> diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index
> 54823341c9fda46b2d8e13428cbd51f3edf642d5..05eae3d3c7df6baebd0b7a4219f7
> b6938f6e7f87 100644
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -2295,7 +2295,7 @@ static void crypt_free_tfms_aead(struct
> crypt_config *cc)
> if (!cc->cipher_tfm.tfms_aead)
> return;
>
> - if (cc->cipher_tfm.tfms_aead[0] && !IS_ERR(cc-
> >cipher_tfm.tfms_aead[0])) {
> + if (!IS_ERR_OR_NULL(cc->cipher_tfm.tfms_aead[0])) {
> crypto_free_aead(cc->cipher_tfm.tfms_aead[0]);
> cc->cipher_tfm.tfms_aead[0] = NULL;
> }
> @@ -2312,7 +2312,7 @@ static void crypt_free_tfms_skcipher(struct
> crypt_config *cc)
> return;
>
> for (i = 0; i < cc->tfms_count; i++)
> - if (cc->cipher_tfm.tfms[i] && !IS_ERR(cc-
> >cipher_tfm.tfms[i])) {
> + if (!IS_ERR_OR_NULL(cc->cipher_tfm.tfms[i])) {
> crypto_free_skcipher(cc->cipher_tfm.tfms[i]);
> cc->cipher_tfm.tfms[i] = NULL;
> }
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 17/61] module: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 9:18 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Luis Chamberlain, Petr Pavlu, Daniel Gomez, Sami Tolvanen,
Aaron Tomlin
In-Reply-To: <20260310-b4-is_err_or_null-v1-17-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Luis Chamberlain <mcgrof@kernel.org>; Petr Pavlu
> <petr.pavlu@suse.com>; Daniel Gomez <da.gomez@kernel.org>; Sami
> Tolvanen <samitolvanen@google.com>; Aaron Tomlin <atomlin@atomlin.com>
> Subject: [Intel-wired-lan] [PATCH 17/61] module: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Luis Chamberlain <mcgrof@kernel.org>
> To: Petr Pavlu <petr.pavlu@suse.com>
> To: Daniel Gomez <da.gomez@kernel.org>
> To: Sami Tolvanen <samitolvanen@google.com>
> To: Aaron Tomlin <atomlin@atomlin.com>
> Cc: linux-modules@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> kernel/module/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/module/main.c b/kernel/module/main.c index
> c3ce106c70af165e2dc1a3c79f5a074a5c3e3d34..7f62f0620dcd75960e431f7af3d1
> cadf4cc41e4b 100644
> --- a/kernel/module/main.c
> +++ b/kernel/module/main.c
> @@ -1551,7 +1551,7 @@ static int simplify_symbols(struct module *mod,
> const struct load_info *info)
> case SHN_UNDEF:
> ksym = resolve_symbol_wait(mod, info, name);
> /* Ok if resolved. */
> - if (ksym && !IS_ERR(ksym)) {
> + if (!IS_ERR_OR_NULL(ksym)) {
> sym[i].st_value =
> kernel_symbol_value(ksym);
> break;
> }
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 16/61] sched: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 9:16 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Tejun Heo, David Vernet, Andrea Righi, Changwoo Min, Ingo Molnar,
Peter Zijlstra, Juri Lelli, Vincent Guittot, Dietmar Eggemann,
Steven Rostedt, Ben Segall, Mel Gorman, Valentin Schneider
In-Reply-To: <20260310-b4-is_err_or_null-v1-16-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Tejun Heo <tj@kernel.org>; David Vernet <void@manifault.com>;
> Andrea Righi <arighi@nvidia.com>; Changwoo Min <changwoo@igalia.com>;
> Ingo Molnar <mingo@redhat.com>; Peter Zijlstra <peterz@infradead.org>;
> Juri Lelli <juri.lelli@redhat.com>; Vincent Guittot
> <vincent.guittot@linaro.org>; Dietmar Eggemann
> <dietmar.eggemann@arm.com>; Steven Rostedt <rostedt@goodmis.org>; Ben
> Segall <bsegall@google.com>; Mel Gorman <mgorman@suse.de>; Valentin
> Schneider <vschneid@redhat.com>
> Subject: [Intel-wired-lan] [PATCH 16/61] sched: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Tejun Heo <tj@kernel.org>
> To: David Vernet <void@manifault.com>
> To: Andrea Righi <arighi@nvidia.com>
> To: Changwoo Min <changwoo@igalia.com>
> To: Ingo Molnar <mingo@redhat.com>
> To: Peter Zijlstra <peterz@infradead.org>
> To: Juri Lelli <juri.lelli@redhat.com>
> To: Vincent Guittot <vincent.guittot@linaro.org>
> To: Dietmar Eggemann <dietmar.eggemann@arm.com>
> To: Steven Rostedt <rostedt@goodmis.org>
> To: Ben Segall <bsegall@google.com>
> To: Mel Gorman <mgorman@suse.de>
> To: Valentin Schneider <vschneid@redhat.com>
> Cc: sched-ext@lists.linux.dev
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> kernel/sched/ext.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/ext.c b/kernel/sched/ext.c index
> 1594987d637b09e586ae788b7f2e6336332d605a..cfa869bd7de5406a5ca094992ab0
> 4c62b0e92fd0 100644
> --- a/kernel/sched/ext.c
> +++ b/kernel/sched/ext.c
> @@ -3688,7 +3688,7 @@ static void scx_sched_free_rcu_work(struct
> work_struct *work)
> do {
> rhashtable_walk_start(&rht_iter);
>
> - while ((dsq = rhashtable_walk_next(&rht_iter)) &&
> !IS_ERR(dsq))
> + while (!IS_ERR_OR_NULL((dsq =
> rhashtable_walk_next(&rht_iter))))
> destroy_dsq(sch, dsq->id);
>
> rhashtable_walk_stop(&rht_iter);
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 13/61] squashfs: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 8:19 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Phillip Lougher
In-Reply-To: <20260310-b4-is_err_or_null-v1-13-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Phillip Lougher <phillip@squashfs.org.uk>
> Subject: [Intel-wired-lan] [PATCH 13/61] squashfs: Prefer
> IS_ERR_OR_NULL over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Phillip Lougher <phillip@squashfs.org.uk>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> fs/squashfs/cache.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c index
> 67abd4dff222235e75d8c2b10d5e9b811d6e38d8..8888cc02966e2e33210c872c7332
> 05d4c581ecc9 100644
> --- a/fs/squashfs/cache.c
> +++ b/fs/squashfs/cache.c
> @@ -198,7 +198,7 @@ void squashfs_cache_delete(struct squashfs_cache
> *cache) {
> int i, j;
>
> - if (IS_ERR(cache) || cache == NULL)
> + if (IS_ERR_OR_NULL(cache))
> return;
>
> for (i = 0; i < cache->entries; i++) {
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 12/61] quota: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 8:19 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Jan Kara
In-Reply-To: <20260310-b4-is_err_or_null-v1-12-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Jan Kara <jack@suse.com>
> Subject: [Intel-wired-lan] [PATCH 12/61] quota: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Jan Kara <jack@suse.com>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> fs/quota/quota.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/quota/quota.c b/fs/quota/quota.c index
> 33bacd70758007129e0375bab44d7431195ec441..2e09fc247d0cf45b9e83a4f8a0be
> 7ea694c8c2a1 100644
> --- a/fs/quota/quota.c
> +++ b/fs/quota/quota.c
> @@ -965,7 +965,7 @@ SYSCALL_DEFINE4(quotactl, unsigned int, cmd, const
> char __user *, special,
> else
> drop_super_exclusive(sb);
> out:
> - if (pathp && !IS_ERR(pathp))
> + if (!IS_ERR_OR_NULL(pathp))
> path_put(pathp);
> return ret;
> }
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 08/61] fuse: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 8:18 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Miklos Szeredi
In-Reply-To: <20260310-b4-is_err_or_null-v1-8-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Miklos Szeredi <miklos@szeredi.hu>
> Subject: [Intel-wired-lan] [PATCH 08/61] fuse: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Miklos Szeredi <miklos@szeredi.hu>
> Cc: linux-fsdevel@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> fs/fuse/dir.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index
> 7ac6b232ef12323e3afb97b98301f623bce917a4..7b39c013027bd9c4ba6f080bfc9b
> 3ec22bc2dd4a 100644
> --- a/fs/fuse/dir.c
> +++ b/fs/fuse/dir.c
> @@ -1599,7 +1599,7 @@ int fuse_reverse_inval_entry(struct fuse_conn
> *fc, u64 parent_nodeid,
> goto put_parent;
> while (!entry) {
> struct dentry *child = try_lookup_noperm(name, dir);
> - if (!child || IS_ERR(child))
> + if (IS_ERR_OR_NULL(child))
> goto put_parent;
> entry = start_removing_dentry(dir, child);
> dput(child);
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 06/61] 9p: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 8:17 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Eric Van Hensbergen, Latchesar Ionkov, Dominique Martinet,
Christian Schoenebeck
In-Reply-To: <20260310-b4-is_err_or_null-v1-6-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:49 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Eric Van Hensbergen <ericvh@kernel.org>; Latchesar Ionkov
> <lucho@ionkov.net>; Dominique Martinet <asmadeus@codewreck.org>;
> Christian Schoenebeck <linux_oss@crudebyte.com>
> Subject: [Intel-wired-lan] [PATCH 06/61] 9p: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Eric Van Hensbergen <ericvh@kernel.org>
> To: Latchesar Ionkov <lucho@ionkov.net>
> To: Dominique Martinet <asmadeus@codewreck.org>
> To: Christian Schoenebeck <linux_oss@crudebyte.com>
> Cc: v9fs@lists.linux.dev
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> fs/9p/fid.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/9p/fid.h b/fs/9p/fid.h
> index
> 0d6138bee2a3d1ab565ab2d210c0a3f3bf97e4e3..3bb7ef4380e972a2d9ab67eb4aab
> 6cc5bfe2eea7 100644
> --- a/fs/9p/fid.h
> +++ b/fs/9p/fid.h
> @@ -27,7 +27,7 @@ static inline struct p9_fid *v9fs_fid_clone(struct
> dentry *dentry)
> struct p9_fid *fid, *nfid;
>
> fid = v9fs_fid_lookup(dentry);
> - if (!fid || IS_ERR(fid))
> + if (IS_ERR_OR_NULL(fid))
> return fid;
>
> nfid = clone_fid(fid);
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* RE: [Intel-wired-lan] [PATCH 03/61] ceph: Prefer IS_ERR_OR_NULL over manual NULL check
From: Loktionov, Aleksandr @ 2026-03-11 8:16 UTC (permalink / raw)
To: Philipp Hahn, amd-gfx@lists.freedesktop.org,
apparmor@lists.ubuntu.com, bpf@vger.kernel.org,
ceph-devel@vger.kernel.org, cocci@inria.fr,
dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org,
gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org,
intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org,
linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-leds@vger.kernel.org, linux-media@vger.kernel.org,
linux-mips@vger.kernel.org, linux-mm@kvack.org,
linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org,
linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org,
linux-phy@lists.infradead.org, linux-pm@vger.kernel.org,
linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org,
linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org,
linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org,
linux-sound@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
ntfs3@lists.linux.dev, samba-technical@lists.samba.org,
sched-ext@lists.linux.dev, target-devel@vger.kernel.org,
tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev
Cc: Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko
In-Reply-To: <20260310-b4-is_err_or_null-v1-3-bd63b656022d@avm.de>
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf
> Of Philipp Hahn
> Sent: Tuesday, March 10, 2026 12:48 PM
> To: amd-gfx@lists.freedesktop.org; apparmor@lists.ubuntu.com;
> bpf@vger.kernel.org; ceph-devel@vger.kernel.org; cocci@inria.fr; dm-
> devel@lists.linux.dev; dri-devel@lists.freedesktop.org;
> gfs2@lists.linux.dev; intel-gfx@lists.freedesktop.org; intel-wired-
> lan@lists.osuosl.org; iommu@lists.linux.dev; kvm@vger.kernel.org;
> linux-arm-kernel@lists.infradead.org; linux-block@vger.kernel.org;
> linux-bluetooth@vger.kernel.org; linux-btrfs@vger.kernel.org; linux-
> cifs@vger.kernel.org; linux-clk@vger.kernel.org; linux-
> erofs@lists.ozlabs.org; linux-ext4@vger.kernel.org; linux-
> fsdevel@vger.kernel.org; linux-gpio@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-input@vger.kernel.org; linux-
> kernel@vger.kernel.org; linux-leds@vger.kernel.org; linux-
> media@vger.kernel.org; linux-mips@vger.kernel.org; linux-mm@kvack.org;
> linux-modules@vger.kernel.org; linux-mtd@lists.infradead.org; linux-
> nfs@vger.kernel.org; linux-omap@vger.kernel.org; linux-
> phy@lists.infradead.org; linux-pm@vger.kernel.org; linux-
> rockchip@lists.infradead.org; linux-s390@vger.kernel.org; linux-
> scsi@vger.kernel.org; linux-sctp@vger.kernel.org; linux-security-
> module@vger.kernel.org; linux-sh@vger.kernel.org; linux-
> sound@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-trace-kernel@vger.kernel.org; linux-usb@vger.kernel.org; linux-
> wireless@vger.kernel.org; netdev@vger.kernel.org;
> ntfs3@lists.linux.dev; samba-technical@lists.samba.org; sched-
> ext@lists.linux.dev; target-devel@vger.kernel.org; tipc-
> discussion@lists.sourceforge.net; v9fs@lists.linux.dev; Philipp Hahn
> <phahn-oss@avm.de>
> Cc: Ilya Dryomov <idryomov@gmail.com>; Alex Markuze
> <amarkuze@redhat.com>; Viacheslav Dubeyko <slava@dubeyko.com>
> Subject: [Intel-wired-lan] [PATCH 03/61] ceph: Prefer IS_ERR_OR_NULL
> over manual NULL check
>
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Change generated with coccinelle.
>
> To: Ilya Dryomov <idryomov@gmail.com>
> To: Alex Markuze <amarkuze@redhat.com>
> To: Viacheslav Dubeyko <slava@dubeyko.com>
> Cc: ceph-devel@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> fs/ceph/dir.c | 2 +-
> fs/ceph/snap.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index
> 86d7aa594ea99335af3e91a95c0a418fdc1b8a8a..934250748ae4fd4c148fd27bdf91
> 175047c2877d 100644
> --- a/fs/ceph/dir.c
> +++ b/fs/ceph/dir.c
> @@ -889,7 +889,7 @@ int ceph_handle_notrace_create(struct inode *dir,
> struct dentry *dentry) {
> struct dentry *result = ceph_lookup(dir, dentry, 0);
>
> - if (result && !IS_ERR(result)) {
> + if (!IS_ERR_OR_NULL(result)) {
> /*
> * We created the item, then did a lookup, and found
> * it was already linked to another inode we already
> diff --git a/fs/ceph/snap.c b/fs/ceph/snap.c index
> 52b4c2684f922bfed39550311e793bfe3622cd26..528ad581be160713f91416115659
> e2dc6f259576 100644
> --- a/fs/ceph/snap.c
> +++ b/fs/ceph/snap.c
> @@ -902,7 +902,7 @@ int ceph_update_snap_trace(struct ceph_mds_client
> *mdsc,
> bad:
> err = -EIO;
> fail:
> - if (realm && !IS_ERR(realm))
> + if (!IS_ERR_OR_NULL(realm))
> ceph_put_snap_realm(mdsc, realm);
> if (first_realm)
> ceph_put_snap_realm(mdsc, first_realm);
>
> --
> 2.43.0
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
^ permalink raw reply
* Re: [PATCH v5 6/7] power: supply: Add driver for ASUS Transformer battery
From: Svyatoslav Ryhel @ 2026-03-11 8:14 UTC (permalink / raw)
To: Sebastian Reichel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Dmitry Torokhov,
Lee Jones, Pavel Machek, Ion Agorria, Michał Mirosław,
devicetree, linux-kernel, linux-input, linux-leds, linux-pm
In-Reply-To: <abELVIzUrWmno8cX@venus>
ср, 11 бер. 2026 р. о 08:31 Sebastian Reichel
<sebastian.reichel@collabora.com> пише:
>
> Hi,
>
> On Wed, Mar 04, 2026 at 08:57:50PM +0200, Svyatoslav Ryhel wrote:
> > From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> >
> > Driver implements one battery cell per EC controller and supports reading
> > of battery status for ASUS Transformer's pad and mobile dock.
> >
> > Co-developed-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > ---
> > drivers/power/supply/Kconfig | 11 +
> > drivers/power/supply/Makefile | 1 +
> > .../supply/asus-transformer-ec-battery.c | 272 ++++++++++++++++++
> > 3 files changed, 284 insertions(+)
> > create mode 100644 drivers/power/supply/asus-transformer-ec-battery.c
> >
> > diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
> > index 81fadb0695a9..3c46b412632d 100644
> > --- a/drivers/power/supply/Kconfig
> > +++ b/drivers/power/supply/Kconfig
> > @@ -122,6 +122,17 @@ config BATTERY_CHAGALL
> > This driver can also be built as a module. If so, the module will be
> > called chagall-battery.
> >
> > +config BATTERY_ASUS_TRANSFORMER_EC
> > + tristate "Asus Transformer's battery driver"
> > + depends on MFD_ASUS_TRANSFORMER_EC
> > + help
> > + Say Y here to enable support APM status emulation using
> > + battery class devices.
>
> ^^^
>
> You forgot to drop that when you used the APM_POWER config entry as
> template. Otherwise the driver LGTM:
>
Oh, my bad. I will adjust in the next iteration. Thank you catching this.
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
>
> Greetings,
>
> -- Sebastian
>
> > + This sub-driver supports battery cells found in Asus Transformer
> > + tablets and mobile docks and controlled by special embedded
> > + controller.
> > +
> > config BATTERY_CPCAP
> > tristate "Motorola CPCAP PMIC battery driver"
> > depends on MFD_CPCAP && IIO
> > diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile
> > index 41c400bbf022..aa5e6b05b018 100644
> > --- a/drivers/power/supply/Makefile
> > +++ b/drivers/power/supply/Makefile
> > @@ -22,6 +22,7 @@ obj-$(CONFIG_TEST_POWER) += test_power.o
> > obj-$(CONFIG_BATTERY_88PM860X) += 88pm860x_battery.o
> > obj-$(CONFIG_CHARGER_ADP5061) += adp5061.o
> > obj-$(CONFIG_BATTERY_ACT8945A) += act8945a_charger.o
> > +obj-$(CONFIG_BATTERY_ASUS_TRANSFORMER_EC) += asus-transformer-ec-battery.o
> > obj-$(CONFIG_BATTERY_AXP20X) += axp20x_battery.o
> > obj-$(CONFIG_CHARGER_AXP20X) += axp20x_ac_power.o
> > obj-$(CONFIG_BATTERY_CHAGALL) += chagall-battery.o
> > diff --git a/drivers/power/supply/asus-transformer-ec-battery.c b/drivers/power/supply/asus-transformer-ec-battery.c
> > new file mode 100644
> > index 000000000000..aefcd3fed6fe
> > --- /dev/null
> > +++ b/drivers/power/supply/asus-transformer-ec-battery.c
> > @@ -0,0 +1,272 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +
> > +#include <linux/array_size.h>
> > +#include <linux/devm-helpers.h>
> > +#include <linux/err.h>
> > +#include <linux/mfd/asus-transformer-ec.h>
> > +#include <linux/module.h>
> > +#include <linux/mutex.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/power_supply.h>
> > +#include <linux/property.h>
> > +#include <linux/unaligned.h>
> > +
> > +#define ASUSEC_BATTERY_DATA_FRESH_MSEC 5000
> > +
> > +#define ASUSEC_BATTERY_DISCHARGING 0x40
> > +#define ASUSEC_BATTERY_FULL_CHARGED 0x20
> > +#define ASUSEC_BATTERY_NOT_CHARGING 0x10
> > +
> > +#define TEMP_CELSIUS_OFFSET 2731
> > +
> > +struct asus_ec_battery_data {
> > + const struct asusec_info *ec;
> > + struct power_supply *battery;
> > + struct power_supply_desc psy_desc;
> > + struct delayed_work poll_work;
> > + struct mutex battery_lock; /* for data refresh */
> > + unsigned long batt_data_ts;
> > + int last_state;
> > + u8 batt_data[DOCKRAM_ENTRY_BUFSIZE];
> > +};
> > +
> > +static int asus_ec_battery_refresh(struct asus_ec_battery_data *priv)
> > +{
> > + int ret = 0;
> > +
> > + guard(mutex)(&priv->battery_lock);
> > +
> > + if (time_before(jiffies, priv->batt_data_ts))
> > + return ret;
> > +
> > + ret = asus_dockram_read(priv->ec->dockram, ASUSEC_DOCKRAM_BATT_CTL,
> > + priv->batt_data);
> > + if (ret < 0)
> > + return ret;
> > +
> > + priv->batt_data_ts = jiffies +
> > + msecs_to_jiffies(ASUSEC_BATTERY_DATA_FRESH_MSEC);
> > +
> > + return ret;
> > +}
> > +
> > +static enum power_supply_property asus_ec_battery_properties[] = {
> > + POWER_SUPPLY_PROP_STATUS,
> > + POWER_SUPPLY_PROP_VOLTAGE_MAX,
> > + POWER_SUPPLY_PROP_CURRENT_MAX,
> > + POWER_SUPPLY_PROP_TEMP,
> > + POWER_SUPPLY_PROP_VOLTAGE_NOW,
> > + POWER_SUPPLY_PROP_CURRENT_NOW,
> > + POWER_SUPPLY_PROP_CAPACITY,
> > + POWER_SUPPLY_PROP_CHARGE_NOW,
> > + POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
> > + POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
> > + POWER_SUPPLY_PROP_PRESENT,
> > +};
> > +
> > +static const unsigned int asus_ec_battery_prop_offs[] = {
> > + [POWER_SUPPLY_PROP_STATUS] = 1,
> > + [POWER_SUPPLY_PROP_VOLTAGE_MAX] = 3,
> > + [POWER_SUPPLY_PROP_CURRENT_MAX] = 5,
> > + [POWER_SUPPLY_PROP_TEMP] = 7,
> > + [POWER_SUPPLY_PROP_VOLTAGE_NOW] = 9,
> > + [POWER_SUPPLY_PROP_CURRENT_NOW] = 11,
> > + [POWER_SUPPLY_PROP_CAPACITY] = 13,
> > + [POWER_SUPPLY_PROP_CHARGE_NOW] = 15,
> > + [POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW] = 17,
> > + [POWER_SUPPLY_PROP_TIME_TO_FULL_NOW] = 19,
> > +};
> > +
> > +static int asus_ec_battery_get_value(struct asus_ec_battery_data *priv,
> > + enum power_supply_property psp)
> > +{
> > + int ret, offs;
> > +
> > + if (psp >= ARRAY_SIZE(asus_ec_battery_prop_offs))
> > + return -EINVAL;
> > +
> > + offs = asus_ec_battery_prop_offs[psp];
> > + if (!offs)
> > + return -EINVAL;
> > +
> > + ret = asus_ec_battery_refresh(priv);
> > + if (ret < 0)
> > + return ret;
> > +
> > + if (offs >= priv->batt_data[0])
> > + return -ENODATA;
> > +
> > + return get_unaligned_le16(priv->batt_data + offs);
> > +}
> > +
> > +static int asus_ec_battery_get_property(struct power_supply *psy,
> > + enum power_supply_property psp,
> > + union power_supply_propval *val)
> > +{
> > + struct asus_ec_battery_data *priv = power_supply_get_drvdata(psy);
> > + int ret;
> > +
> > + switch (psp) {
> > + case POWER_SUPPLY_PROP_PRESENT:
> > + val->intval = 1;
> > + break;
> > +
> > + default:
> > + ret = asus_ec_battery_get_value(priv, psp);
> > + if (ret < 0)
> > + return ret;
> > +
> > + val->intval = (s16)ret;
> > +
> > + switch (psp) {
> > + case POWER_SUPPLY_PROP_STATUS:
> > + if (ret & ASUSEC_BATTERY_FULL_CHARGED)
> > + val->intval = POWER_SUPPLY_STATUS_FULL;
> > + else if (ret & ASUSEC_BATTERY_NOT_CHARGING)
> > + val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
> > + else if (ret & ASUSEC_BATTERY_DISCHARGING)
> > + val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
> > + else
> > + val->intval = POWER_SUPPLY_STATUS_CHARGING;
> > + break;
> > +
> > + case POWER_SUPPLY_PROP_TEMP:
> > + val->intval -= TEMP_CELSIUS_OFFSET;
> > + break;
> > +
> > + case POWER_SUPPLY_PROP_CHARGE_NOW:
> > + case POWER_SUPPLY_PROP_CURRENT_NOW:
> > + case POWER_SUPPLY_PROP_CURRENT_MAX:
> > + case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> > + case POWER_SUPPLY_PROP_VOLTAGE_MAX:
> > + val->intval *= 1000;
> > + break;
> > +
> > + case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
> > + case POWER_SUPPLY_PROP_TIME_TO_FULL_NOW:
> > + val->intval *= 60;
> > + break;
> > +
> > + default:
> > + break;
> > + }
> > +
> > + break;
> > + }
> > +
> > + return 0;
> > +}
> > +
> > +static void asus_ec_battery_poll_work(struct work_struct *work)
> > +{
> > + struct asus_ec_battery_data *priv =
> > + container_of(work, struct asus_ec_battery_data, poll_work.work);
> > + int state;
> > +
> > + state = asus_ec_battery_get_value(priv, POWER_SUPPLY_PROP_STATUS);
> > + if (state < 0)
> > + return;
> > +
> > + if (state & ASUSEC_BATTERY_FULL_CHARGED)
> > + state = POWER_SUPPLY_STATUS_FULL;
> > + else if (state & ASUSEC_BATTERY_DISCHARGING)
> > + state = POWER_SUPPLY_STATUS_DISCHARGING;
> > + else
> > + state = POWER_SUPPLY_STATUS_CHARGING;
> > +
> > + if (priv->last_state != state) {
> > + priv->last_state = state;
> > + power_supply_changed(priv->battery);
> > + }
> > +
> > + /* continuously send uevent notification */
> > + schedule_delayed_work(&priv->poll_work,
> > + msecs_to_jiffies(ASUSEC_BATTERY_DATA_FRESH_MSEC));
> > +}
> > +
> > +static const struct power_supply_desc asus_ec_battery_desc = {
> > + .name = "asus-ec-battery",
> > + .type = POWER_SUPPLY_TYPE_BATTERY,
> > + .properties = asus_ec_battery_properties,
> > + .num_properties = ARRAY_SIZE(asus_ec_battery_properties),
> > + .get_property = asus_ec_battery_get_property,
> > + .external_power_changed = power_supply_changed,
> > +};
> > +
> > +static int asus_ec_battery_probe(struct platform_device *pdev)
> > +{
> > + struct asus_ec_battery_data *priv;
> > + struct device *dev = &pdev->dev;
> > + struct power_supply_config cfg = { };
> > + int ret;
> > +
> > + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> > + if (!priv)
> > + return -ENOMEM;
> > +
> > + platform_set_drvdata(pdev, priv);
> > +
> > + mutex_init(&priv->battery_lock);
> > +
> > + priv->ec = cell_to_ec(pdev);
> > + priv->batt_data_ts = jiffies - 1;
> > + priv->last_state = POWER_SUPPLY_STATUS_UNKNOWN;
> > +
> > + cfg.fwnode = dev_fwnode(dev->parent);
> > + cfg.drv_data = priv;
> > +
> > + memcpy(&priv->psy_desc, &asus_ec_battery_desc, sizeof(priv->psy_desc));
> > + priv->psy_desc.name = devm_kasprintf(dev, GFP_KERNEL, "%s-battery",
> > + priv->ec->name);
> > +
> > + priv->battery = devm_power_supply_register(dev, &priv->psy_desc, &cfg);
> > + if (IS_ERR(priv->battery))
> > + return dev_err_probe(dev, PTR_ERR(priv->battery),
> > + "Failed to register power supply\n");
> > +
> > + ret = devm_delayed_work_autocancel(dev, &priv->poll_work,
> > + asus_ec_battery_poll_work);
> > + if (ret)
> > + return ret;
> > +
> > + schedule_delayed_work(&priv->poll_work,
> > + msecs_to_jiffies(ASUSEC_BATTERY_DATA_FRESH_MSEC));
> > +
> > + return 0;
> > +}
> > +
> > +static int __maybe_unused asus_ec_battery_suspend(struct device *dev)
> > +{
> > + struct asus_ec_battery_data *priv = dev_get_drvdata(dev);
> > +
> > + cancel_delayed_work_sync(&priv->poll_work);
> > +
> > + return 0;
> > +}
> > +
> > +static int __maybe_unused asus_ec_battery_resume(struct device *dev)
> > +{
> > + struct asus_ec_battery_data *priv = dev_get_drvdata(dev);
> > +
> > + schedule_delayed_work(&priv->poll_work,
> > + msecs_to_jiffies(ASUSEC_BATTERY_DATA_FRESH_MSEC));
> > +
> > + return 0;
> > +}
> > +
> > +static SIMPLE_DEV_PM_OPS(asus_ec_battery_pm_ops,
> > + asus_ec_battery_suspend, asus_ec_battery_resume);
> > +
> > +static struct platform_driver asus_ec_battery_driver = {
> > + .driver = {
> > + .name = "asus-transformer-ec-battery",
> > + .pm = &asus_ec_battery_pm_ops,
> > + },
> > + .probe = asus_ec_battery_probe,
> > +};
> > +module_platform_driver(asus_ec_battery_driver);
> > +
> > +MODULE_AUTHOR("Michał Mirosław <mirq-linux@rere.qmqm.pl>");
> > +MODULE_AUTHOR("Svyatoslav Ryhel <clamor95@gmail.com>");
> > +MODULE_DESCRIPTION("ASUS Transformer's battery driver");
> > +MODULE_LICENSE("GPL");
> > --
> > 2.51.0
> >
> >
^ permalink raw reply
* [PATCH] Input: atkbd - skip cleanup when used as a wakeup source
From: Henry Barnor via B4 Relay @ 2026-03-11 7:08 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel, Henry Barnor
From: Henry Barnor <hbarnor@chromium.org>
In systems using suspend-to-idle, the serio core calls atkbd_cleanup()
during the suspend transition. Currently, this function unconditionally
calls atkbd_disable(), setting atkbd->enabled to false.
This creates a race condition during wakeup: when a key is pressed to
wake the system, atkbd_receive_byte() is triggered. It correctly signals
a wakeup event to the PM core, but then checks atkbd->enabled. Because
the driver was disabled during suspend, the scancode is discarded.
The system wakes up, but the initial keystroke is lost.
This is particularly problematic for platforms like Android that rely on
the input event itself to complete the wakeup transition and turn on the
screen. On these systems, the device wakes up but remains in a dim state
because the initial interaction was lost.
This patch modifies atkbd_cleanup() to skip disabling and resetting
the keyboard if the device is configured as a wakeup source. This
preserves atkbd->enabled = true through the sleep duration, ensuring
the wake-up scancode is reported to the input subsystem.
Note that this also affects the shutdown path. However, if a device is
configured for wakeup, skipping the reset to "default" state is
consistent with the goal of allowing the hardware to trigger a
system-state transition. Modern BIOS/UEFI implementations perform their
own keyboard initialization, so skipping the legacy reset on reboot
for these devices poses minimal risk.
Signed-off-by: Henry Barnor <hbarnor@chromium.org>
---
drivers/input/keyboard/atkbd.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 4560d3964eee..1fba1932412e 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -958,6 +958,9 @@ static void atkbd_cleanup(struct serio *serio)
{
struct atkbd *atkbd = atkbd_from_serio(serio);
+ if (device_may_wakeup(&serio->dev))
+ return;
+
atkbd_disable(atkbd);
ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_DEF);
}
---
base-commit: 6d4b67a2a76a4ff2393fe88119ae4332821b82b4
change-id: 20260310-wakeup-ec57a88a0162
Best regards,
--
Henry Barnor <hbarnor@chromium.org>
^ permalink raw reply related
* Re: [PATCH v5 7/7] power: supply: Add charger driver for Asus Transformers
From: Sebastian Reichel @ 2026-03-11 6:47 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Dmitry Torokhov,
Lee Jones, Pavel Machek, Ion Agorria, Michał Mirosław,
devicetree, linux-kernel, linux-input, linux-leds, linux-pm
In-Reply-To: <20260304185751.83494-8-clamor95@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 8925 bytes --]
Hi,
On Wed, Mar 04, 2026 at 08:57:51PM +0200, Svyatoslav Ryhel wrote:
> From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
>
> Add support for charger detection capabilities found in the embedded
> controller of ASUS Transformer devices.
>
> Suggested-by: Maxim Schwalm <maxim.schwalm@gmail.com>
> Suggested-by: Svyatoslav Ryhel <clamor95@gmail.com>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-- Sebastian
> drivers/power/supply/Kconfig | 11 +
> drivers/power/supply/Makefile | 1 +
> .../supply/asus-transformer-ec-charger.c | 193 ++++++++++++++++++
> 3 files changed, 205 insertions(+)
> create mode 100644 drivers/power/supply/asus-transformer-ec-charger.c
>
> diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
> index 3c46b412632d..56800aab82f9 100644
> --- a/drivers/power/supply/Kconfig
> +++ b/drivers/power/supply/Kconfig
> @@ -497,6 +497,17 @@ config CHARGER_88PM860X
> help
> Say Y here to enable charger for Marvell 88PM860x chip.
>
> +config CHARGER_ASUS_TRANSFORMER_EC
> + tristate "Asus Transformer's charger driver"
> + depends on MFD_ASUS_TRANSFORMER_EC
> + help
> + Say Y here to enable support AC plug detection on Asus Transformer
> + Dock.
> +
> + This sub-driver supports charger detection mechanism found in Asus
> + Transformer tablets and mobile docks and controlled by special
> + embedded controller.
> +
> config CHARGER_PF1550
> tristate "NXP PF1550 battery charger driver"
> depends on MFD_PF1550
> diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile
> index aa5e6b05b018..24679f09bb61 100644
> --- a/drivers/power/supply/Makefile
> +++ b/drivers/power/supply/Makefile
> @@ -68,6 +68,7 @@ obj-$(CONFIG_CHARGER_RT9471) += rt9471.o
> obj-$(CONFIG_CHARGER_RT9756) += rt9756.o
> obj-$(CONFIG_BATTERY_TWL4030_MADC) += twl4030_madc_battery.o
> obj-$(CONFIG_CHARGER_88PM860X) += 88pm860x_charger.o
> +obj-$(CONFIG_CHARGER_ASUS_TRANSFORMER_EC) += asus-transformer-ec-charger.o
> obj-$(CONFIG_CHARGER_PF1550) += pf1550-charger.o
> obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o
> obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o ab8500_chargalg.o
> diff --git a/drivers/power/supply/asus-transformer-ec-charger.c b/drivers/power/supply/asus-transformer-ec-charger.c
> new file mode 100644
> index 000000000000..de01f0bf2fd7
> --- /dev/null
> +++ b/drivers/power/supply/asus-transformer-ec-charger.c
> @@ -0,0 +1,193 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +
> +#include <linux/err.h>
> +#include <linux/mfd/asus-transformer-ec.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>
> +#include <linux/power_supply.h>
> +#include <linux/property.h>
> +
> +struct asus_ec_charger_data {
> + struct notifier_block nb;
> + const struct asusec_info *ec;
> + struct power_supply *psy;
> + struct power_supply_desc psy_desc;
> +};
> +
> +static enum power_supply_property asus_ec_charger_properties[] = {
> + POWER_SUPPLY_PROP_USB_TYPE,
> + POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR,
> + POWER_SUPPLY_PROP_ONLINE,
> + POWER_SUPPLY_PROP_MODEL_NAME,
> +};
> +
> +static int asus_ec_charger_get_property(struct power_supply *psy,
> + enum power_supply_property psp,
> + union power_supply_propval *val)
> +{
> + struct asus_ec_charger_data *priv = power_supply_get_drvdata(psy);
> + enum power_supply_usb_type psu;
> + int ret;
> + u64 ctl;
> +
> + ret = asus_ec_get_ctl(priv->ec, &ctl);
> + if (ret)
> + return ret;
> +
> + switch (ctl & (ASUSEC_CTL_FULL_POWER_SOURCE | ASUSEC_CTL_DIRECT_POWER_SOURCE)) {
> + case ASUSEC_CTL_FULL_POWER_SOURCE:
> + psu = POWER_SUPPLY_USB_TYPE_CDP; /* DOCK */
> + break;
> + case ASUSEC_CTL_DIRECT_POWER_SOURCE:
> + psu = POWER_SUPPLY_USB_TYPE_SDP; /* USB */
> + break;
> + case 0:
> + psu = POWER_SUPPLY_USB_TYPE_UNKNOWN; /* no power source connected */
> + break;
> + default:
> + psu = POWER_SUPPLY_USB_TYPE_ACA; /* power adapter */
> + break;
> + }
> +
> + switch (psp) {
> + case POWER_SUPPLY_PROP_ONLINE:
> + val->intval = psu != POWER_SUPPLY_USB_TYPE_UNKNOWN;
> + return 0;
> +
> + case POWER_SUPPLY_PROP_USB_TYPE:
> + val->intval = psu;
> + return 0;
> +
> + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR:
> + if (ctl & ASUSEC_CTL_TEST_DISCHARGE)
> + val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE;
> + else if (ctl & ASUSEC_CTL_USB_CHARGE)
> + val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO;
> + else
> + val->intval = POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE;
> + return 0;
> +
> + case POWER_SUPPLY_PROP_MODEL_NAME:
> + val->strval = priv->ec->model;
> + return 0;
> +
> + default:
> + return -EINVAL;
> + }
> +}
> +
> +static int asus_ec_charger_set_property(struct power_supply *psy,
> + enum power_supply_property psp,
> + const union power_supply_propval *val)
> +{
> + struct asus_ec_charger_data *priv = power_supply_get_drvdata(psy);
> +
> + switch (psp) {
> + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR:
> + switch ((enum power_supply_charge_behaviour)val->intval) {
> + case POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO:
> + return asus_ec_update_ctl(priv->ec,
> + ASUSEC_CTL_TEST_DISCHARGE | ASUSEC_CTL_USB_CHARGE,
> + ASUSEC_CTL_USB_CHARGE);
> +
> + case POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE:
> + return asus_ec_clear_ctl_bits(priv->ec,
> + ASUSEC_CTL_TEST_DISCHARGE | ASUSEC_CTL_USB_CHARGE);
> +
> + case POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE:
> + return asus_ec_update_ctl(priv->ec,
> + ASUSEC_CTL_TEST_DISCHARGE | ASUSEC_CTL_USB_CHARGE,
> + ASUSEC_CTL_TEST_DISCHARGE);
> + default:
> + return -EINVAL;
> + }
> +
> + default:
> + return -EINVAL;
> + }
> +}
> +
> +static int asus_ec_charger_property_is_writeable(struct power_supply *psy,
> + enum power_supply_property psp)
> +{
> + switch (psp) {
> + case POWER_SUPPLY_PROP_CHARGE_BEHAVIOUR:
> + return true;
> + default:
> + return false;
> + }
> +}
> +
> +static const struct power_supply_desc asus_ec_charger_desc = {
> + .name = "asus-ec-charger",
> + .type = POWER_SUPPLY_TYPE_USB,
> + .charge_behaviours = BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_AUTO) |
> + BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_INHIBIT_CHARGE) |
> + BIT(POWER_SUPPLY_CHARGE_BEHAVIOUR_FORCE_DISCHARGE),
> + .usb_types = BIT(POWER_SUPPLY_USB_TYPE_UNKNOWN) |
> + BIT(POWER_SUPPLY_USB_TYPE_SDP) |
> + BIT(POWER_SUPPLY_USB_TYPE_CDP) |
> + BIT(POWER_SUPPLY_USB_TYPE_ACA),
> + .properties = asus_ec_charger_properties,
> + .num_properties = ARRAY_SIZE(asus_ec_charger_properties),
> + .get_property = asus_ec_charger_get_property,
> + .set_property = asus_ec_charger_set_property,
> + .property_is_writeable = asus_ec_charger_property_is_writeable,
> + .no_thermal = true,
> +};
> +
> +static int asus_ec_charger_notify(struct notifier_block *nb,
> + unsigned long action, void *data)
> +{
> + struct asus_ec_charger_data *priv =
> + container_of(nb, struct asus_ec_charger_data, nb);
> +
> + switch (action) {
> + case ASUSEC_SMI_ACTION(POWER_NOTIFY):
> + case ASUSEC_SMI_ACTION(ADAPTER_EVENT):
> + power_supply_changed(priv->psy);
> + break;
> + }
> +
> + return NOTIFY_DONE;
> +}
> +
> +static int asus_ec_charger_probe(struct platform_device *pdev)
> +{
> + struct asus_ec_charger_data *priv;
> + struct device *dev = &pdev->dev;
> + struct power_supply_config cfg = { };
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + platform_set_drvdata(pdev, priv);
> + priv->ec = cell_to_ec(pdev);
> +
> + cfg.fwnode = dev_fwnode(dev->parent);
> + cfg.drv_data = priv;
> +
> + memcpy(&priv->psy_desc, &asus_ec_charger_desc, sizeof(priv->psy_desc));
> + priv->psy_desc.name = devm_kasprintf(dev, GFP_KERNEL, "%s-charger",
> + priv->ec->name);
> +
> + priv->psy = devm_power_supply_register(dev, &priv->psy_desc, &cfg);
> + if (IS_ERR(priv->psy))
> + return dev_err_probe(dev, PTR_ERR(priv->psy),
> + "Failed to register power supply\n");
> +
> + priv->nb.notifier_call = asus_ec_charger_notify;
> +
> + return devm_asus_ec_register_notifier(pdev, &priv->nb);
> +}
> +
> +static struct platform_driver asus_ec_charger_driver = {
> + .driver.name = "asus-transformer-ec-charger",
> + .probe = asus_ec_charger_probe,
> +};
> +module_platform_driver(asus_ec_charger_driver);
> +
> +MODULE_AUTHOR("Michał Mirosław <mirq-linux@rere.qmqm.pl>");
> +MODULE_DESCRIPTION("ASUS Transformer Pad battery charger driver");
> +MODULE_LICENSE("GPL");
> --
> 2.51.0
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH v5 6/7] power: supply: Add driver for ASUS Transformer battery
From: Sebastian Reichel @ 2026-03-11 6:30 UTC (permalink / raw)
To: Svyatoslav Ryhel
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Dmitry Torokhov,
Lee Jones, Pavel Machek, Ion Agorria, Michał Mirosław,
devicetree, linux-kernel, linux-input, linux-leds, linux-pm
In-Reply-To: <20260304185751.83494-7-clamor95@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 10929 bytes --]
Hi,
On Wed, Mar 04, 2026 at 08:57:50PM +0200, Svyatoslav Ryhel wrote:
> From: Michał Mirosław <mirq-linux@rere.qmqm.pl>
>
> Driver implements one battery cell per EC controller and supports reading
> of battery status for ASUS Transformer's pad and mobile dock.
>
> Co-developed-by: Svyatoslav Ryhel <clamor95@gmail.com>
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
> drivers/power/supply/Kconfig | 11 +
> drivers/power/supply/Makefile | 1 +
> .../supply/asus-transformer-ec-battery.c | 272 ++++++++++++++++++
> 3 files changed, 284 insertions(+)
> create mode 100644 drivers/power/supply/asus-transformer-ec-battery.c
>
> diff --git a/drivers/power/supply/Kconfig b/drivers/power/supply/Kconfig
> index 81fadb0695a9..3c46b412632d 100644
> --- a/drivers/power/supply/Kconfig
> +++ b/drivers/power/supply/Kconfig
> @@ -122,6 +122,17 @@ config BATTERY_CHAGALL
> This driver can also be built as a module. If so, the module will be
> called chagall-battery.
>
> +config BATTERY_ASUS_TRANSFORMER_EC
> + tristate "Asus Transformer's battery driver"
> + depends on MFD_ASUS_TRANSFORMER_EC
> + help
> + Say Y here to enable support APM status emulation using
> + battery class devices.
^^^
You forgot to drop that when you used the APM_POWER config entry as
template. Otherwise the driver LGTM:
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Greetings,
-- Sebastian
> + This sub-driver supports battery cells found in Asus Transformer
> + tablets and mobile docks and controlled by special embedded
> + controller.
> +
> config BATTERY_CPCAP
> tristate "Motorola CPCAP PMIC battery driver"
> depends on MFD_CPCAP && IIO
> diff --git a/drivers/power/supply/Makefile b/drivers/power/supply/Makefile
> index 41c400bbf022..aa5e6b05b018 100644
> --- a/drivers/power/supply/Makefile
> +++ b/drivers/power/supply/Makefile
> @@ -22,6 +22,7 @@ obj-$(CONFIG_TEST_POWER) += test_power.o
> obj-$(CONFIG_BATTERY_88PM860X) += 88pm860x_battery.o
> obj-$(CONFIG_CHARGER_ADP5061) += adp5061.o
> obj-$(CONFIG_BATTERY_ACT8945A) += act8945a_charger.o
> +obj-$(CONFIG_BATTERY_ASUS_TRANSFORMER_EC) += asus-transformer-ec-battery.o
> obj-$(CONFIG_BATTERY_AXP20X) += axp20x_battery.o
> obj-$(CONFIG_CHARGER_AXP20X) += axp20x_ac_power.o
> obj-$(CONFIG_BATTERY_CHAGALL) += chagall-battery.o
> diff --git a/drivers/power/supply/asus-transformer-ec-battery.c b/drivers/power/supply/asus-transformer-ec-battery.c
> new file mode 100644
> index 000000000000..aefcd3fed6fe
> --- /dev/null
> +++ b/drivers/power/supply/asus-transformer-ec-battery.c
> @@ -0,0 +1,272 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +
> +#include <linux/array_size.h>
> +#include <linux/devm-helpers.h>
> +#include <linux/err.h>
> +#include <linux/mfd/asus-transformer-ec.h>
> +#include <linux/module.h>
> +#include <linux/mutex.h>
> +#include <linux/platform_device.h>
> +#include <linux/power_supply.h>
> +#include <linux/property.h>
> +#include <linux/unaligned.h>
> +
> +#define ASUSEC_BATTERY_DATA_FRESH_MSEC 5000
> +
> +#define ASUSEC_BATTERY_DISCHARGING 0x40
> +#define ASUSEC_BATTERY_FULL_CHARGED 0x20
> +#define ASUSEC_BATTERY_NOT_CHARGING 0x10
> +
> +#define TEMP_CELSIUS_OFFSET 2731
> +
> +struct asus_ec_battery_data {
> + const struct asusec_info *ec;
> + struct power_supply *battery;
> + struct power_supply_desc psy_desc;
> + struct delayed_work poll_work;
> + struct mutex battery_lock; /* for data refresh */
> + unsigned long batt_data_ts;
> + int last_state;
> + u8 batt_data[DOCKRAM_ENTRY_BUFSIZE];
> +};
> +
> +static int asus_ec_battery_refresh(struct asus_ec_battery_data *priv)
> +{
> + int ret = 0;
> +
> + guard(mutex)(&priv->battery_lock);
> +
> + if (time_before(jiffies, priv->batt_data_ts))
> + return ret;
> +
> + ret = asus_dockram_read(priv->ec->dockram, ASUSEC_DOCKRAM_BATT_CTL,
> + priv->batt_data);
> + if (ret < 0)
> + return ret;
> +
> + priv->batt_data_ts = jiffies +
> + msecs_to_jiffies(ASUSEC_BATTERY_DATA_FRESH_MSEC);
> +
> + return ret;
> +}
> +
> +static enum power_supply_property asus_ec_battery_properties[] = {
> + POWER_SUPPLY_PROP_STATUS,
> + POWER_SUPPLY_PROP_VOLTAGE_MAX,
> + POWER_SUPPLY_PROP_CURRENT_MAX,
> + POWER_SUPPLY_PROP_TEMP,
> + POWER_SUPPLY_PROP_VOLTAGE_NOW,
> + POWER_SUPPLY_PROP_CURRENT_NOW,
> + POWER_SUPPLY_PROP_CAPACITY,
> + POWER_SUPPLY_PROP_CHARGE_NOW,
> + POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
> + POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
> + POWER_SUPPLY_PROP_PRESENT,
> +};
> +
> +static const unsigned int asus_ec_battery_prop_offs[] = {
> + [POWER_SUPPLY_PROP_STATUS] = 1,
> + [POWER_SUPPLY_PROP_VOLTAGE_MAX] = 3,
> + [POWER_SUPPLY_PROP_CURRENT_MAX] = 5,
> + [POWER_SUPPLY_PROP_TEMP] = 7,
> + [POWER_SUPPLY_PROP_VOLTAGE_NOW] = 9,
> + [POWER_SUPPLY_PROP_CURRENT_NOW] = 11,
> + [POWER_SUPPLY_PROP_CAPACITY] = 13,
> + [POWER_SUPPLY_PROP_CHARGE_NOW] = 15,
> + [POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW] = 17,
> + [POWER_SUPPLY_PROP_TIME_TO_FULL_NOW] = 19,
> +};
> +
> +static int asus_ec_battery_get_value(struct asus_ec_battery_data *priv,
> + enum power_supply_property psp)
> +{
> + int ret, offs;
> +
> + if (psp >= ARRAY_SIZE(asus_ec_battery_prop_offs))
> + return -EINVAL;
> +
> + offs = asus_ec_battery_prop_offs[psp];
> + if (!offs)
> + return -EINVAL;
> +
> + ret = asus_ec_battery_refresh(priv);
> + if (ret < 0)
> + return ret;
> +
> + if (offs >= priv->batt_data[0])
> + return -ENODATA;
> +
> + return get_unaligned_le16(priv->batt_data + offs);
> +}
> +
> +static int asus_ec_battery_get_property(struct power_supply *psy,
> + enum power_supply_property psp,
> + union power_supply_propval *val)
> +{
> + struct asus_ec_battery_data *priv = power_supply_get_drvdata(psy);
> + int ret;
> +
> + switch (psp) {
> + case POWER_SUPPLY_PROP_PRESENT:
> + val->intval = 1;
> + break;
> +
> + default:
> + ret = asus_ec_battery_get_value(priv, psp);
> + if (ret < 0)
> + return ret;
> +
> + val->intval = (s16)ret;
> +
> + switch (psp) {
> + case POWER_SUPPLY_PROP_STATUS:
> + if (ret & ASUSEC_BATTERY_FULL_CHARGED)
> + val->intval = POWER_SUPPLY_STATUS_FULL;
> + else if (ret & ASUSEC_BATTERY_NOT_CHARGING)
> + val->intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
> + else if (ret & ASUSEC_BATTERY_DISCHARGING)
> + val->intval = POWER_SUPPLY_STATUS_DISCHARGING;
> + else
> + val->intval = POWER_SUPPLY_STATUS_CHARGING;
> + break;
> +
> + case POWER_SUPPLY_PROP_TEMP:
> + val->intval -= TEMP_CELSIUS_OFFSET;
> + break;
> +
> + case POWER_SUPPLY_PROP_CHARGE_NOW:
> + case POWER_SUPPLY_PROP_CURRENT_NOW:
> + case POWER_SUPPLY_PROP_CURRENT_MAX:
> + case POWER_SUPPLY_PROP_VOLTAGE_NOW:
> + case POWER_SUPPLY_PROP_VOLTAGE_MAX:
> + val->intval *= 1000;
> + break;
> +
> + case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
> + case POWER_SUPPLY_PROP_TIME_TO_FULL_NOW:
> + val->intval *= 60;
> + break;
> +
> + default:
> + break;
> + }
> +
> + break;
> + }
> +
> + return 0;
> +}
> +
> +static void asus_ec_battery_poll_work(struct work_struct *work)
> +{
> + struct asus_ec_battery_data *priv =
> + container_of(work, struct asus_ec_battery_data, poll_work.work);
> + int state;
> +
> + state = asus_ec_battery_get_value(priv, POWER_SUPPLY_PROP_STATUS);
> + if (state < 0)
> + return;
> +
> + if (state & ASUSEC_BATTERY_FULL_CHARGED)
> + state = POWER_SUPPLY_STATUS_FULL;
> + else if (state & ASUSEC_BATTERY_DISCHARGING)
> + state = POWER_SUPPLY_STATUS_DISCHARGING;
> + else
> + state = POWER_SUPPLY_STATUS_CHARGING;
> +
> + if (priv->last_state != state) {
> + priv->last_state = state;
> + power_supply_changed(priv->battery);
> + }
> +
> + /* continuously send uevent notification */
> + schedule_delayed_work(&priv->poll_work,
> + msecs_to_jiffies(ASUSEC_BATTERY_DATA_FRESH_MSEC));
> +}
> +
> +static const struct power_supply_desc asus_ec_battery_desc = {
> + .name = "asus-ec-battery",
> + .type = POWER_SUPPLY_TYPE_BATTERY,
> + .properties = asus_ec_battery_properties,
> + .num_properties = ARRAY_SIZE(asus_ec_battery_properties),
> + .get_property = asus_ec_battery_get_property,
> + .external_power_changed = power_supply_changed,
> +};
> +
> +static int asus_ec_battery_probe(struct platform_device *pdev)
> +{
> + struct asus_ec_battery_data *priv;
> + struct device *dev = &pdev->dev;
> + struct power_supply_config cfg = { };
> + int ret;
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + platform_set_drvdata(pdev, priv);
> +
> + mutex_init(&priv->battery_lock);
> +
> + priv->ec = cell_to_ec(pdev);
> + priv->batt_data_ts = jiffies - 1;
> + priv->last_state = POWER_SUPPLY_STATUS_UNKNOWN;
> +
> + cfg.fwnode = dev_fwnode(dev->parent);
> + cfg.drv_data = priv;
> +
> + memcpy(&priv->psy_desc, &asus_ec_battery_desc, sizeof(priv->psy_desc));
> + priv->psy_desc.name = devm_kasprintf(dev, GFP_KERNEL, "%s-battery",
> + priv->ec->name);
> +
> + priv->battery = devm_power_supply_register(dev, &priv->psy_desc, &cfg);
> + if (IS_ERR(priv->battery))
> + return dev_err_probe(dev, PTR_ERR(priv->battery),
> + "Failed to register power supply\n");
> +
> + ret = devm_delayed_work_autocancel(dev, &priv->poll_work,
> + asus_ec_battery_poll_work);
> + if (ret)
> + return ret;
> +
> + schedule_delayed_work(&priv->poll_work,
> + msecs_to_jiffies(ASUSEC_BATTERY_DATA_FRESH_MSEC));
> +
> + return 0;
> +}
> +
> +static int __maybe_unused asus_ec_battery_suspend(struct device *dev)
> +{
> + struct asus_ec_battery_data *priv = dev_get_drvdata(dev);
> +
> + cancel_delayed_work_sync(&priv->poll_work);
> +
> + return 0;
> +}
> +
> +static int __maybe_unused asus_ec_battery_resume(struct device *dev)
> +{
> + struct asus_ec_battery_data *priv = dev_get_drvdata(dev);
> +
> + schedule_delayed_work(&priv->poll_work,
> + msecs_to_jiffies(ASUSEC_BATTERY_DATA_FRESH_MSEC));
> +
> + return 0;
> +}
> +
> +static SIMPLE_DEV_PM_OPS(asus_ec_battery_pm_ops,
> + asus_ec_battery_suspend, asus_ec_battery_resume);
> +
> +static struct platform_driver asus_ec_battery_driver = {
> + .driver = {
> + .name = "asus-transformer-ec-battery",
> + .pm = &asus_ec_battery_pm_ops,
> + },
> + .probe = asus_ec_battery_probe,
> +};
> +module_platform_driver(asus_ec_battery_driver);
> +
> +MODULE_AUTHOR("Michał Mirosław <mirq-linux@rere.qmqm.pl>");
> +MODULE_AUTHOR("Svyatoslav Ryhel <clamor95@gmail.com>");
> +MODULE_DESCRIPTION("ASUS Transformer's battery driver");
> +MODULE_LICENSE("GPL");
> --
> 2.51.0
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH] xpad: expose xinput capabilities via sysattr
From: Sanjay Govind @ 2026-03-11 5:47 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Vicki Pfau, Mario Limonciello, Nilton Perim Neto,
Pierre-Loup A. Griffais, linux-input, linux-kernel
In-Reply-To: <CALQgdA1jJUzpSvva-YM3UOvK2Cwtyb3sK7uQO8T5NxZ-OB4Y_Q@mail.gmail.com>
On Wed, Mar 4, 2026 at 2:34 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> You need to start with enumerating what data is currently not available
> through other means and why it is needed. Is this something that other
> gamepad-like devices also lack?
Thinking about this some more, I think what I'm really after is just a
generic way for an app to request a vendor-defined report from a
controller, so that libraries like SDL can better request the
capabilities of a device when trying to handle devices properly. As it
stands, PS4, PS5, OG Xbox, Xbox 360 and Xbox One all have vendor
defined reports that can be fetched for describing controller
information, but only PS4 and PS5 actually even give something like
SDL the ability to fetch that data right now because they can just do
hid feature report reads to get it, while the Xbox controllers don't
use HID and thus we need to expose that from the input layer.
^ permalink raw reply
* Re: [PATCH 07/12] HID: spi_hid: add ACPI support for SPI over HID
From: Dmitry Torokhov @ 2026-03-11 5:27 UTC (permalink / raw)
To: Jingyuan Liang
Cc: Jiri Kosina, Benjamin Tissoires, Jonathan Corbet, Mark Brown,
Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-input, linux-doc,
linux-kernel, linux-spi, linux-trace-kernel, devicetree, hbarnor,
Angela Czubak
In-Reply-To: <20260303-send-upstream-v1-7-1515ba218f3d@chromium.org>
On Tue, Mar 03, 2026 at 06:12:59AM +0000, Jingyuan Liang wrote:
> From: Angela Czubak <acz@semihalf.com>
>
> Detect SPI HID devices described in ACPI.
>
> Signed-off-by: Angela Czubak <acz@semihalf.com>
> Signed-off-by: Jingyuan Liang <jingyliang@chromium.org>
> ---
> drivers/hid/spi-hid/Kconfig | 15 +++
> drivers/hid/spi-hid/Makefile | 1 +
> drivers/hid/spi-hid/spi-hid-acpi.c | 253 +++++++++++++++++++++++++++++++++++++
> drivers/hid/spi-hid/spi-hid-core.c | 27 +---
> drivers/hid/spi-hid/spi-hid.h | 44 +++++++
> 5 files changed, 316 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/hid/spi-hid/Kconfig b/drivers/hid/spi-hid/Kconfig
> index 836fdefe8345..114b1e00da39 100644
> --- a/drivers/hid/spi-hid/Kconfig
> +++ b/drivers/hid/spi-hid/Kconfig
> @@ -10,6 +10,21 @@ menuconfig SPI_HID
>
> if SPI_HID
>
> +config SPI_HID_ACPI
> + tristate "HID over SPI transport layer ACPI driver"
> + depends on ACPI
> + select SPI_HID_CORE
> + help
> + Say Y here if you use a keyboard, a touchpad, a touchscreen, or any
> + other HID based devices which are connected to your computer via SPI.
> + This driver supports ACPI-based systems.
> +
> + If unsure, say N.
> +
> + This support is also available as a module. If so, the module
> + will be called spi-hid-acpi. It will also build/depend on the
> + module spi-hid.
> +
> config SPI_HID_CORE
> tristate
> endif
> diff --git a/drivers/hid/spi-hid/Makefile b/drivers/hid/spi-hid/Makefile
> index 92e24cddbfc2..753c7b7a7844 100644
> --- a/drivers/hid/spi-hid/Makefile
> +++ b/drivers/hid/spi-hid/Makefile
> @@ -7,3 +7,4 @@
>
> obj-$(CONFIG_SPI_HID_CORE) += spi-hid.o
> spi-hid-objs = spi-hid-core.o
> +obj-$(CONFIG_SPI_HID_ACPI) += spi-hid-acpi.o
> diff --git a/drivers/hid/spi-hid/spi-hid-acpi.c b/drivers/hid/spi-hid/spi-hid-acpi.c
> new file mode 100644
> index 000000000000..612e74fe72f9
> --- /dev/null
> +++ b/drivers/hid/spi-hid/spi-hid-acpi.c
> @@ -0,0 +1,253 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * HID over SPI protocol, ACPI related code
> + *
> + * Copyright (c) 2021 Microsoft Corporation
> + * Copyright (c) 2026 Google LLC
> + *
> + * This code was forked out of the HID over SPI core code, which is partially
> + * based on "HID over I2C protocol implementation:
> + *
> + * Copyright (c) 2012 Benjamin Tissoires <benjamin.tissoires@gmail.com>
> + * Copyright (c) 2012 Ecole Nationale de l'Aviation Civile, France
> + * Copyright (c) 2012 Red Hat, Inc
> + *
> + * which in turn is partially based on "USB HID support for Linux":
> + *
> + * Copyright (c) 1999 Andreas Gal
> + * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
> + * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
> + * Copyright (c) 2007-2008 Oliver Neukum
> + * Copyright (c) 2006-2010 Jiri Kosina
> + */
> +
> +#include <linux/acpi.h>
> +#include <linux/delay.h>
> +#include <linux/device.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/reset.h>
> +#include <linux/uuid.h>
> +
> +#include "spi-hid.h"
> +
> +/* Config structure is filled with data from ACPI */
> +struct spi_hid_acpi_config {
> + struct spihid_ops ops;
> +
> + struct spi_hid_conf property_conf;
> + u32 post_power_on_delay_ms;
> + u32 minimal_reset_delay_ms;
> + struct acpi_device *adev;
> +};
> +
> +/* HID SPI Device: 6e2ac436-0fcf41af-a265-b32a220dcfab */
> +static guid_t spi_hid_guid =
> + GUID_INIT(0x6E2AC436, 0x0FCF, 0x41AF,
> + 0xA2, 0x65, 0xB3, 0x2A, 0x22, 0x0D, 0xCF, 0xAB);
> +
> +static int spi_hid_acpi_populate_config(struct spi_hid_acpi_config *conf,
> + struct acpi_device *adev)
> +{
> + acpi_handle handle = acpi_device_handle(adev);
> + union acpi_object *obj;
> +
> + conf->adev = adev;
> +
> + /* Revision 3 for HID over SPI V1, see specification. */
> + obj = acpi_evaluate_dsm_typed(handle, &spi_hid_guid, 3, 1, NULL,
> + ACPI_TYPE_INTEGER);
> + if (!obj) {
> + acpi_handle_err(handle,
> + "Error _DSM call to get HID input report header address failed");
> + return -ENODEV;
> + }
> + conf->property_conf.input_report_header_address = obj->integer.value;
> + ACPI_FREE(obj);
> +
> + obj = acpi_evaluate_dsm_typed(handle, &spi_hid_guid, 3, 2, NULL,
> + ACPI_TYPE_INTEGER);
> + if (!obj) {
> + acpi_handle_err(handle,
> + "Error _DSM call to get HID input report body address failed");
> + return -ENODEV;
> + }
> + conf->property_conf.input_report_body_address = obj->integer.value;
> + ACPI_FREE(obj);
> +
> + obj = acpi_evaluate_dsm_typed(handle, &spi_hid_guid, 3, 3, NULL,
> + ACPI_TYPE_INTEGER);
> + if (!obj) {
> + acpi_handle_err(handle,
> + "Error _DSM call to get HID output report header address failed");
> + return -ENODEV;
> + }
> + conf->property_conf.output_report_address = obj->integer.value;
> + ACPI_FREE(obj);
> +
> + obj = acpi_evaluate_dsm_typed(handle, &spi_hid_guid, 3, 4, NULL,
> + ACPI_TYPE_BUFFER);
> + if (!obj) {
> + acpi_handle_err(handle,
> + "Error _DSM call to get HID read opcode failed");
> + return -ENODEV;
> + }
> + if (obj->buffer.length == 1) {
> + conf->property_conf.read_opcode = obj->buffer.pointer[0];
> + } else {
> + acpi_handle_err(handle,
> + "Error _DSM call to get HID read opcode, too long buffer");
> + ACPI_FREE(obj);
> + return -ENODEV;
> + }
> + ACPI_FREE(obj);
> +
> + obj = acpi_evaluate_dsm_typed(handle, &spi_hid_guid, 3, 5, NULL,
> + ACPI_TYPE_BUFFER);
> + if (!obj) {
> + acpi_handle_err(handle,
> + "Error _DSM call to get HID write opcode failed");
> + return -ENODEV;
> + }
> + if (obj->buffer.length == 1) {
> + conf->property_conf.write_opcode = obj->buffer.pointer[0];
> + } else {
> + acpi_handle_err(handle,
> + "Error _DSM call to get HID write opcode, too long buffer");
> + ACPI_FREE(obj);
> + return -ENODEV;
> + }
> + ACPI_FREE(obj);
> +
> + /* Value not provided in ACPI,*/
> + conf->post_power_on_delay_ms = 5;
> + conf->minimal_reset_delay_ms = 150;
> +
> + if (!acpi_has_method(handle, "_RST")) {
> + acpi_handle_err(handle, "No reset method for acpi handle");
> + return -ENODEV;
I would return -EINVAL as we have the device with right _DSM but without
mandated by the spec _RST.
> + }
> +
> + /* FIXME: not reading hid-over-spi-flags, multi-SPI not supported */
> +
> + return 0;
> +}
> +
> +static int spi_hid_acpi_power_none(struct spihid_ops *ops)
> +{
> + return 0;
> +}
> +
> +static int spi_hid_acpi_power_down(struct spihid_ops *ops)
> +{
> + struct spi_hid_acpi_config *conf = container_of(ops,
> + struct spi_hid_acpi_config,
> + ops);
> +
> + return acpi_device_set_power(conf->adev, ACPI_STATE_D3);
> +}
> +
> +static int spi_hid_acpi_power_up(struct spihid_ops *ops)
> +{
> + struct spi_hid_acpi_config *conf = container_of(ops,
> + struct spi_hid_acpi_config,
> + ops);
> + int error;
> +
> + error = acpi_device_set_power(conf->adev, ACPI_STATE_D0);
> + if (error) {
> + dev_err(&conf->adev->dev, "Error could not power up ACPI device: %d.", error);
> + return error;
> + }
> +
> + if (conf->post_power_on_delay_ms)
> + msleep(conf->post_power_on_delay_ms);
> +
> + return 0;
> +}
> +
> +static int spi_hid_acpi_assert_reset(struct spihid_ops *ops)
> +{
> + return 0;
> +}
> +
> +static int spi_hid_acpi_deassert_reset(struct spihid_ops *ops)
> +{
> + struct spi_hid_acpi_config *conf = container_of(ops,
> + struct spi_hid_acpi_config,
> + ops);
> +
> + return device_reset(&conf->adev->dev);
> +}
> +
> +static void spi_hid_acpi_sleep_minimal_reset_delay(struct spihid_ops *ops)
> +{
> + struct spi_hid_acpi_config *conf = container_of(ops,
> + struct spi_hid_acpi_config,
> + ops);
> + usleep_range(1000 * conf->minimal_reset_delay_ms,
> + 1000 * (conf->minimal_reset_delay_ms + 1));
I'd probably use "fsleep(conf->minimal_reset_delay_ms * 1000)".
> +}
> +
> +static int spi_hid_acpi_probe(struct spi_device *spi)
> +{
> + struct device *dev = &spi->dev;
> + struct acpi_device *adev;
> + struct spi_hid_acpi_config *config;
> + int error;
> +
> + adev = ACPI_COMPANION(dev);
> + if (!adev) {
> + dev_err(dev, "Error could not get ACPI device.");
> + return -ENODEV;
> + }
> +
> + config = devm_kzalloc(dev, sizeof(struct spi_hid_acpi_config),
> + GFP_KERNEL);
> + if (!config)
> + return -ENOMEM;
> +
> + if (acpi_device_power_manageable(adev)) {
> + config->ops.power_up = spi_hid_acpi_power_up;
> + config->ops.power_down = spi_hid_acpi_power_down;
> + } else {
> + config->ops.power_up = spi_hid_acpi_power_none;
> + config->ops.power_down = spi_hid_acpi_power_none;
> + }
> + config->ops.assert_reset = spi_hid_acpi_assert_reset;
> + config->ops.deassert_reset = spi_hid_acpi_deassert_reset;
> + config->ops.sleep_minimal_reset_delay =
> + spi_hid_acpi_sleep_minimal_reset_delay;
> +
> + error = spi_hid_acpi_populate_config(config, adev);
> + if (error) {
> + dev_err(dev, "%s: unable to populate config data.", __func__);
> + return error;
> + }
I would add a blank line.
> + return spi_hid_core_probe(spi, &config->ops, &config->property_conf);
> +}
> +
> +static const struct acpi_device_id spi_hid_acpi_match[] = {
> + { "ACPI0C51", 0 },
> + { "PNP0C51", 0 },
> + { },
No comma on sentinels.
> +};
> +MODULE_DEVICE_TABLE(acpi, spi_hid_acpi_match);
> +
> +static struct spi_driver spi_hid_acpi_driver = {
> + .driver = {
> + .name = "spi_hid_acpi",
> + .owner = THIS_MODULE,
> + .acpi_match_table = ACPI_PTR(spi_hid_acpi_match),
This is dependent on ACPI, so no need to sue ACPI_PTR().
> + .probe_type = PROBE_PREFER_ASYNCHRONOUS,
> + .dev_groups = spi_hid_groups,
> + },
> + .probe = spi_hid_acpi_probe,
> + .remove = spi_hid_core_remove,
> +};
> +
> +module_spi_driver(spi_hid_acpi_driver);
> +
> +MODULE_DESCRIPTION("HID over SPI ACPI transport driver");
> +MODULE_AUTHOR("Angela Czubak <aczubak@google.com>");
> +MODULE_LICENSE("GPL");
> diff --git a/drivers/hid/spi-hid/spi-hid-core.c b/drivers/hid/spi-hid/spi-hid-core.c
> index e3273846267e..02beb209a92d 100644
> --- a/drivers/hid/spi-hid/spi-hid-core.c
> +++ b/drivers/hid/spi-hid/spi-hid-core.c
> @@ -43,6 +43,9 @@
> #include <linux/wait.h>
> #include <linux/workqueue.h>
>
> +#include "spi-hid.h"
> +#include "spi-hid-core.h"
> +
> /* Protocol constants */
> #define SPI_HID_READ_APPROVAL_CONSTANT 0xff
> #define SPI_HID_INPUT_HEADER_SYNC_BYTE 0x5a
> @@ -105,30 +108,6 @@ struct spi_hid_output_report {
> u8 *content;
> };
>
> -/* struct spi_hid_conf - Conf provided to the core */
> -struct spi_hid_conf {
> - u32 input_report_header_address;
> - u32 input_report_body_address;
> - u32 output_report_address;
> - u8 read_opcode;
> - u8 write_opcode;
> -};
> -
> -/**
> - * struct spihid_ops - Ops provided to the core
> - * @power_up: do sequencing to power up the device
> - * @power_down: do sequencing to power down the device
> - * @assert_reset: do sequencing to assert the reset line
> - * @deassert_reset: do sequencing to deassert the reset line
> - */
> -struct spihid_ops {
> - int (*power_up)(struct spihid_ops *ops);
> - int (*power_down)(struct spihid_ops *ops);
> - int (*assert_reset)(struct spihid_ops *ops);
> - int (*deassert_reset)(struct spihid_ops *ops);
> - void (*sleep_minimal_reset_delay)(struct spihid_ops *ops);
> -};
> -
> static struct hid_ll_driver spi_hid_ll_driver;
>
> static void spi_hid_populate_read_approvals(const struct spi_hid_conf *conf,
> diff --git a/drivers/hid/spi-hid/spi-hid.h b/drivers/hid/spi-hid/spi-hid.h
> new file mode 100644
> index 000000000000..1fdd45262647
> --- /dev/null
> +++ b/drivers/hid/spi-hid/spi-hid.h
> @@ -0,0 +1,44 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (c) 2021 Microsoft Corporation
> + * Copyright (c) 2026 Google LLC
> + */
> +
> +#ifndef SPI_HID_H
> +#define SPI_HID_H
> +
> +#include <linux/spi/spi.h>
> +#include <linux/sysfs.h>
> +
> +/* struct spi_hid_conf - Conf provided to the core */
> +struct spi_hid_conf {
> + u32 input_report_header_address;
> + u32 input_report_body_address;
> + u32 output_report_address;
> + u8 read_opcode;
> + u8 write_opcode;
> +};
> +
> +/**
> + * struct spihid_ops - Ops provided to the core
> + * @power_up: do sequencing to power up the device
> + * @power_down: do sequencing to power down the device
> + * @assert_reset: do sequencing to assert the reset line
> + * @deassert_reset: do sequencing to deassert the reset line
> + */
> +struct spihid_ops {
> + int (*power_up)(struct spihid_ops *ops);
> + int (*power_down)(struct spihid_ops *ops);
> + int (*assert_reset)(struct spihid_ops *ops);
> + int (*deassert_reset)(struct spihid_ops *ops);
> + void (*sleep_minimal_reset_delay)(struct spihid_ops *ops);
> +};
> +
> +int spi_hid_core_probe(struct spi_device *spi, struct spihid_ops *ops,
> + struct spi_hid_conf *conf);
> +
> +void spi_hid_core_remove(struct spi_device *spi);
> +
> +extern const struct attribute_group *spi_hid_groups[];
> +
> +#endif /* SPI_HID_H */
I am not sure if this belongs to this patch or if it should be better in
the patch introducing the main driver from the beginning.
For the ACPI part:
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 15/61] trace: Prefer IS_ERR_OR_NULL over manual NULL check
From: Masami Hiramatsu @ 2026-03-11 5:13 UTC (permalink / raw)
To: Steven Rostedt
Cc: Philipp Hahn, amd-gfx, apparmor, bpf, ceph-devel, cocci, dm-devel,
dri-devel, gfs2, intel-gfx, intel-wired-lan, iommu, kvm,
linux-arm-kernel, linux-block, linux-bluetooth, linux-btrfs,
linux-cifs, linux-clk, linux-erofs, linux-ext4, linux-fsdevel,
linux-gpio, linux-hyperv, linux-input, linux-kernel, linux-leds,
linux-media, linux-mips, linux-mm, linux-modules, linux-mtd,
linux-nfs, linux-omap, linux-phy, linux-pm, linux-rockchip,
linux-s390, linux-scsi, linux-sctp, linux-security-module,
linux-sh, linux-sound, linux-stm32, linux-trace-kernel, linux-usb,
linux-wireless, netdev, ntfs3, samba-technical, sched-ext,
target-devel, tipc-discussion, v9fs, Masami Hiramatsu,
Mathieu Desnoyers
In-Reply-To: <20260310100750.303af303@gandalf.local.home>
On Tue, 10 Mar 2026 10:07:50 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Tue, 10 Mar 2026 12:48:41 +0100
> Philipp Hahn <phahn-oss@avm.de> wrote:
>
> > Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> > check.
>
> Why?
>
> >
> > Change generated with coccinelle.
> >
> > To: Steven Rostedt <rostedt@goodmis.org>
> > To: Masami Hiramatsu <mhiramat@kernel.org>
> > To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
> > Cc: linux-kernel@vger.kernel.org
> > Cc: linux-trace-kernel@vger.kernel.org
> > Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> > ---
> > kernel/trace/fprobe.c | 2 +-
> > kernel/trace/kprobe_event_gen_test.c | 2 +-
> > kernel/trace/trace_events_hist.c | 2 +-
> > 3 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/kernel/trace/fprobe.c b/kernel/trace/fprobe.c
> > index dcadf1d23b8a31f571392d0c49cbd22df1716b4f..a94ce810d83b90f55d1178a9bd29c78fd068df4c 100644
> > --- a/kernel/trace/fprobe.c
> > +++ b/kernel/trace/fprobe.c
> > @@ -607,7 +607,7 @@ static int fprobe_module_callback(struct notifier_block *nb,
> > do {
> > rhashtable_walk_start(&iter);
> >
> > - while ((node = rhashtable_walk_next(&iter)) && !IS_ERR(node))
> > + while (!IS_ERR_OR_NULL((node = rhashtable_walk_next(&iter))))
>
> Ug, No!
>
> That looks so much worse than the original.
Hmm, now IS_ERR_OR_NULL() is an inline function, so it is safe.
But if you want to use IS_ERR_OR_NULL() here, it will be better something like
node = rhashtable_walk_next(&iter);
while (!IS_ERR_OR_NULL(node)) {
fprobe_remove_node_in_module(mod, node, &alist);
node = rhashtable_walk_next(&iter);
}
Thanks,
>
> -- Steve
>
> > fprobe_remove_node_in_module(mod, node, &alist);
> >
> > rhashtable_walk_stop(&iter);
> > diff --git a/kernel/trace/kprobe_event_gen_test.c b/kernel/trace/kprobe_event_gen_test.c
> > index 5a4b722b50451bfdee42769a6d3be39c055690d1..a1735ca273f0b756aa1fcfcdab30ddad9bc51c5f 100644
> > --- a/kernel/trace/kprobe_event_gen_test.c
> > +++ b/kernel/trace/kprobe_event_gen_test.c
> > @@ -75,7 +75,7 @@ static struct trace_event_file *gen_kretprobe_test;
> >
> > static bool trace_event_file_is_valid(struct trace_event_file *input)
> > {
> > - return input && !IS_ERR(input);
> > + return !IS_ERR_OR_NULL(input);
> > }
> >
> > /*
> > diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
> > index 73ea180cad555898693e92ee397a1c9493c7c167..59df215e1dfd9349eca1c0823ed709ec7285f766 100644
> > --- a/kernel/trace/trace_events_hist.c
> > +++ b/kernel/trace/trace_events_hist.c
> > @@ -3973,7 +3973,7 @@ trace_action_create_field_var(struct hist_trigger_data *hist_data,
> > */
> > field_var = create_target_field_var(hist_data, system, event, var);
> >
> > - if (field_var && !IS_ERR(field_var)) {
> > + if (!IS_ERR_OR_NULL(field_var)) {
> > save_field_var(hist_data, field_var);
> > hist_field = field_var->var;
> > } else {
> >
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply
* Re: [PATCH 02/12] HID: Add BUS_SPI support and define HID_SPI_DEVICE macro
From: Dmitry Torokhov @ 2026-03-11 5:11 UTC (permalink / raw)
To: Jingyuan Liang
Cc: Jiri Kosina, Benjamin Tissoires, Jonathan Corbet, Mark Brown,
Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-input, linux-doc,
linux-kernel, linux-spi, linux-trace-kernel, devicetree, hbarnor,
Jarrett Schultz, Dmitry Antipov
In-Reply-To: <20260303-send-upstream-v1-2-1515ba218f3d@chromium.org>
On Tue, Mar 03, 2026 at 06:12:54AM +0000, Jingyuan Liang wrote:
> From: Jarrett Schultz <jaschultz@microsoft.com>
>
> If connecting a hid_device with bus field indicating BUS_SPI print out
> "SPI" in the debug print.
>
> Macro sets the bus field to BUS_SPI and uses arguments to set vendor
> product fields.
>
> Signed-off-by: Dmitry Antipov <dmanti@microsoft.com>
> Signed-off-by: Jingyuan Liang <jingyliang@chromium.org>
> ---
> drivers/hid/hid-core.c | 3 +++
> include/linux/hid.h | 2 ++
> 2 files changed, 5 insertions(+)
>
> diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
> index a5b3a8ca2fcb..813c9c743ccd 100644
> --- a/drivers/hid/hid-core.c
> +++ b/drivers/hid/hid-core.c
> @@ -2316,6 +2316,9 @@ int hid_connect(struct hid_device *hdev, unsigned int connect_mask)
> case BUS_I2C:
> bus = "I2C";
> break;
> + case BUS_SPI:
> + bus = "SPI";
> + break;
> case BUS_SDW:
> bus = "SOUNDWIRE";
> break;
> diff --git a/include/linux/hid.h b/include/linux/hid.h
> index dce862cafbbd..957f322a0ebd 100644
> --- a/include/linux/hid.h
> +++ b/include/linux/hid.h
> @@ -786,6 +786,8 @@ struct hid_descriptor {
> .bus = BUS_BLUETOOTH, .vendor = (ven), .product = (prod)
> #define HID_I2C_DEVICE(ven, prod) \
> .bus = BUS_I2C, .vendor = (ven), .product = (prod)
> +#define HID_SPI_DEVICE(ven, prod) \
> + .bus = BUS_SPI, .vendor = (ven), .product = (prod)
>
> #define HID_REPORT_ID(rep) \
> .report_type = (rep)
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 01/12] Documentation: Correction in HID output_report callback description.
From: Dmitry Torokhov @ 2026-03-11 5:10 UTC (permalink / raw)
To: Jingyuan Liang
Cc: Jiri Kosina, Benjamin Tissoires, Jonathan Corbet, Mark Brown,
Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-input, linux-doc,
linux-kernel, linux-spi, linux-trace-kernel, devicetree, hbarnor,
Jarrett Schultz, Dmitry Antipov
In-Reply-To: <20260303-send-upstream-v1-1-1515ba218f3d@chromium.org>
On Tue, Mar 03, 2026 at 06:12:53AM +0000, Jingyuan Liang wrote:
> From: Jarrett Schultz <jaschultz@microsoft.com>
>
> Originally output_report callback was described as must-be asynchronous,
> but that is not the case in some implementations, namely i2c-hid.
> Correct the documentation to say that it may be asynchronous.
>
> Signed-off-by: Dmitry Antipov <dmanti@microsoft.com>
> Signed-off-by: Jingyuan Liang <jingyliang@chromium.org>
> ---
> Documentation/hid/hid-transport.rst | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/hid/hid-transport.rst b/Documentation/hid/hid-transport.rst
> index 6f1692da296c..2008cf432af1 100644
> --- a/Documentation/hid/hid-transport.rst
> +++ b/Documentation/hid/hid-transport.rst
> @@ -327,8 +327,8 @@ The available HID callbacks are:
>
> Send raw output report via intr channel. Used by some HID device drivers
> which require high throughput for outgoing requests on the intr channel. This
> - must not cause SET_REPORT calls! This must be implemented as asynchronous
> - output report on the intr channel!
> + must not cause SET_REPORT calls! This call might be asynchronous, so the
> + caller should not expect an immediate response!
Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 57/61] reset: Prefer IS_ERR_OR_NULL over manual NULL check
From: Masami Hiramatsu @ 2026-03-11 4:59 UTC (permalink / raw)
To: Philipp Hahn
Cc: amd-gfx, apparmor, bpf, ceph-devel, cocci, dm-devel, dri-devel,
gfs2, intel-gfx, intel-wired-lan, iommu, kvm, linux-arm-kernel,
linux-block, linux-bluetooth, linux-btrfs, linux-cifs, linux-clk,
linux-erofs, linux-ext4, linux-fsdevel, linux-gpio, linux-hyperv,
linux-input, linux-kernel, linux-leds, linux-media, linux-mips,
linux-mm, linux-modules, linux-mtd, linux-nfs, linux-omap,
linux-phy, linux-pm, linux-rockchip, linux-s390, linux-scsi,
linux-sctp, linux-security-module, linux-sh, linux-sound,
linux-stm32, linux-trace-kernel, linux-usb, linux-wireless,
netdev, ntfs3, samba-technical, sched-ext, target-devel,
tipc-discussion, v9fs, Philipp Zabel
In-Reply-To: <20260310-b4-is_err_or_null-v1-57-bd63b656022d@avm.de>
On Tue, 10 Mar 2026 12:49:23 +0100
Philipp Hahn <phahn-oss@avm.de> wrote:
> Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
> check.
>
> Semantich change: Previously the code only printed the warning on error,
> but not when the pointer was NULL. Now the warning is printed in both
> cases!
>
> Change found with coccinelle.
>
> To: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Philipp Hahn <phahn-oss@avm.de>
> ---
> drivers/reset/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> index fceec45c8afc1e74fe46311bdc023ff257e8d770..649bb4ebabb20a09349ccbfc62f8280621df450e 100644
> --- a/drivers/reset/core.c
> +++ b/drivers/reset/core.c
> @@ -715,7 +715,7 @@ EXPORT_SYMBOL_GPL(reset_control_bulk_acquire);
> */
> void reset_control_release(struct reset_control *rstc)
> {
> - if (!rstc || WARN_ON(IS_ERR(rstc)))
> + if (WARN_ON(IS_ERR_OR_NULL(rstc)))
This changes the behavior when rstc == NULL.
WARN_ON does not hit when rstc == NULL in the original code.
Thanks,
> return;
>
> if (reset_control_is_array(rstc))
>
> --
> 2.43.0
>
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply
* Re: [PATCH v4 1/2] dt-bindings: input: touchscreen:
From: phucduc.bui @ 2026-03-11 4:28 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, linux-kernel, phucduc.bui
In-Reply-To: <abCx6kZkHPd3lYh9@google.com>
Hi Dmitry,
Thank you for applying the patch.
Best regards,
Phuc
^ permalink raw reply
* Re: [PATCH v4 1/2] dt-bindings: input: touchscreen:
From: phucduc.bui @ 2026-03-11 4:25 UTC (permalink / raw)
To: dmitry.torokhov
Cc: conor+dt, devicetree, geert+renesas, hechtb, javier.carrasco,
jeff, krzk+dt, krzk, krzysztof.kozlowski, linux-input,
linux-kernel, linux-renesas-soc, magnus.damm, phucduc.bui, robh,
wsa+renesas
In-Reply-To: <abCqyU2-iQgcghzy@google.com>
Hi Dmitry,
Thank you for applying the patch.
Best regards,
Phuc
^ permalink raw reply
* Re: [PATCH v4 2/2] arm: dts: renesas: r8a7740-armadillo800eva:
From: phucduc.bui @ 2026-03-11 4:22 UTC (permalink / raw)
To: wsa+renesas
Cc: conor+dt, devicetree, dmitry.torokhov, geert+renesas, hechtb,
javier.carrasco, jeff, krzk+dt, krzk, krzysztof.kozlowski,
linux-input, linux-kernel, linux-renesas-soc, magnus.damm,
phucduc.bui, robh
In-Reply-To: <abCkX_oyqaa9jM5F@shikoro>
Hi Wolfram,
Thank you for your review.
Best regards,
Phuc
^ permalink raw reply
* [PATCH 2/2] Input: Touchscreen: tsc200x - delegate wakeup IRQ
From: phucduc.bui @ 2026-03-11 3:17 UTC (permalink / raw)
To: dmitry.torokhov
Cc: conor+dt, devicetree, krzk+dt, linux-input, linux-kernel, marex,
mingo, mwelling, phucduc.bui, robh, tglx
In-Reply-To: <abC1NfUoHCHEeZpr@google.com>
Hi Dmitry,
> Sorry, but this just makes it all worse. There is no downside from
> letting the driver to control wakeup if it wants to, so I'd rather leave
> it as it was, at least for now.
Thanks you for your reply
I was thinking that the code might be simplified by removing
ts->wake_irq_enabled.
In resume(), we could just check device_may_wakeup(dev) before calling
disable_irq_wake(ts->irq). From what I can see, wake_irq_enabled is only
used there, so it seems redundant.
I don't have the hardware to test this right now, so I didn't try the
change myself.
Do you think it would make sense to remove this field?
Best regards,
Phuc
^ permalink raw reply
* [PATCH] Remove unused headers in x86/tools, scripts, pps, input
From: Oli @ 2026-03-11 3:01 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Steven Rostedt
Cc: Mathieu Desnoyers, Masami Hiramatsu, Rodolfo Giometti,
Henrik Rydberg, Dmitry Torokhov, Nathan Chancellor,
Nicolas Schier, linux-kernel, linux-trace-kernel, linux-kbuild,
linux-input, x86
[-- Attachment #1.1: Type: text/plain, Size: 2304 bytes --]
From c78a0572f5ec2b927f9b723af687e6ef913561a4 Mon Sep 17 00:00:00 2001
From: Eddie Hudgins <Oochiolio@gmail.com>
Date: Tue, 10 Mar 2026 21:53:07 -0500
Subject: [PATCH] Signed-off-by: Eddie Hudgins <Oochiolio@gmail.com>
arch/x86/tools: Removed headers in relocs_32.c scripts/basic: Removed
headers
in fixdep.c drivers/pps: Removed headers in pps.c drivers/input: Removed
headers in input-mt.c
These changes compile for x86, x86_64, and powerpc (Those were the only
ones fairly tested) under defconfig. This aims to clean up code and
simplify the files for developers. This will also contribute to start of
decluttering the environment.
---
arch/x86/tools/relocs_32.c | 1 -
drivers/input/input-mt.c | 1 -
drivers/pps/pps.c | 3 ---
scripts/basic/fixdep.c | 1 -
4 files changed, 6 deletions(-)
diff --git a/arch/x86/tools/relocs_32.c b/arch/x86/tools/relocs_32.c
index 9442ff78be83..9e4668e74993 100644
--- a/arch/x86/tools/relocs_32.c
+++ b/arch/x86/tools/relocs_32.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include "relocs.h"
-
#define ELF_BITS 32
#define ELF_MACHINE EM_386
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index c06e98fbd77c..b553b7f2313a 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -7,7 +7,6 @@
#include <linux/input/mt.h>
#include <linux/export.h>
-#include <linux/slab.h>
#include "input-core-private.h"
#define TRKID_SGN ((TRKID_MAX + 1) >> 1)
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index c6b8b6478276..a9a8802c2399 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -7,14 +7,11 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
-#include <linux/sched.h>
#include <linux/uaccess.h>
#include <linux/idr.h>
#include <linux/mutex.h>
-#include <linux/cdev.h>
#include <linux/poll.h>
#include <linux/pps_kernel.h>
#include <linux/slab.h>
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index cdd5da7e009b..feb9e7d8984d 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -89,7 +89,6 @@
* but I don't think the added complexity is worth it)
*/
-#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
--
2.43.0
[-- Attachment #1.2: Type: text/html, Size: 2829 bytes --]
[-- Attachment #2: 0001-Signed-off-by-Eddie-Hudgins-Oochiolio-gmail.com.patch --]
[-- Type: application/octet-stream, Size: 2297 bytes --]
From c78a0572f5ec2b927f9b723af687e6ef913561a4 Mon Sep 17 00:00:00 2001
From: Eddie Hudgins <Oochiolio@gmail.com>
Date: Tue, 10 Mar 2026 21:53:07 -0500
Subject: [PATCH] Signed-off-by: Eddie Hudgins <Oochiolio@gmail.com>
arch/x86/tools: Removed headers in relocs_32.c scripts/basic: Removed headers
in fixdep.c drivers/pps: Removed headers in pps.c drivers/input: Removed
headers in input-mt.c
These changes compile for x86, x86_64, and powerpc (Those were the only ones fairly tested) under defconfig. This aims to clean up code and simplify the files for developers. This will also contribute to start of decluttering the environment.
---
arch/x86/tools/relocs_32.c | 1 -
drivers/input/input-mt.c | 1 -
drivers/pps/pps.c | 3 ---
scripts/basic/fixdep.c | 1 -
4 files changed, 6 deletions(-)
diff --git a/arch/x86/tools/relocs_32.c b/arch/x86/tools/relocs_32.c
index 9442ff78be83..9e4668e74993 100644
--- a/arch/x86/tools/relocs_32.c
+++ b/arch/x86/tools/relocs_32.c
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
#include "relocs.h"
-
#define ELF_BITS 32
#define ELF_MACHINE EM_386
diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c
index c06e98fbd77c..b553b7f2313a 100644
--- a/drivers/input/input-mt.c
+++ b/drivers/input/input-mt.c
@@ -7,7 +7,6 @@
#include <linux/input/mt.h>
#include <linux/export.h>
-#include <linux/slab.h>
#include "input-core-private.h"
#define TRKID_SGN ((TRKID_MAX + 1) >> 1)
diff --git a/drivers/pps/pps.c b/drivers/pps/pps.c
index c6b8b6478276..a9a8802c2399 100644
--- a/drivers/pps/pps.c
+++ b/drivers/pps/pps.c
@@ -7,14 +7,11 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
-#include <linux/sched.h>
#include <linux/uaccess.h>
#include <linux/idr.h>
#include <linux/mutex.h>
-#include <linux/cdev.h>
#include <linux/poll.h>
#include <linux/pps_kernel.h>
#include <linux/slab.h>
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index cdd5da7e009b..feb9e7d8984d 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -89,7 +89,6 @@
* but I don't think the added complexity is worth it)
*/
-#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
--
2.43.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox