From mboxrd@z Thu Jan 1 00:00:00 1970 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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable 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 287CFC4CECE for ; Sun, 13 Oct 2019 19:31:28 +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 EABDF207FF for ; Sun, 13 Oct 2019 19:31:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LIi/Tw8t" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EABDF207FF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lip6.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:Message-ID: In-Reply-To:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=12NX5pjwrv7+wxkqm5+wqlWtvVKWKaJt+dyZQJ5+YzA=; b=LIi/Tw8tFd31IW UVHMf0gKgytjLw5UKO9LBWApKX1BzZpg1/vyK6y9YLPyHGhlhKbOU32ywU9dOwd/D+wPviThMAXk2 m7HL8CGc3NqVugPvzyc9hnMgPgEDIAkKWPIS97AZLRecDF/xuFK45pg5ry7wAVKpZ5IyOTqxd60iZ 4yGDHDT+S6bNRnPprSl5ctjrcrAmVhOaaZ2KJR/0RM9JCZfOUEIAEPAFYM9VrhiYjLGSuD6Wblm5w qqrphqf5dzMobyl3yRMzTc8lQTEmk7Z6g3bSeki5gHLSfMD3TZOdDcYzDu8Hy9gOTsPs2+Shp+Jpf 2GC0s3rIFee1ddexuorg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJjaK-0003hT-VE; Sun, 13 Oct 2019 19:31:20 +0000 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iJjaG-0003gY-Uh; Sun, 13 Oct 2019 19:31:18 +0000 X-IronPort-AV: E=Sophos;i="5.67,293,1566856800"; d="scan'208";a="405952555" Received: from 81-65-53-202.rev.numericable.fr (HELO hadrien) ([81.65.53.202]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2019 21:31:14 +0200 Date: Sun, 13 Oct 2019 21:31:13 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Wambui Karuga Subject: Re: [Outreachy kernel] [PATCH v2] staging: rtl8723bs: use DIV_ROUND_UP helper macro In-Reply-To: <20191013191027.6470-1-wambui.karugax@gmail.com> Message-ID: References: <20191013191027.6470-1-wambui.karugax@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191013_123117_262148_40DCA821 X-CRM114-Status: GOOD ( 18.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, eric@anholt.net, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com, bcm-kernel-feedback-list@broadcom.com, wahrenst@gmx.net, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, 13 Oct 2019, Wambui Karuga wrote: > 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 Acked-by: Julia Lawall > --- > Changes in v2: > - Remove comment that explained previously used calculation. Maybe it is not very important for a comment, but remember that what is below the --- will disappear in the history. So when actual code changes, it may be necessary to integrate the extended change in the commit log as well as putting it in the v2 changes. julia > --- > drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c > index 87535a4c2e14..22931ab3a5fc 100644 > --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c > +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c > @@ -4156,9 +4156,8 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val) > break; > } > > - /* 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 > > -- > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20191013191027.6470-1-wambui.karugax%40gmail.com. > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel