From nobody Sun Feb 8 11:45:16 2026 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) (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 3F67230E825 for ; Mon, 12 Jan 2026 19:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768244491; cv=none; b=mC2uU/tDnZP62U3ECssjS01YtVxEDzsDmSSriE4qh18A8wOuqJRcyPOiLe07pioBBUcRVisKtmvfFclaMM0aOxxb5/qLMvklNzRI/pxSZjnPDcn2jqHvMtSm4YjhCvArBsp8K7q0rwDpUtNwVw+zEVzuDURJlYX63ed3tGPQbJk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768244491; c=relaxed/simple; bh=bkm0dOJgL8gmuag24MqBvcBsLHUFgvEsv+0tyaqpwo8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ETIhsgdUYTP0MwUulXpTNW3fQyISYHAYdaCNNnXRbkdNqGHwFOcL7UujZQ0CXkHk67Jofrq6qQirGcnrNb2izk2640R9OV2LaOQgy7ALcKtPnjhSoLyLVzu5h98RNdDkufFe2dBdQsJClF1SheYQjvxhgQKHCQpmaRHV4kQ6r9Q= 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=HgX8BDCi; arc=none smtp.client-ip=209.85.210.177 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="HgX8BDCi" Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-81f5381d168so1153183b3a.2 for ; Mon, 12 Jan 2026 11:01:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768244490; x=1768849290; 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=cUMaw/dph/dW4TTrdxBwQWjJ+AsPkB6Ge1GrbWURqKo=; b=HgX8BDCi4PiF3Q6u8gSOvHC22wcyTsHGF9MTH4MQRvctrWCU5FEepPGx32NA0f5QlK 1u7UHklWYMtOjfIe9ygJUtBk3u3ZtOgeicHOdbx/g2rxvPVBAhtMvEYe5KzNiiQntbO3 zkC+lxI5s4153QaKXYivoLbzwEVHEWGAsGQSxAF9K9g6VKQTKrnBOcrfRDinFSipf1uv yFbtZTFx3JS5DKEqrCP774gwt+S6oYVqLlozrCMeLx1uzTToamQYnZYiCbsvEYK9JdU7 41TkxP1/m07t4Wa8DwKzTV+syxovp/8PHy1p7W8bIIZhCT5Lng5nAgD+vsIS35SPJZH3 xSzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768244490; x=1768849290; 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=cUMaw/dph/dW4TTrdxBwQWjJ+AsPkB6Ge1GrbWURqKo=; b=Gx1jxx6i8Imtt49IemKMKo6Jfq+u8tUS9DMzFkY+oQgqOSBvlDYV/utRL1RKhd65dE WVgibHD9CI5Uu7yS9vX36pDDUrLwOf6uB3nAjKbqBLoy7Ys+rQlk5IfGSALrTfjuXpGS WX8nB/bNQ91iZ2gILhXJpLB4RKQtwcXMJtmErLzWUVn2If5jPdRmM64U1bPKBepILM+h 2M8/qdB+oWRmPIpbeGFHLzN2chMaJpQSPbHmeTFQGsFgaKb5WsQrRu4Q/DvDJMunYdn5 7gQoa1ZOtMjizkzPQ36HzYI0PM5t+FAh1hzYi1nKMesS0xTkpO+AREnsQ9pmS+WjsBB/ agyQ== X-Forwarded-Encrypted: i=1; AJvYcCU+wqYGT124ow9aAicho5Gca2Tf2UF6+j2UrNSSUG5jCvZt2lVHUifu2iIiYn5rSGT7qaOQAObMbv58/Ec=@vger.kernel.org X-Gm-Message-State: AOJu0YxtSJvnRZKeTPuDWGjSGJsjIn8Q3q3M2bk/w84KH7OgPkRHRjhh Kaam8LI6Vf/voDESBATWYCvVFTeq0TFygn+6D1DKZ3iVhGGrEV8t01FQ X-Gm-Gg: AY/fxX4JFcyXRu9rCxCnYBAIEhie3TbAJkLkasL4L2iZi/UOzOObNIR5LP/8KXMTxoJ xf2Gtbu3oIMnHF/yhejfewEQCVWOzYVh5EMhKf8jXw6nKulRFBup6xcL1RmmZYRhPpoe+j+RJGd jCml/1jcCmaShwnZfVo1N3q7kGYlv5ER2ONcRZvX86h0ZQGGgxI6L4qEF1ZjxVKz9f+rRRVYA0T bCFdEjiaJxN2Rcb6pEQXLOk9wD6wyQW0SWUjp9Y7d1uKLp7piJIerZvqNC+Q/km0U7ILruzq691 3zRZGSobuoS0r/tOVGbe4aTa25/FqZoA1zN3GCkM82JMzMkJW55kkS4P0tFc7/ckhpHmIzPDONO FccbgfRrhCZ6a7BLWDx24YuOq5Pm8bCYIXmG/GsnxtMmjDNHVd3uiDwOFoHDNYpEhViQVHwlu3H E4//3BZRJYMPxhEGSQhBTDc+dfbGN6LIhKCigzO8EKSw== X-Google-Smtp-Source: AGHT+IEymeO6/t7nAwwrBWvbeV1YQ13aBa9Q+VA8QAC0uiGshEP7LT2ithDNR03j+4ovta5dv0rq9Q== X-Received: by 2002:a05:6a20:2452:b0:366:14b0:1a30 with SMTP id adf61e73a8af0-3898f9c74b0mr18366795637.62.1768244489567; Mon, 12 Jan 2026 11:01:29 -0800 (PST) Received: from LAPTOP-PJU7MKF4.lan.iiitm.ac.in ([117.250.157.213]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c54972a5e67sm11164366a12.35.2026.01.12.11.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jan 2026 11:01:29 -0800 (PST) From: Anubhav Kokane To: hansg@kernel.org, mchehab@kernel.org, andy@kernel.org Cc: sakari.ailus@linux.intel.com, gregkh@linuxfoundation.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Anubhav Kokane Subject: [PATCH] staging: media: atomisp: refactor sizeof(struct type) to sizeof(*ptr) Date: Mon, 12 Jan 2026 19:00:53 +0000 Message-ID: <20260112190054.9828-1-dev.anubhavk@gmail.com> X-Mailer: git-send-email 2.43.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" Use the variable name in sizeof() operator instead of the struct type. This prevents errors if the type of the variable is changed in future. This fixes checkpatch checks: "CHECK: Prefer kzalloc(sizeof(*ptr)...) over kzalloc(sizeof(struct type)...)" Signed-off-by: Anubhav Kokane --- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/st= aging/media/atomisp/pci/atomisp_ioctl.c index bb8b2f2213b0..60f705fac3c7 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -696,7 +696,7 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_devi= ce *asd, ATOMISP_S3A_BUF_QUEUE_DEPTH_FOR_HAL; dev_dbg(isp->dev, "allocating %d 3a buffers\n", count); while (count--) { - s3a_buf =3D kzalloc(sizeof(struct atomisp_s3a_buf), GFP_KERNEL); + s3a_buf =3D kzalloc(sizeof(*s3a_buf), GFP_KERNEL); if (!s3a_buf) goto error; =20 @@ -715,7 +715,7 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_devi= ce *asd, count =3D ATOMISP_CSS_Q_DEPTH + 1; dev_dbg(isp->dev, "allocating %d dis buffers\n", count); while (count--) { - dis_buf =3D kzalloc(sizeof(struct atomisp_dis_buf), GFP_KERNEL); + dis_buf =3D kzalloc(sizeof(*dis_buf), GFP_KERNEL); if (!dis_buf) goto error; if (atomisp_css_allocate_stat_buffers( @@ -737,7 +737,7 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_devi= ce *asd, dev_dbg(isp->dev, "allocating %d metadata buffers for type %d\n", count, i); while (count--) { - md_buf =3D kzalloc(sizeof(struct atomisp_metadata_buf), + md_buf =3D kzalloc(sizeof(*md_buf), GFP_KERNEL); if (!md_buf) goto error; --=20 2.43.0