Received: by 10.223.185.111 with SMTP id b44csp395396wrg; Fri, 9 Mar 2018 06:49:59 -0800 (PST) X-Google-Smtp-Source: AG47ELtbRPEXCP8GQosyHSEx7rpYn3A5juw+8FY9mNAlTmpGtQlTsTXhtq5SZzB5Hi2L/wPLpeyh X-Received: by 2002:a17:902:a584:: with SMTP id az4-v6mr28720468plb.20.1520606999458; Fri, 09 Mar 2018 06:49:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520606999; cv=none; d=google.com; s=arc-20160816; b=snYg4uKEmdbBXVN2/M3++1bwUzUk/ypBlcaGZte2fXr/9LuIZjWL1OSWaObtX5I1+C fa553n2VuL3Ic3J08rCGYfas0smAqtrgDqRIMvAHlPDqQcHPLzYGLBq+w66Lf2DSCDzW gGHR0U2DjzXXs4rzCcrADR6yo4oAgz196Iz051KqN+rgpD6taGgXhon6G/t6/QrU10N3 cQSdpzgNh9ZvnEG5oUugJ2s5S7Nk14TeUu42vHXeUz0hyJxLxgDN6aM4uvJAXlDciwsJ TgERh3m57Pqv0ZDrI7uIORjdVhyCtKvUg+8IBeSZAV3vR1UwDJspou8rRbu2r142Hxoz y8PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dmarc-filter :dkim-signature:dkim-signature:arc-authentication-results; bh=0EyKHaJqIbvN3c7t276CVODCXJ8yfR3M8hSCWafcV94=; b=n7jd35EdkpXMZl7nbb2LhGTcKMo58GgXwgUwVcICqiGfRGbupYuwbaSP8ai9bc5Afa PQ6Go420QAEFjqpezUWYCDvF8pUYAx6L97qb+ajYwuAe9HXZrS8rCgKdvwjBKZ2S6OEF KGdle/snO06+L3w4DVCBHb5cJGO7CUd2AEyWv4dix+JZ/3N0Xasip2FCCsxm0dMdyMkA fLDnKmoVAwPv247dKNOZc2VKVYDdVcoMChHEIeZHpdqBid2XVcXV61ot0Tb8OJLYDfag YSIakWIUAIrY6WeNOt227hQ4ApTBonE4gjM0vFAhqrxo89jSu4WmLGrZHhMSNPvn7Bx8 g8dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=TQJkIfRj; dkim=pass header.i=@codeaurora.org header.s=default header.b=TQJkIfRj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b62si966481pfl.409.2018.03.09.06.49.44; Fri, 09 Mar 2018 06:49:59 -0800 (PST) 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=@codeaurora.org header.s=default header.b=TQJkIfRj; dkim=pass header.i=@codeaurora.org header.s=default header.b=TQJkIfRj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932126AbeCIOst (ORCPT + 99 others); Fri, 9 Mar 2018 09:48:49 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:39552 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751102AbeCIOsr (ORCPT ); Fri, 9 Mar 2018 09:48:47 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E9CB7607E4; Fri, 9 Mar 2018 14:48:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520606926; bh=/K0kIyNkpYyc91hkglqqCbTidfebMw8xpaWJlM1SxKg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=TQJkIfRjuLbd5c2gLpPert7Onlzg5+vnF1R//pS3xI3WRSKLX8jY4pha5W8eYGNso /7FDkzGXjk9rKteI2BUwHYZXd9VrOQZMmdT+WStzjydMSiJUSsJXo1jsISberX9+3V bAl9SAmWdGWUIF2K9dUWi+GTfUP7qQk9k3e2EtdE= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from potku.adurom.net (88-114-240-52.elisa-laajakaista.fi [88.114.240.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5FB276053B; Fri, 9 Mar 2018 14:48:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520606926; bh=/K0kIyNkpYyc91hkglqqCbTidfebMw8xpaWJlM1SxKg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=TQJkIfRjuLbd5c2gLpPert7Onlzg5+vnF1R//pS3xI3WRSKLX8jY4pha5W8eYGNso /7FDkzGXjk9rKteI2BUwHYZXd9VrOQZMmdT+WStzjydMSiJUSsJXo1jsISberX9+3V bAl9SAmWdGWUIF2K9dUWi+GTfUP7qQk9k3e2EtdE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5FB276053B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org From: Kalle Valo To: Himanshu Jha Cc: Andreas Christoforou , keescook@chromium.org, kernel-hardening@lists.openwall.com, QCA ath9k Development , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers: net: wireless: ath: ath9: dfs: remove VLA usage References: <1520598613-3641-1-git-send-email-andreaschristofo@gmail.com> <20180309125124.GA17968@himanshu-Vostro-3559> Date: Fri, 09 Mar 2018 16:48:41 +0200 In-Reply-To: <20180309125124.GA17968@himanshu-Vostro-3559> (Himanshu Jha's message of "Fri, 9 Mar 2018 18:21:24 +0530") Message-ID: <874llpe246.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Himanshu Jha writes: > On Fri, Mar 09, 2018 at 02:30:12PM +0200, Andreas Christoforou wrote: >> The kernel would like to have all stack VLA usage removed. >> >> Signed-off-by: Andreas Christoforou >> --- >> drivers/net/wireless/ath/ath9k/dfs.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/net/wireless/ath/ath9k/dfs.c >> b/drivers/net/wireless/ath/ath9k/dfs.c >> index 6fee9a4..cfb0f84 100644 >> --- a/drivers/net/wireless/ath/ath9k/dfs.c >> +++ b/drivers/net/wireless/ath/ath9k/dfs.c >> @@ -41,7 +41,6 @@ static const int BIN_DELTA_MAX = 10; >> >> /* we need at least 3 deltas / 4 samples for a reliable chirp detection */ >> #define NUM_DIFFS 3 >> -static const int FFT_NUM_SAMPLES = (NUM_DIFFS + 1); > > Are you sure it is correct ? > Look for other users of "FFT_NUM_SAMPLES". > >> /* Threshold for difference of delta peaks */ >> static const int MAX_DIFF = 2; >> @@ -101,7 +100,7 @@ static bool ath9k_check_chirping(struct ath_softc *sc, u8 *data, >> int datalen, bool is_ctl, bool is_ext) >> { >> int i; >> - int max_bin[FFT_NUM_SAMPLES]; >> + int max_bin[NUM_DIFFS + 1]; >> struct ath_hw *ah = sc->sc_ah; >> struct ath_common *common = ath9k_hw_common(ah); >> int prev_delta; > > Always compile test the driver before sending a patch. > Also, patch title seems incorrect *ath9k* > > himanshu@himanshu-Vostro-3559:~/linux-next$ git log --oneline > drivers/net/wireless/ath/ath9k/dfs.c > 626ab67 ath9k: dfs: use swap macro in ath9k_check_chirping > 50c8cd4 ath9k: remove cast to void pointer > 8fc2b61 ath9k: DFS - add pulse chirp detection for FCC > .... Yeah, just "ath9k:" is enough as the prefix, no need to have full directory path in the title. -- Kalle Valo