From patchwork Fri Oct 29 20:00:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaston Gonzalez X-Patchwork-Id: 12593679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6578C433EF for ; Fri, 29 Oct 2021 20:16:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FBF360F56 for ; Fri, 29 Oct 2021 20:16:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9FBF360F56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=KwpXABD42hZxaOgLk8KN5YvWs4dhK4LOJtmkPfROBpI=; b=goh6lV0Km5f6uz HL2vgI3ykG+DnD7RO+NdVsy6Scp4hMHTKlVPJ87aP0R5dM2asUFvqET5Rh+7Y5ED3EwSXYQIwG8hW Vg1xVFW6N6FgIxsKAW0pqq47bwt3rckBWx9LOvzu+HVBGLQgTbPXgCAAD1pAhxV387j1kCCU7w9pH P7Fx6I+khDJQwA4xfuKuCeFMXhH5o6KTH+rmZohByPZuJrl4hcVz7ae9VUltTguTkBLIVhd6zOWVR g/F8BLqdKME/TTGAJ7kjmJfuJZr8so5SjIKW0jpIqea2PaICUY0R/67DW9BMsVpBzV408TpcKYRFp fLJJT/9AXLHmSfV1tMPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgYGY-00CCTA-T4; Fri, 29 Oct 2021 20:14:20 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mgY3t-00C8uf-Jo; Fri, 29 Oct 2021 20:01:15 +0000 Received: by mail-oi1-x235.google.com with SMTP id o4so14907538oia.10; Fri, 29 Oct 2021 13:01:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PHumhMIUr438aWWlrs+78cdgsF1iUwE1HgS3gt+l/Ls=; b=qSwRjZWjohXQH7S/AeV/tL1D+waYUomj9nwx2FRu9gr84XTV+znEdx3TbITF/Fc3sz RlulexcGv2ic9dbKiDvM786MBVDSLC0zfCO7j9q5kM8rHP0PDlr3sA0D7kt1hBvRtJd3 tHLUoGaCdkk3Q1M2aSeYi8TKIg9RkhTPevPa2equkrz0iPhp+ajmqcZKSZoP6Eg7zy8V IcdlVxBvbpRmqQCZqdP3thsz14hIPaV+lHmidDNU9DKpj6T8vYZHHrppF5PXbUtHPz3O UWyzrfLa19f3BLTKDOPCYrlasARJyQqML7Qi2A7yXi/qyNKiQyXhz7xmx+joEORhFvKW Sgdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PHumhMIUr438aWWlrs+78cdgsF1iUwE1HgS3gt+l/Ls=; b=2ITCPyf9Kv8+JRh2JYe9+G8hQ+zExtiEE4RydiLg+WDeCwUsVXH6zcwwKzHlZZvZO4 g05hIyTN+MhCKbZxw/g60RxtbKbHCUl0PfQKT4F1K2eRClJo+pyRdoNmx93WTHCh67gM HEZUoPUQPCk0OEbRI/qGJFmajy+U4Ax+fYFR2q5PWzoa4mke00A62T2cczJkj97NnuUm UkTBI4GmKfp5elZI6E7cwFsFcaJO5n5aeawZHImJT0ZwKB9K2qeOu9IW4LRMEP2929wK 2S/p7ZgBEDbWw4bZ310ZfK2STsZTTqWqanwMSNPZEJ/yKk4NTAvFz9CSkvG4gc9HNf9k iJmg== X-Gm-Message-State: AOAM531AJkIyh0GCAVqEOL/VoU+bOnqjeobXbWvtGufPomr07Wb0C/sA 2rgnoE6XOxARIOldWRKMuqFyGk/nt6A= X-Google-Smtp-Source: ABdhPJzeBQkPFaHl2wBYEVOxaarNNmQ1BtUFuNj4uSlEJXQcPIQL5Evmiu4WHVAMmvGxXGLHJPlR3Q== X-Received: by 2002:a05:6808:23ca:: with SMTP id bq10mr9944414oib.6.1635537672112; Fri, 29 Oct 2021 13:01:12 -0700 (PDT) Received: from localhost.localdomain ([181.23.79.14]) by smtp.gmail.com with ESMTPSA id w5sm2180498otq.46.2021.10.29.13.01.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Oct 2021 13:01:11 -0700 (PDT) From: Gaston Gonzalez To: linux-staging@lists.linux.dev Cc: gregkh@linuxfoundation.org, nsaenz@kernel.org, stefan.wahren@i2se.com, arnd@arndb.de, dan.carpenter@oracle.com, ojaswin98@gmail.com, amarjargal16@gmail.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, gascoar@gmail.com Subject: [PATCH v2] staging: vchiq_core: get rid of typedef Date: Fri, 29 Oct 2021 17:00:12 -0300 Message-Id: <20211029200012.45986-1-gascoar@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211029_130113_717462_D599BD69 X-CRM114-Status: GOOD ( 10.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The typedef BITSET_T is acting as a synonym of u32. However, using the type u32 directly makes the code more readable. Furthermore, typedef should only be used in some cases, [1]. Hence, get rid of it. [1] Documentation/process/coding-style.rst Signed-off-by: Gaston Gonzalez --- v1 -> v2: improve changelog specifing which typedef is being removed. .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 6 +++--- .../staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c index ab97a35e63f9..7fe20d4b7ba2 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -711,7 +711,7 @@ reserve_space(struct vchiq_state *state, size_t space, int is_blocking) } static void -process_free_data_message(struct vchiq_state *state, BITSET_T *service_found, +process_free_data_message(struct vchiq_state *state, u32 *service_found, struct vchiq_header *header) { int msgid = header->msgid; @@ -767,7 +767,7 @@ process_free_data_message(struct vchiq_state *state, BITSET_T *service_found, /* Called by the recycle thread. */ static void -process_free_queue(struct vchiq_state *state, BITSET_T *service_found, +process_free_queue(struct vchiq_state *state, u32 *service_found, size_t length) { struct vchiq_shared_state *local = state->local; @@ -1981,7 +1981,7 @@ recycle_func(void *v) { struct vchiq_state *state = v; struct vchiq_shared_state *local = state->local; - BITSET_T *found; + u32 *found; size_t length; length = sizeof(*found) * BITSET_SIZE(VCHIQ_MAX_SERVICES); diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h index 3e50910ecba3..53a98949b294 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -74,9 +74,7 @@ ((fourcc) >> 8) & 0xff, \ (fourcc) & 0xff -typedef u32 BITSET_T; - -static_assert((sizeof(BITSET_T) * 8) == 32); +static_assert((sizeof(u32) * 8) == 32); #define BITSET_SIZE(b) ((b + 31) >> 5) #define BITSET_WORD(b) (b >> 5)