From nobody Fri Apr 3 00:00:50 2026 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D0902FB969 for ; Sat, 14 Feb 2026 15:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771084337; cv=none; b=A6fCISKFb10TB8j5xfe43j9GvuDZ7IVl55CMX83HgbE3YTRaaAZC2bZR1FEZz3VRD689pgmAx8EViSdI6CGIlIlA2jGXNNQGc82j1SZOaJSD0eRj3drSs27f90tnl27ccT3tLx6iuAn0SVnhl/1Oj1+oe+gaG4JGtFub5Wk1GKY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771084337; c=relaxed/simple; bh=xQh1vNe2/eDT5i8ADtTBiQq4bN+w0yMtcf8770B5e78=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=O1T0mypbmVREmbPvlBma93x7pCJW1Suf5TNnu8fRXgmTB/K8NpCwb7cuyVrY08bGNMEhgtnFUIXJpe4wvdsp/Tw0paUt4dDVATqHvIE1QRGnIpsV+McC7PHpZi6EcjlST654HqU5U7xkjFwbZloHE8p5HBMrIB1Cb785/Xe48kQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MEYU+Yme; arc=none smtp.client-ip=209.85.215.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MEYU+Yme" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-c6e3e4e7388so630150a12.1 for ; Sat, 14 Feb 2026 07:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771084335; x=1771689135; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=f00J/5oXng6KrSXxxBq0P/TEPEyPF2XTkCoivFiPfe8=; b=MEYU+YmeavW25hBRF9kJFtNWQA4TAWdx/HHuScoeWwEdbtmYFijwCrtHYikcljWdqu zV8qfBDMlZIj/HqPdZsl71ubhSVoGqUDja4rrswjFjrAGlZo9bltg5EMhVUqNUjdlj76 oWLRpNTRIq8UymKOaF7+6AIaZqiwLXBslQ5gHST8oWN7MI7wqgpqfidQJawscWtbDSUt V4bEaYIAN+LL4BIHHSKvFrGdec//sPVhmRPoL3rPgG+pPVuufIF+b89C6m30ZWYB8loi XZNr8cyJn+WzljkAVAqfT8XWRAzUopAHhjj5JjD8gbgAzhNCIS4UbWNLX6jnDTDWEqks A6Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771084335; x=1771689135; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=f00J/5oXng6KrSXxxBq0P/TEPEyPF2XTkCoivFiPfe8=; b=ELZL0DYyLzPu2dLbcS2gTzEDnNL29TVvzb6ocxBgxo1PxQfkxEHcMwh/VPXR9WmwfG lqADFO0AwruCnCEy89jTayd7IR7SocpmPDUqeZYDWlpbBrserImSVFipScRSbDpur4Su VSNipu5sM0dz5bOqOeEztrxyc64LR5s+7Y8XGpE/24pdEAtnXPR1ppaJvScEgiWB82Hs vxwWTuR9dxo+scBtC+6cjsi/N9v2m/CxDI9e7DqLWx2wxjay/Q+s4TERNoNqy34zu86d eDNmjP2gyvIsJkaqeRqnmnsqzOjkRHJSvq2mEUOfel0FVZA8iuoSz2229Zxgu/44MBf9 pJvw== X-Forwarded-Encrypted: i=1; AJvYcCXaa3QpYByz2I4wUKTdhpQyarsrU+v5pocEsQezu9ehKB9Ri/sLnkREk63Ih5Y7QQTfdNTV4FcXGcxAi/Q=@vger.kernel.org X-Gm-Message-State: AOJu0YxcU4hnilgKC4UjPDRb0YV7hcS/NVCsoXiIDPCo29kfb+gaa0E8 6cD2xEc2/ibbNHRVnfSPb80y/OBO4N4yEj/4UufD25IS66BurUY22L+u X-Gm-Gg: AZuq6aK2Mfi7TlgSQ77mlRSuhjnpdK4+OFRYXhLOhyz0XXipQZa52hkkHV66dpaYrVL kPnZ8kNn6DZiIc3OcjEsb5gKgF5HIRbYVM14esjxdA6w9x5oyUTlur1iCw9mENqLmTzFWxaFJpp q+lNAO4E8bK84tAHMOoSEchkB8N9R48NPpfiOO4fGoKo0M2mK5cth6SSLJaU1EcXfeJUnIYjvnB RkULCVViCwXYCUtJ2rTgsAI5AfUKEnBSBYbl9vLSZTkQvif6fw3Ke+GJCfcvMxlkOfEbwtQ+tY1 psRJvKVVYO5mFE99aqj6SzNh7+rK+98Jh9uO+utLtBB9iGRUE+r/U5pDpCwiw7IDbFMMndu2SHz rvQmCGWmF0s/L5ASJu8f5+pMOXQ9I9YYz0RFCuOZmKLf/sB6MeqZ6k5vGfcNI6CMlVAbLBPi16M ka2ydliMQVE9DNmxEqlaz+UM03xV4EkAz1d9b/ucOkW7LLcLIlGg== X-Received: by 2002:a17:903:acb:b0:2a0:fb1c:143d with SMTP id d9443c01a7336-2ab504d5b0amr47938315ad.1.1771084335520; Sat, 14 Feb 2026 07:52:15 -0800 (PST) Received: from localhost.localdomain ([2401:4900:8817:dac0:96bb:43ff:fec0:e782]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ad1aafc527sm21595005ad.89.2026.02.14.07.52.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Feb 2026 07:52:15 -0800 (PST) From: Samyak To: linux-staging@lists.linux.dev Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, Samyak Bambole Subject: [PATCH] staging: vme_user: use kmalloc_obj instead of kmalloc Date: Sat, 14 Feb 2026 21:21:57 +0530 Message-ID: <20260214155157.663800-1-samyak.bambole07@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Samyak Bambole Replace kmalloc(sizeof(*ptr), GFP_KERNEL) calls with kmalloc_obj(*ptr, GFP_KERNEL) This addresses scripts/checkpatch.pl warnings and follows the preffered allocation pattern. Changes: - vme.c: 12 replacements - vme_fake.c: 3 replacements - vme_tsi148.c: 7 replacements Signed-off-by: Samyak Bambole --- drivers/staging/vme_user/vme.c | 24 ++++++++++++------------ drivers/staging/vme_user/vme_fake.c | 6 +++--- drivers/staging/vme_user/vme_tsi148.c | 14 +++++++------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c index 2095de725..8496c722a 100644 --- a/drivers/staging/vme_user/vme.c +++ b/drivers/staging/vme_user/vme.c @@ -287,7 +287,7 @@ struct vme_resource *vme_slave_request(struct vme_dev *= vdev, u32 address, if (!allocated_image) goto err_image; =20 - resource =3D kmalloc(sizeof(*resource), GFP_KERNEL); + resource =3D kmalloc_obj(*resource, GFP_KERNEL); if (!resource) goto err_alloc; =20 @@ -484,7 +484,7 @@ struct vme_resource *vme_master_request(struct vme_dev = *vdev, u32 address, goto err_image; } =20 - resource =3D kmalloc(sizeof(*resource), GFP_KERNEL); + resource =3D kmalloc_obj(*resource, GFP_KERNEL); if (!resource) goto err_alloc; =20 @@ -854,7 +854,7 @@ struct vme_resource *vme_dma_request(struct vme_dev *vd= ev, u32 route) if (!allocated_ctrlr) goto err_ctrlr; =20 - resource =3D kmalloc(sizeof(*resource), GFP_KERNEL); + resource =3D kmalloc_obj(*resource, GFP_KERNEL); if (!resource) goto err_alloc; =20 @@ -894,7 +894,7 @@ struct vme_dma_list *vme_new_dma_list(struct vme_resour= ce *resource) return NULL; } =20 - dma_list =3D kmalloc(sizeof(*dma_list), GFP_KERNEL); + dma_list =3D kmalloc_obj(*dma_list, GFP_KERNEL); if (!dma_list) return NULL; =20 @@ -924,11 +924,11 @@ struct vme_dma_attr *vme_dma_pattern_attribute(u32 pa= ttern, u32 type) struct vme_dma_attr *attributes; struct vme_dma_pattern *pattern_attr; =20 - attributes =3D kmalloc(sizeof(*attributes), GFP_KERNEL); + attributes =3D kmalloc_obj(*attributes, GFP_KERNEL); if (!attributes) goto err_attr; =20 - pattern_attr =3D kmalloc(sizeof(*pattern_attr), GFP_KERNEL); + pattern_attr =3D kmalloc_obj(*pattern_attr, GFP_KERNEL); if (!pattern_attr) goto err_pat; =20 @@ -964,11 +964,11 @@ struct vme_dma_attr *vme_dma_pci_attribute(dma_addr_t= address) =20 /* XXX Run some sanity checks here */ =20 - attributes =3D kmalloc(sizeof(*attributes), GFP_KERNEL); + attributes =3D kmalloc_obj(*attributes, GFP_KERNEL); if (!attributes) goto err_attr; =20 - pci_attr =3D kmalloc(sizeof(*pci_attr), GFP_KERNEL); + pci_attr =3D kmalloc_obj(*pci_attr, GFP_KERNEL); if (!pci_attr) goto err_pci; =20 @@ -1005,11 +1005,11 @@ struct vme_dma_attr *vme_dma_vme_attribute(unsigned= long long address, struct vme_dma_attr *attributes; struct vme_dma_vme *vme_attr; =20 - attributes =3D kmalloc(sizeof(*attributes), GFP_KERNEL); + attributes =3D kmalloc_obj(*attributes, GFP_KERNEL); if (!attributes) goto err_attr; =20 - vme_attr =3D kmalloc(sizeof(*vme_attr), GFP_KERNEL); + vme_attr =3D kmalloc_obj(*vme_attr, GFP_KERNEL); if (!vme_attr) goto err_vme; =20 @@ -1233,7 +1233,7 @@ struct vme_error_handler *vme_register_error_handler(= struct vme_bridge *bridge, { struct vme_error_handler *handler; =20 - handler =3D kmalloc(sizeof(*handler), GFP_ATOMIC); + handler =3D kmalloc_obj(*handler, GFP_ATOMIC); if (!handler) return NULL; =20 @@ -1458,7 +1458,7 @@ struct vme_resource *vme_lm_request(struct vme_dev *v= dev) if (!allocated_lm) goto err_lm; =20 - resource =3D kmalloc(sizeof(*resource), GFP_KERNEL); + resource =3D kmalloc_obj(*resource, GFP_KERNEL); if (!resource) goto err_alloc; =20 diff --git a/drivers/staging/vme_user/vme_fake.c b/drivers/staging/vme_user= /vme_fake.c index 731fbba17..0fc5fe7f8 100644 --- a/drivers/staging/vme_user/vme_fake.c +++ b/drivers/staging/vme_user/vme_fake.c @@ -1102,7 +1102,7 @@ static int __init fake_init(void) /* Add master windows to list */ INIT_LIST_HEAD(&fake_bridge->master_resources); for (i =3D 0; i < FAKE_MAX_MASTER; i++) { - master_image =3D kmalloc(sizeof(*master_image), GFP_KERNEL); + master_image =3D kmalloc_obj(*master_image, GFP_KERNEL); if (!master_image) { retval =3D -ENOMEM; goto err_master; @@ -1128,7 +1128,7 @@ static int __init fake_init(void) /* Add slave windows to list */ INIT_LIST_HEAD(&fake_bridge->slave_resources); for (i =3D 0; i < FAKE_MAX_SLAVE; i++) { - slave_image =3D kmalloc(sizeof(*slave_image), GFP_KERNEL); + slave_image =3D kmalloc_obj(*slave_image, GFP_KERNEL); if (!slave_image) { retval =3D -ENOMEM; goto err_slave; @@ -1150,7 +1150,7 @@ static int __init fake_init(void) =20 /* Add location monitor to list */ INIT_LIST_HEAD(&fake_bridge->lm_resources); - lm =3D kmalloc(sizeof(*lm), GFP_KERNEL); + lm =3D kmalloc_obj(*lm, GFP_KERNEL); if (!lm) { retval =3D -ENOMEM; goto err_lm; diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_us= er/vme_tsi148.c index 733594dde..62b16be15 100644 --- a/drivers/staging/vme_user/vme_tsi148.c +++ b/drivers/staging/vme_user/vme_tsi148.c @@ -1611,7 +1611,7 @@ static int tsi148_dma_list_add(struct vme_dma_list *l= ist, struct vme_dma_attr *s tsi148_bridge =3D list->parent->parent; =20 /* Descriptor must be aligned on 64-bit boundaries */ - entry =3D kmalloc(sizeof(*entry), GFP_KERNEL); + entry =3D kmalloc_obj(*entry, GFP_KERNEL); if (!entry) { retval =3D -ENOMEM; goto err_mem; @@ -2333,8 +2333,8 @@ static int tsi148_probe(struct pci_dev *pdev, const s= truct pci_device_id *id) master_num--; =20 tsi148_device->flush_image =3D - kmalloc(sizeof(*tsi148_device->flush_image), - GFP_KERNEL); + kmalloc_obj(*tsi148_device->flush_image, + GFP_KERNEL); if (!tsi148_device->flush_image) { retval =3D -ENOMEM; goto err_master; @@ -2350,7 +2350,7 @@ static int tsi148_probe(struct pci_dev *pdev, const s= truct pci_device_id *id) =20 /* Add master windows to list */ for (i =3D 0; i < master_num; i++) { - master_image =3D kmalloc(sizeof(*master_image), GFP_KERNEL); + master_image =3D kmalloc_obj(*master_image, GFP_KERNEL); if (!master_image) { retval =3D -ENOMEM; goto err_master; @@ -2376,7 +2376,7 @@ static int tsi148_probe(struct pci_dev *pdev, const s= truct pci_device_id *id) =20 /* Add slave windows to list */ for (i =3D 0; i < TSI148_MAX_SLAVE; i++) { - slave_image =3D kmalloc(sizeof(*slave_image), GFP_KERNEL); + slave_image =3D kmalloc_obj(*slave_image, GFP_KERNEL); if (!slave_image) { retval =3D -ENOMEM; goto err_slave; @@ -2397,7 +2397,7 @@ static int tsi148_probe(struct pci_dev *pdev, const s= truct pci_device_id *id) =20 /* Add dma engines to list */ for (i =3D 0; i < TSI148_MAX_DMA; i++) { - dma_ctrlr =3D kmalloc(sizeof(*dma_ctrlr), GFP_KERNEL); + dma_ctrlr =3D kmalloc_obj(*dma_ctrlr, GFP_KERNEL); if (!dma_ctrlr) { retval =3D -ENOMEM; goto err_dma; @@ -2417,7 +2417,7 @@ static int tsi148_probe(struct pci_dev *pdev, const s= truct pci_device_id *id) } =20 /* Add location monitor to list */ - lm =3D kmalloc(sizeof(*lm), GFP_KERNEL); + lm =3D kmalloc_obj(*lm, GFP_KERNEL); if (!lm) { retval =3D -ENOMEM; goto err_lm; --=20 2.53.0