From patchwork Sat Sep 4 17:56:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 12475743 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21375C433EF for ; Sat, 4 Sep 2021 17:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03B206056B for ; Sat, 4 Sep 2021 17:56:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237265AbhIDR5L (ORCPT ); Sat, 4 Sep 2021 13:57:11 -0400 Received: from mail1.protonmail.ch ([185.70.40.18]:59067 "EHLO mail1.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231181AbhIDR5K (ORCPT ); Sat, 4 Sep 2021 13:57:10 -0400 Date: Sat, 04 Sep 2021 17:56:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1630778167; bh=q5glyydl1R8dK+AIve/gRQcjiz9BZkSLzd3soZM+koY=; h=Date:To:From:Reply-To:Subject:From; b=TwpHZfoasa17CcO3zsFKo+ZvWqQY13yD2lPLJiyftFz8AqzJmD3HZoBJT8SKGYZR9 IBKjJXjt6ScX9c0iXlMJ8m3IvGagzdZLbJV+mpewSkmT6edm4eOtrV20cbKQlTzv5T dGh27Hfg15HPv+12+0GtDMm1xm01X3ploZ+ghp+s= To: Hans de Goede , Mark Gross , platform-driver-x86@vger.kernel.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Reply-To: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [RFC PATCH v1 19/30] platform/x86: wmi: use sizeof(*p) in allocation Message-ID: <20210904175450.156801-20-pobrn@protonmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org As per the coding style guide, the preferred way to pass the size of objects to allocator functions is `sizeof(*p)`. Use that. Signed-off-by: Barnabás Pőcze --- drivers/platform/x86/wmi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.33.0 diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 0e721d868bf7..7f7dfb7f9aa8 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -1176,7 +1176,7 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device) if (guid_already_parsed(device, &gblock[i].guid)) continue; - wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); + wblock = kzalloc(sizeof(*wblock), GFP_KERNEL); if (!wblock) { retval = -ENOMEM; break;