Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3678609ybp; Sun, 13 Oct 2019 11:50:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqygBxZx/f7mlRud8rpnitZ/vXAa+HF5CjjB8lOLd9qEk7rwZOleYNnBIkoTq/arMF/GL9QQ X-Received: by 2002:a05:6402:21c2:: with SMTP id bi2mr24851601edb.8.1570992611676; Sun, 13 Oct 2019 11:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570992611; cv=none; d=google.com; s=arc-20160816; b=lgvYFlw/XfdV9aYjiQqypyqdvGa939fECctOuysXG17soUgzlx00/rcvaVpPuhFey9 y5ChlRuc74IKKq9P5g7HUasTmtijdiFJHjnu13JMsNbWhEN56ctmnsLZCC0o2rD3c5ep wKV3doEsf8eNixH9AVUz49ikjaVS+vtD1M+8rBAoGgvipoDmdV25qP5iln/FHEoNQ1gM SlOqUtKrO4Hrc0ulM1hy3CVhvW/K9J2JS+0fMT9kr+4OX/sEAFTl8QNBnhzAlUaSul1r IccFIgvqBQ1Y5sqPkBgZPgD7oPHw2S39yU8tdqrmnYELwSK+QXWqZE1YLiGHfrfS9x1D zNkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=CeolOloPmeT1KftxvZqohSF0GTQr4950rvmG7EqO4RI=; b=KTifhgYXs37CjRIepUQBGcDUADOsAZdP6GT0rolqk7c0y15baEVrbPHD4GNNRRnym8 Vcv0eouuPDh8tAtD74zYsv1lAiKJKN6M3Yr1SGqflyidwi8dReBivKmkNY5UpbCT5p8s Kgfhxo/e3WH2un5crC+k3M4JbSKwQ3Urt8qE3Gluw9TTwG5yN9CEU2uNCeRSdAINA7uS iP1m9nrpSXad8G+79zhDxrzHfhOu4mDIb+Gsn+hPjnJjtWg2/U1oPxoepp5QDL63GHM6 LJgLA20oX//OBXh/icXBfheK9eVmdFQ50jjrH2NXvWTNXI9q3J5arZCD56n8zUV+hYwN h8gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LMJEV2Lh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w58si11002455edc.312.2019.10.13.11.49.47; Sun, 13 Oct 2019 11:50:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LMJEV2Lh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729048AbfJMSsK (ORCPT + 99 others); Sun, 13 Oct 2019 14:48:10 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:46371 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728239AbfJMSsK (ORCPT ); Sun, 13 Oct 2019 14:48:10 -0400 Received: by mail-pl1-f194.google.com with SMTP id q24so6973567plr.13 for ; Sun, 13 Oct 2019 11:48:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CeolOloPmeT1KftxvZqohSF0GTQr4950rvmG7EqO4RI=; b=LMJEV2LhnI60/Nw7SKRueRtun4v6UR9IX/6grkybDx8B+B0v9Ehmq6AwMQD3EnrlLz T31x4qCb0dMOf96n28fKNB7hh9OLhM+Gen0FZnmcaQi5qagwAWTwUurck+1UcqCNvQJm eKkovSONyDfHxxNvIVqjDHRfn4uRAtXwsX5wu0e8o+U1xDma0HpRZz2QP+UqEKyoL9sN nW+nKDBLr38INuRZIvYyEqIKUtH3TcQK8hA8Tbm8E9zpyUqYlm3psGqz08rio7VRLRd3 Ysg6cQCKIBmQmssIEBwctG8ph8/cwb7BTONUhV8DvCnwDzDx6Y4O7M5hUa/rUWf2uMHp mXxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CeolOloPmeT1KftxvZqohSF0GTQr4950rvmG7EqO4RI=; b=MFWP/O2Szn9jc8dr58B+Cy6AYxr6DszhGv/rdqb4P8zoC76UWev+XERQQTNmXqlkFp nblzdT4F8IzOEWYu8i9pwdpzHOmUpdXKOjDbENTuQu1wF7CbJ1Yuu8D/gy4RASNsGSJQ RXiP5L0Ih6ZKCnRK70QpUqsiNWz76xbRBla/UQ79TJFwnYNXCA3a41C4repuK/r7g2sE MAiCFvmLP3dE09QZS6lLw3h3Xp/kz9lZyZ/sRosc85ThU+THDCJ5MLFpwpAAS6k0d9OE LALBC11D2zztlz2VLdyEJEox1dZ+bjPxZAE7JcehDjncAIAf0Ml2S78+r0F7rfsOJhRo sb1Q== X-Gm-Message-State: APjAAAXF/Ebk5FykQauQowpY9k05csRhvybRDpE/R0DYR8NYw9kadjvp 0D+PVcbahr8iU530ycS4Q30= X-Received: by 2002:a17:902:bd05:: with SMTP id p5mr25785990pls.203.1570992489363; Sun, 13 Oct 2019 11:48:09 -0700 (PDT) Received: from wambui.zuku.co.ke ([197.237.61.225]) by smtp.googlemail.com with ESMTPSA id 4sm13813926pja.29.2019.10.13.11.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2019 11:48:08 -0700 (PDT) From: Wambui Karuga To: outreachy-kernel@googlegroups.com Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, eric@anholt.net, wahrenst@gmx.net, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] staging: vc04_services: use DIV_ROUND_UP helper macro Date: Sun, 13 Oct 2019 21:47:50 +0300 Message-Id: <20191013184750.32766-1-wambui.karugax@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Replace open-coded division calculation with the DIV_ROUND_UP helper macro for better readability. Issue found using coccinelle: @@ expression n,d; @@ ( - ((n + d - 1) / d) + DIV_ROUND_UP(n,d) | - ((n + (d - 1)) / d) + DIV_ROUND_UP(n,d) ) Signed-off-by: Wambui Karuga --- .../staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 63f71b2a492f..75104986201b 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -60,8 +60,8 @@ vchiq_static_assert(IS_POW2(VCHIQ_MAX_SLOTS_PER_SIDE)); #define VCHIQ_SLOT_MASK (VCHIQ_SLOT_SIZE - 1) #define VCHIQ_SLOT_QUEUE_MASK (VCHIQ_MAX_SLOTS_PER_SIDE - 1) -#define VCHIQ_SLOT_ZERO_SLOTS ((sizeof(struct vchiq_slot_zero) + \ - VCHIQ_SLOT_SIZE - 1) / VCHIQ_SLOT_SIZE) +#define VCHIQ_SLOT_ZERO_SLOTS DIV_ROUND_UP(sizeof(struct vchiq_slot_zero), \ + VCHIQ_SLOT_SIZE) #define VCHIQ_MSG_PADDING 0 /* - */ #define VCHIQ_MSG_CONNECT 1 /* - */ -- 2.23.0