Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3643747ybp; Sun, 13 Oct 2019 11:06:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCbOz137hV9We9Zbcnq4NRzXMkVDj8tTuYhaeLCw0l+qWGgiKGcB9ljDZc6YYrwH3GgyB6 X-Received: by 2002:a50:d54c:: with SMTP id f12mr24470721edj.116.1570990016350; Sun, 13 Oct 2019 11:06:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570990016; cv=none; d=google.com; s=arc-20160816; b=fjnZ/+Ne8JwJE9OMFepBcox0azbuYpqUjIuHOCnf8gcFukpUwcl4C7yykUxRoy30va lctHoGeM2aJ+hFwwDmQbbKo62zwVxvHwTQ0c9j9pDrw74H/jJJclpi5k3QR8yteaTPH4 9LwYmH++UnXa5E0szW4ezrPvIJrczPIKp1zMpkzrT8fAfFkA2A0spovi3IYTCxUkRuda YZg7LSl4KQNzd3JYo5I/77WZ9OcbrUuRofO100BaHfyCcIiMlq4Q3BP6QlJtfRtqd4Im 5Ow6kPWlTiC3AgGRrzSHeVMRkwn+p4BjjYiS7waZJGOudSlJFxZ8Y+QmpkcfAsiSkJyW F7KA== 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=8r79MD/BEEnSIAVQ+CzUkPVwR0O8qcg525+i9tMWUcw=; b=CJC54xNUxXzdUKWHbUodIAwm8eKfa27Hb3/7aNi4AqdwBJG31Spez7KJJT4ceFjh4O 9x9TKRxbpYwiHHIowmRto9WcLPs22llRbx4Tz2unq0aCUo9DDttbZ3d6aTiHlsPGF6FC 3Fp6ofPiMVnfCjklEpx/7o+2ITe0j/iHwsvHU7iHMiAGQsuR4UWJpbpkfLP6d/Rjkcb/ VapHdiWJMF1nYxwAsqNu4PUTxVMJ9pmT/ohvjG+QOTjKHMkfMZQkDsuv1qtJyvUkDruj Ow3Ew7IHREW6nb8x82HKkL5yWeOaDBhLrTSBYsHRevVzUrLgmosoXlJ+YzQOAg0Ef15y BLmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tlZ+GjrJ; 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 b56si11179805edb.418.2019.10.13.11.06.18; Sun, 13 Oct 2019 11:06:56 -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=tlZ+GjrJ; 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 S1728621AbfJMSAw (ORCPT + 99 others); Sun, 13 Oct 2019 14:00:52 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:47083 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727141AbfJMSAw (ORCPT ); Sun, 13 Oct 2019 14:00:52 -0400 Received: by mail-pf1-f194.google.com with SMTP id q5so9031612pfg.13 for ; Sun, 13 Oct 2019 11:00:50 -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=8r79MD/BEEnSIAVQ+CzUkPVwR0O8qcg525+i9tMWUcw=; b=tlZ+GjrJmm+pMVXcYwCyYsBU7+nGadcNcqt0EGighjvOdyCryrYHXi5PRANAw+9tiC 8/33P4psG2DscmaMjaRIAv7woVnKu87oCYZml8Y4R6FTbpPV0Wvrp2LP5KM+I6m9tYoq hMb+i8oLB01xKzyw7z+Vpgu26FiBLrvFijKzSQpp3yql8lwrhBP9v03UyNjxCiExyRGt RtxhkJVJZ22VSWdtArTRIoqRAhDZJHpI0P4eyc0BPHBKHyWapyK5fUfYxOEdyhwd5yZb bU+AfYSujv4QYuN1+SI6p5W2q8PvkZHZROJh9jccYyZaedYBj4OjdYGRllQgm0/QxZPf fkvw== 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=8r79MD/BEEnSIAVQ+CzUkPVwR0O8qcg525+i9tMWUcw=; b=JGACO0zc/ygYEq37FEWWJ+OGDOr+frfFIrp/x+kCieGHLD9qb3U7MyEXYvyeiuPs4y jWS2fy8xuId1mSMp4oO3ptYcFzzSYxkv5cyNAsuV8xyMVtA3nbDqAAD6/KDOQHBPdHaE rqj5IoulNV6/YsRv7KtxVExp2fjMSVUq4T50AH6yIT3nA6uhwXkrsS8p7xJVBX91X1No kuxbCeuBxPzfKbrrJmd2hwtjyUXSDjth2ztfe3BxoRLFXXtF80pS7G0WfQHj6zA1oFhE DhJ9m/gmnOA1ea+5nFPC+c53i+VMzJ2puoK+z3bmIag1DQoxUfP+PJdh2Q9qxDosX0Xv XSsQ== X-Gm-Message-State: APjAAAVPtD9O8SG1YFfthfvVniUB38XWjUgJCCRxCXQb/qis7A+QWZQK cEnLLuN6NeY24zxiyrX17z8= X-Received: by 2002:a62:3387:: with SMTP id z129mr27658647pfz.253.1570989650114; Sun, 13 Oct 2019 11:00:50 -0700 (PDT) Received: from wambui.zuku.co.ke ([197.237.61.225]) by smtp.googlemail.com with ESMTPSA id s10sm29657474pgn.9.2019.10.13.11.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2019 11:00:49 -0700 (PDT) From: Wambui Karuga To: outreachy-kernel@googlegroups.com Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8723bs: use DIV_ROUND_UP helper macro Date: Sun, 13 Oct 2019 21:00:33 +0300 Message-Id: <20191013180033.31882-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 Use the DIV_ROUND_UP macro to replace open-coded divisor calculation to improve 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 --- drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index 87535a4c2e14..74312e8bb32e 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -4158,7 +4158,8 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val) /* The value of ((usNavUpper + HAL_NAV_UPPER_UNIT_8723B - 1) / HAL_NAV_UPPER_UNIT_8723B) */ /* is getting the upper integer. */ - usNavUpper = (usNavUpper + HAL_NAV_UPPER_UNIT_8723B - 1) / HAL_NAV_UPPER_UNIT_8723B; + usNavUpper = DIV_ROUND_UP(usNavUpper, + HAL_NAV_UPPER_UNIT_8723B); rtw_write8(padapter, REG_NAV_UPPER, (u8)usNavUpper); } break; -- 2.23.0