Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2539066pxk; Sun, 4 Oct 2020 03:04:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0oCrJELWq90OkcBgZUehr4N4uubd+ujFQoHXnpFDIYVjlG479iFBigKY/N1RAD9Zus5DJ X-Received: by 2002:a05:6402:d09:: with SMTP id eb9mr11673445edb.219.1601805898585; Sun, 04 Oct 2020 03:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601805898; cv=none; d=google.com; s=arc-20160816; b=DLkEKFjZc0OfiWPVMWPIYTuJAcP6xqdM6YJiTbOyhJ4NfCNo62+p4BVn+y5W2yUXtC 9ch4AdPgWVziLrWqnVfA/z5gBOOdHM/U3SX07K+BlRCoxrVmkkRiN1mAjklnOUjn5pt+ eRLIFZQYMr2mEkKor1ifFFm0E66j4C9YGtzlzabMD9nw/pz9B9IKJqm5VSHwpqxLef+n HIEti4QCHmwWXcxj+/jnDC/7+v0KZ3tdpZxZRVhBpxg1Sdppfwt3imzSZd1fBG+kNRK7 59/vLyQvzSb687CFJxhR8SmewSxkcmP8nuB2rAd4RfwEQK03mZmIn5lEwqyz2AFXj8kZ Eu4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=keNOpfQ4O+xYfcXBM3doN2O5cgdGMFWMkTZ06IwdKqs=; b=nO7wdOy6qDgJL4bwQhx7oi5mFF6bO54zAVZwlqO9NZkkMGn8Wdh8+YINjvY277K4EH QDVytCMnQxjaQCwAsDivuPR5eqJWilPbNfaRl3bYrZPk3rG5XlaMa2XfN1k8d/Q79O5U YbIzu/XLUEP0bxzTkg3BOJdr0e+NQBT/6Km/7A6699ZC6LPV40V9DEgqcYy73hH4iN6v w4P85mWZq1uP2GqtOoc6AFR7YbnS/W1br7+i8XLYcl05qfbheDjBnNJ6nG3cPOFkWvVp TC7MfguO97RYjhTXOP7zTjx3hFRP7DXRL/J33d4scHrPctpnUzKAEl6kyuLsTkzE9Dot Uwkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si655482edf.589.2020.10.04.03.04.35; Sun, 04 Oct 2020 03:04:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725856AbgJDKB3 convert rfc822-to-8bit (ORCPT + 99 others); Sun, 4 Oct 2020 06:01:29 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:41028 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgJDKB2 (ORCPT ); Sun, 4 Oct 2020 06:01:28 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-261-Ghl-Rsi1Paaf30webE8vMA-1; Sun, 04 Oct 2020 11:01:23 +0100 X-MC-Unique: Ghl-Rsi1Paaf30webE8vMA-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Sun, 4 Oct 2020 11:01:23 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Sun, 4 Oct 2020 11:01:23 +0100 From: David Laight To: 'Ross Schmidt' , "gregkh@linuxfoundation.org" CC: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/8] staging: rtl8723bs: replace RND4 with round_up() Thread-Topic: [PATCH 1/8] staging: rtl8723bs: replace RND4 with round_up() Thread-Index: AQHWmew0DoS2fLKzG0OejM3ZccTfWamHNZkg Date: Sun, 4 Oct 2020 10:01:23 +0000 Message-ID: <4f67bdfee5d74096b4ea0e92524e4951@AcuMS.aculab.com> References: <20201004011743.10750-1-ross.schm.dev@gmail.com> In-Reply-To: <20201004011743.10750-1-ross.schm.dev@gmail.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ross Schmidt > Sent: 04 October 2020 02:18 > > Use round_up instead of define RND4. RND4 was also particularly horrid! ... > diff --git a/drivers/staging/rtl8723bs/core/rtw_security.c > b/drivers/staging/rtl8723bs/core/rtw_security.c > index 7f74e1d05b3a..159d32ace2bc 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_security.c > +++ b/drivers/staging/rtl8723bs/core/rtw_security.c > @@ -260,7 +260,7 @@ void rtw_wep_encrypt(struct adapter *padapter, u8 *pxmitframe) > arcfour_encrypt(&mycontext, payload+length, crc, 4); > > pframe += pxmitpriv->frag_len; > - pframe = (u8 *)RND4((SIZE_PTR)(pframe)); > + pframe = (u8 *)round_up((SIZE_PTR)(pframe), 4); I also suspect this is equivalent to: pframe == round_up(pxmitpriv->frag_len, 4); Does make one wonder whether the skipped bytes need to be zeroed though. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)