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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C407CC433F5 for ; Mon, 24 Jan 2022 08:06:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242007AbiAXIGn (ORCPT ); Mon, 24 Jan 2022 03:06:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236250AbiAXIGn (ORCPT ); Mon, 24 Jan 2022 03:06:43 -0500 Received: from proxima.lasnet.de (proxima.lasnet.de [IPv6:2a01:4f8:121:31eb:3::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F45BC06173B; Mon, 24 Jan 2022 00:06:43 -0800 (PST) Received: from [IPV6:2003:e9:d710:1b05:ba7e:5f91:8990:5776] (p200300e9d7101b05ba7e5f9189905776.dip0.t-ipconnect.de [IPv6:2003:e9:d710:1b05:ba7e:5f91:8990:5776]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: stefan@datenfreihafen.org) by proxima.lasnet.de (Postfix) with ESMTPSA id A4CE1C0E6E; Mon, 24 Jan 2022 09:06:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=datenfreihafen.org; s=2021; t=1643011601; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QfynIM7dANV+4ACFIZ+j2XalPdrkZqXp4duBstPL+io=; b=PL98yBYFrKmsiQuNThavxMlflZTejGBI7A9ZRkryOJ+NDDYuYD+709A5oQIehNMnBg+Tsu gwyX8niVjD7fGJpHf5ERQXJP82zSssbpXWKZvGhgEYdx32IB4MLmnbIs81m/VFh1QMa4p4 m0/YkyVspPiUuihn6uW/dHvgZdjYJ6cyUfyDQplREcpHX9oaqRH8CI987dL+Ymu3b7OcQL N5ZlgyYNLFQOkUM98clzwUsLnc9FCAfn1FxKE9PBcaEHjKD5wHWs1jmQb/AQXnFI0x++Lu Xf09FYALtaTSV6LQEbUsSraqX50BjQBzNPaOHap/+4Czxh8QRnrhyNty6dX/iw== Message-ID: <7287b3d9-dbdd-c2c3-01c7-1f272749ebb9@datenfreihafen.org> Date: Mon, 24 Jan 2022 09:06:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [wpan-next v2 6/9] net: ieee802154: Use the IEEE802154_MAX_PAGE define when relevant Content-Language: en-US To: Alexander Aring , Miquel Raynal Cc: linux-wpan - ML , "David S. Miller" , Jakub Kicinski , "open list:NETWORKING [GENERAL]" , Xue Liu , Marcel Holtmann , Harry Morris , David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Thomas Petazzoni References: <20220120112115.448077-1-miquel.raynal@bootlin.com> <20220120112115.448077-7-miquel.raynal@bootlin.com> From: Stefan Schmidt In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hello. On 23.01.22 21:44, Alexander Aring wrote: > Hi, > > On Thu, 20 Jan 2022 at 06:21, Miquel Raynal wrote: >> >> This define already exist but is hardcoded in nl-phy.c. Use the >> definition when relevant. >> >> Signed-off-by: Miquel Raynal >> --- >> net/ieee802154/nl-phy.c | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c >> index dd5a45f8a78a..02f6a53d0faa 100644 >> --- a/net/ieee802154/nl-phy.c >> +++ b/net/ieee802154/nl-phy.c >> @@ -30,7 +30,8 @@ static int ieee802154_nl_fill_phy(struct sk_buff *msg, u32 portid, >> { >> void *hdr; >> int i, pages = 0; >> - uint32_t *buf = kcalloc(32, sizeof(uint32_t), GFP_KERNEL); >> + uint32_t *buf = kcalloc(IEEE802154_MAX_PAGE + 1, sizeof(uint32_t), >> + GFP_KERNEL); >> >> pr_debug("%s\n", __func__); >> >> @@ -47,7 +48,7 @@ static int ieee802154_nl_fill_phy(struct sk_buff *msg, u32 portid, >> nla_put_u8(msg, IEEE802154_ATTR_PAGE, phy->current_page) || >> nla_put_u8(msg, IEEE802154_ATTR_CHANNEL, phy->current_channel)) >> goto nla_put_failure; >> - for (i = 0; i < 32; i++) { >> + for (i = 0; i <= IEEE802154_MAX_PAGE; i++) { >> if (phy->supported.channels[i]) >> buf[pages++] = phy->supported.channels[i] | (i << 27); >> } > > Where is the fix here? While its more cleanup than fix, its clear and easy and there is no problem for it to go into wpan instead of wpan-next. regards Stefan Schmidt