From patchwork Mon Mar 14 14:18:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102597 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp63873lbc; Mon, 14 Mar 2016 07:19:23 -0700 (PDT) X-Received: by 10.66.191.225 with SMTP id hb1mr38160646pac.78.1457965163246; Mon, 14 Mar 2016 07:19:23 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si15207162pfh.69.2016.03.14.07.19.22; Mon, 14 Mar 2016 07:19:23 -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; 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 S934293AbcCNOTE (ORCPT + 31 others); Mon, 14 Mar 2016 10:19:04 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:61499 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755721AbcCNOS6 (ORCPT ); Mon, 14 Mar 2016 10:18:58 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0M8zUb-1aY4wv2cyT-00CRQZ; Mon, 14 Mar 2016 15:18:48 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: netdev@vger.kernel.org, Arnd Bergmann , Yishai Hadas , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] mlx4: add missing braces in verify_qp_parameters Date: Mon, 14 Mar 2016 15:18:34 +0100 Message-Id: <1457965120-3155420-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457965120-3155420-1-git-send-email-arnd@arndb.de> References: <1457965120-3155420-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:kaW19/SmBjZ31c7L/MzVS7CB6zSE20Kb+noYXLmhKkP9vgK2Fmu OqIC/6YwAbGYIl0CiqXHJZq3OXnqjCnclpIZMbRTVR2jvard0ggWoQ3GqUXZ8wyLgJjJPmS G9fGa1GRPDuGXuYDFd+xhw3BMsMHsor8x9TPYd1eyLeQEG6Joh8TRNWUPBmstzcdu8XN91M 1E8REInZSVk4zzWye8ZEg== X-UI-Out-Filterresults: notjunk:1; V01:K0:YF1uiORSP4U=:CCianx1fGhCHqr/dk5/lbt c/AvuoAenBk3/mSubwYXg3EMYOJP1bt1iVXaMet/Dpt582d4vpS7cqCkR01iKhGLZ9r5t/D/V Wle9nGLKU2AvU0Pb540lTSEg8OqNSL5Qtr9ed5pyofHAMRrpl5I4wQaSZ98pwqMMgcImL1tv/ gKg9wmHqlFgQWOJOT9w+yKDGtEAWEpMsPKu0zVyY0H36ih68/HRn8ZTqQQMk52/9/rTi8wvnc BxMtJ8P6TZCJnazNHJ9bomhLexWVl+mspIqaGjKyo8AmqSeSLs2loMtjayGUy5QsOh0L9I1F/ 5FmQpa5ZvZS/RAjNMNiy1OU3JHH9LLvq+eumc4dgOEH4FjzUOQJS42NzPjYPlGC0Jy9njBguK dQ3jU0yqp1rVUQyVGl36JJzxJ+h4H4h4xHOe9eB1/8duvVLtZtOcFzUmTlFq934vDnH72t58M f5wAqmqRfzVX1+DlpBn6PLJDIA5V4vkdpRWcbPiX5Q5Idu2EalpjXIBE5O5MpdgQDUADB4hhQ 9BlYsD/fjE/iKeuY8tPIWnzM2fbqXARgGnEhg+Hk+ywZcvcGXsRCA+QizBiXvEMs+OnFederJ LwZN80iGPxuRrG6QkDioePDfg03basQpFBQz+o7YE96IGNJHHepqw6UcxUKPEXlTLcu65q3CZ 0c53UzUFdaqIjT7SQsCW8omvCArlJqD3k9ZFhDHP/9f+FZM5sU6MnLLG6Gc9lbT1fTT4= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The implementation of QP paravirtualization back in linux-3.7 included some code that looks very dubious, and gcc-6 has grown smart enough to warn about it: drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function 'verify_qp_parameters': drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:3154:5: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation] if (optpar & MLX4_QP_OPTPAR_ALT_ADDR_PATH) { ^~ drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:3144:4: note: ...this 'if' clause, but it is not if (slave != mlx4_master_func_num(dev)) >From looking at the context, I'm reasonably sure that the indentation is correct but that it should have contained curly braces from the start, as the update_gid() function in the same patch correctly does. Signed-off-by: Arnd Bergmann Fixes: 54679e148287 ("mlx4: Implement QP paravirtualization and maintain phys_pkey_cache for smp_snoop") --- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index 25ce1b030a00..cd9b2b28df88 100644 --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -3141,7 +3141,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev, case QP_TRANS_RTS2RTS: case QP_TRANS_SQD2SQD: case QP_TRANS_SQD2RTS: - if (slave != mlx4_master_func_num(dev)) + if (slave != mlx4_master_func_num(dev)) { if (optpar & MLX4_QP_OPTPAR_PRIMARY_ADDR_PATH) { port = (qp_ctx->pri_path.sched_queue >> 6 & 1) + 1; if (dev->caps.port_mask[port] != MLX4_PORT_TYPE_IB) @@ -3160,6 +3160,7 @@ static int verify_qp_parameters(struct mlx4_dev *dev, if (qp_ctx->alt_path.mgid_index >= num_gids) return -EINVAL; } + } break; default: break; From patchwork Mon Mar 14 14:18:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102594 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp65558lbc; Mon, 14 Mar 2016 07:22:16 -0700 (PDT) X-Received: by 10.66.218.225 with SMTP id pj1mr37750857pac.83.1457965335848; Mon, 14 Mar 2016 07:22:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t27si369488pfi.203.2016.03.14.07.22.15; Mon, 14 Mar 2016 07:22:15 -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; 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 S965365AbcCNOWG (ORCPT + 31 others); Mon, 14 Mar 2016 10:22:06 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:57204 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965345AbcCNOWA (ORCPT ); Mon, 14 Mar 2016 10:22:00 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MY6a0-1aJSLj3BQG-00Uu0s; Mon, 14 Mar 2016 15:18:51 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: netdev@vger.kernel.org, Arnd Bergmann , Kevin Curtis , linux-kernel@vger.kernel.org Subject: [PATCH 2/5] farsync: fix off-by-one bug in fst_add_one Date: Mon, 14 Mar 2016 15:18:35 +0100 Message-Id: <1457965120-3155420-3-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457965120-3155420-1-git-send-email-arnd@arndb.de> References: <1457965120-3155420-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:W2UtQ8La++AGBSUuRysWk0inS4o+rmjlm379RCntvVcvF6rOANA bdy9Q1FkndBtbU+qg7PLZ0mZtcOki9euaXHjiMZWmwvf6czIeRgRRWfg5WUZ2Tb9nk1IRDd HQd2pXZ4Ox6/5ZcUbnCKgrpO4Qb5xigXgo6kQfOSRzC+tPjtlwt9nwxLx2/Ox5jiH8iDxQs Ha/BU5C15HlP3vJyuy33A== X-UI-Out-Filterresults: notjunk:1; V01:K0:2vBQcCGmBTM=:Z57RblR00L6SWK4ekvZcM+ re4hj8ZOd9Yq2jhV0S0eRQ5cC8zD6lUSbkfFYG0ghC1j7rErxzA+b44t4hqdgOCjsf8I1hXEH yMovkfBYoHTFYaOTX8OvKMkBQVmYfNfzvcrSQTjGrmF5747FsFOxICnq9w/Y7++AoO2UbBZr1 DTZ/XME9IUY4Kuznj7xYVRkAWrGgwbEOXGTN69pgfKZPKxRs8Fw8/u2orVaPv/gkFP3obMchy jICm//fPrmNZ49Q4LR25x2Y/4bBXpsipLitWl1gQAAFeq3j3VkQaJn4QPjp39JlvJ7jZpM2Lt t3C5bYwTZgmMWDBdxr8qhRB2SE7bE/Kn0876TuUG8ziRMa9uJ3tkZ7eJBSmIFlrvKWfGRdfpJ V+Vn34ZJEzDap5lq/Lsm+l3JAmnwXxOf29UzelHuCIMvApok+V+Fe1GWAaNzrBYNVUbJbuV9F UtZs5NYvDXskahg5DOohkQZALZc+3LXGv5+s6CEzAA8i/eWMYe78A7lJJuBGUoxGyT4eSl394 dhMzEIDQtLPhq0JdssUbU2qXZPGzMEOlbY5cCQnAJ1OM4HZaGnjnZ+iSO47tNvP9YASaZhUcx RadMnSrRd/Y2ebHErzKdbHu8PObxjBHizQugsDBO6cn1ZQbwEREpcoLxxDvnHqLkYd40W2Pq7 LZ4whk7SqGcQHr1D9IUO5tIFGUiJkN7ZpQQv+KpH8icM9E5z3jVNC4WpcZF9n8Wl/8Vk= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc-6 finds an out of bounds access in the fst_add_one function when calculating the end of the mmio area: drivers/net/wan/farsync.c: In function 'fst_add_one': drivers/net/wan/farsync.c:418:53: error: index 2 denotes an offset greater than size of 'u8[2][8192] {aka unsigned char[2][8192]}' [-Werror=array-bounds] #define BUF_OFFSET(X) (BFM_BASE + offsetof(struct buf_window, X)) ^ include/linux/compiler-gcc.h:158:21: note: in definition of macro '__compiler_offsetof' __builtin_offsetof(a, b) ^ drivers/net/wan/farsync.c:418:37: note: in expansion of macro 'offsetof' #define BUF_OFFSET(X) (BFM_BASE + offsetof(struct buf_window, X)) ^~~~~~~~ drivers/net/wan/farsync.c:2519:36: note: in expansion of macro 'BUF_OFFSET' + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER][0]); ^~~~~~~~~~ The warning is correct, but not critical because this appears to be a write-only variable that is set by each WAN driver but never accessed afterwards. I'm taking the minimal fix here, using the correct pointer by pointing 'mem_end' to the last byte inside of the register area as all other WAN drivers do, rather than the first byte outside of it. An alternative would be to just remove the mem_end member entirely. Signed-off-by: Arnd Bergmann --- drivers/net/wan/farsync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 44541dbc5c28..69b994f3b8c5 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c @@ -2516,7 +2516,7 @@ fst_add_one(struct pci_dev *pdev, const struct pci_device_id *ent) dev->mem_start = card->phys_mem + BUF_OFFSET ( txBuffer[i][0][0]); dev->mem_end = card->phys_mem - + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER][0]); + + BUF_OFFSET ( txBuffer[i][NUM_TX_BUFFER - 1][LEN_RX_BUFFER - 1]); dev->base_addr = card->pci_conf; dev->irq = card->irq; From patchwork Mon Mar 14 14:18:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102593 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp65775lbc; Mon, 14 Mar 2016 07:22:41 -0700 (PDT) X-Received: by 10.98.40.4 with SMTP id o4mr30860000pfo.76.1457965361164; Mon, 14 Mar 2016 07:22:41 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yp9si2050247pab.121.2016.03.14.07.22.40; Mon, 14 Mar 2016 07:22:41 -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; 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 S965112AbcCNOUi (ORCPT + 31 others); Mon, 14 Mar 2016 10:20:38 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:55853 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934373AbcCNOUd (ORCPT ); Mon, 14 Mar 2016 10:20:33 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0MXprj-1aI5Z93OkB-00WpYP; Mon, 14 Mar 2016 15:18:56 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: netdev@vger.kernel.org, Arnd Bergmann , QCA ath9k Development , Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] ath9k: fix buffer overrun for ar9287 Date: Mon, 14 Mar 2016 15:18:36 +0100 Message-Id: <1457965120-3155420-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457965120-3155420-1-git-send-email-arnd@arndb.de> References: <1457965120-3155420-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:sdjLH/htK5mppyPsmHtI+QH4uKKiXjkJ/uwsVX5i0drjHK5Sk58 Gn5r1UWGdg80l8lTw0FEIV8MEI/wv32fBvEpPi46D9a3xThsIup2k73Co2gP4vfR/98UbVD kPoE8UcqlBl3K3UfoTGs9Kq6CS6iJQ6aBfW+bEi/7pMLXhryaBpILyyhDW5q11R7qqljiyr TPvGB9mFQpyZM6rLOceiw== X-UI-Out-Filterresults: notjunk:1; V01:K0:uVEfDJhNYaU=:Tv2wD2iI4euGBfjzDZmQnz PkgWrICxFymSiKb+XBMn67Pa9tlvwBBusmZCGYxaSOkMzgaxiilDcY9+O5vXrM7DPSFkJrx5l b0X3c8tmLrpwSM39fmg22uAqMY06kx9+KkINNHoFYtL/Uni32qzk7egqNEo2I6fxUuI2eusKq uUwVOh9uP7/s5DfiqyBo7SgeqKJijoWGYC5KK7OJPUlRVSVUKcl4kixSXmz3/ZZx2kxVaNnL2 KJMDfeV3Z7776hSBTTESfxuJWbqCVIG/6qn6CIF+oys9x6Cbs//bgmnTPxmQlRmi9dDCK5Uu1 YQBu2yd1bbOYDM2DJGkdvP5dcxjCMaEYJLHW5RWRc0vShoNQ7fa/L0oc2KgNweM+6URGTLfSQ n2jCQ+0nXvyFzjIjaHhrhjnR8k2jLaHhDIrfC/DR83dzak0Eaa6Mk6Qu/pLdsJd++TT+/8TLp 74mF0WBuqiWKHxhGrBBlKlpv6ZQtp2FLtKWnJvgblXmbI8AyG7yJw38XfncSKyGHGAHdOVdsJ QGBN024Dn61O6uuSiCQeAzv+nFxoxKsbV+EqV/ZilwrdMDu0+dxXUVqYdv65B4M9S1IDe6mP5 TRj972n+zLCPtTxg4PL7XM1VmL0pcMFduoAvv1Cax0XpanaKm6wYBoaDh8LPLuqWLOcsdfFHe NWjoddDTf+pr7LTtf3oFNH+kgZ3kbwLkEzN8oApdhxBDSwQhE3D4CyPAkOh1BsG/f0w0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Code that was added back in 2.6.38 has an obvious overflow when accessing a static array, and at the time it was added only a code comment was put in front of it as a reminder to have it reviewed properly. This has not happened, but gcc-6 now points to the specific overflow: drivers/net/wireless/ath/ath9k/eeprom.c: In function 'ath9k_hw_get_gain_boundaries_pdadcs': drivers/net/wireless/ath/ath9k/eeprom.c:483:44: error: array subscript is above array bounds [-Werror=array-bounds] maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4]; ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ It turns out that the correct array length exists in the local 'intercepts' variable of this function, so we can just use that instead of hardcoding '4', so this patch changes all three instances to use that variable. The other two instances were already correct, but it's more consistent this way. Signed-off-by: Arnd Bergmann Fixes: 940cd2c12ebf ("ath9k_hw: merge the ar9287 version of ath9k_hw_get_gain_boundaries_pdadcs") --- drivers/net/wireless/ath/ath9k/eeprom.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.7.0 diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c index 73fb4232f9f2..a794157a147d 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.c +++ b/drivers/net/wireless/ath/ath9k/eeprom.c @@ -477,10 +477,9 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah, if (match) { if (AR_SREV_9287(ah)) { - /* FIXME: array overrun? */ for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = data_9287[idxL].pwrPdg[i][0]; - maxPwrT4[i] = data_9287[idxL].pwrPdg[i][4]; + maxPwrT4[i] = data_9287[idxL].pwrPdg[i][intercepts - 1]; ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], data_9287[idxL].pwrPdg[i], data_9287[idxL].vpdPdg[i], @@ -490,7 +489,7 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah, } else if (eeprom_4k) { for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = data_4k[idxL].pwrPdg[i][0]; - maxPwrT4[i] = data_4k[idxL].pwrPdg[i][4]; + maxPwrT4[i] = data_4k[idxL].pwrPdg[i][intercepts - 1]; ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], data_4k[idxL].pwrPdg[i], data_4k[idxL].vpdPdg[i], @@ -500,7 +499,7 @@ void ath9k_hw_get_gain_boundaries_pdadcs(struct ath_hw *ah, } else { for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = data_def[idxL].pwrPdg[i][0]; - maxPwrT4[i] = data_def[idxL].pwrPdg[i][4]; + maxPwrT4[i] = data_def[idxL].pwrPdg[i][intercepts - 1]; ath9k_hw_fill_vpd_table(minPwrT4[i], maxPwrT4[i], data_def[idxL].pwrPdg[i], data_def[idxL].vpdPdg[i], From patchwork Mon Mar 14 14:18:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102596 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp64141lbc; Mon, 14 Mar 2016 07:19:55 -0700 (PDT) X-Received: by 10.66.222.129 with SMTP id qm1mr37976233pac.22.1457965195174; Mon, 14 Mar 2016 07:19:55 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pz7si947507pab.216.2016.03.14.07.19.54; Mon, 14 Mar 2016 07:19:55 -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; 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 S1755833AbcCNOTx (ORCPT + 31 others); Mon, 14 Mar 2016 10:19:53 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:50214 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755806AbcCNOTu (ORCPT ); Mon, 14 Mar 2016 10:19:50 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0Lzb6o-1ZjZcv0m94-014mnM; Mon, 14 Mar 2016 15:18:59 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: netdev@vger.kernel.org, Arnd Bergmann , QCA ath9k Development , Kalle Valo , linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] ath9k: fix misleading indentation Date: Mon, 14 Mar 2016 15:18:37 +0100 Message-Id: <1457965120-3155420-5-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457965120-3155420-1-git-send-email-arnd@arndb.de> References: <1457965120-3155420-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:4g4VEdoEvTm1BktcRGEJ40qR4AWAbVEXmfu5fc+UmiWjertll3q WQZ4aGSwIy9xaqGHYDgaNhPJFecKo6VG7VGTvmpLuOYHuiuV/gkqj+7k917nhkRsDEOGVKW VyJyKdXffbWwOqiIKE4t+u/3URjQGJ0DVwYvjvFviJwGQWxtvS9IxAYF/Uw/dc5DX6KV9Qz IDNIyGKRYzmqRrxNinkaQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:0IqC/R7nRDE=:64b1DqmdL7LhDE3iFKvemd noHDLBzdvWyzj1TEIy1WwTH0KmmQqXlp4z9t7QnfNp67+EltVegytGvFGxBkKa68cN7l9i+k6 VNElbosUTmDmuPrvJU5bkXXVXUNZEN3XF+v/36ynLZNyizOEFNnClpvP6ulyoytUVbsr0K4w+ yofnIGNA5O8ffJFTpG7B6SJr0rpwhEuJMBm/Qhuyi+15IN1CH8hEvpRuJgD7E2kqjwqMWDebO je+KgD2lgHBNuY1rwOR243HrEf5P865V4y1ARV3kYI5h8ZRJPkMLutb6S1P4YeFdMigE0LiN9 hsTgQF7MwkBXOkTq24taimhJrghYiaVzxXtf2vHFjRKLBADERI1k02muef0Q1hhBYY9w2vutj PWw2/+JSV2SpEOJ1AOX+mLaWc1eZiglQ7ZmsgTjVwY4k6ufXF8bBKfl6f4/SCf2VXUc56yLhs Zo4lmtDx2Sg1bZ7YgEG2As7/HX1iHxP/zfV3iwjdWQo7Juc5nAh5TBNJR/myuPGBrRENZnG4B uZqY5GdFVHPaoS/S0dt4TNaNp6QsKeE26BVpIGU+flb40vQ8mdTywnxCx1BEmvAOWe8EfvudA Jlse0+hrewfZDLPx3Ki+UcYMfLc6OR0a6JQstxlIrUedkjrLUvuk28NGv6JV7Ob3C8qXDQJR3 oy2KrsY8blH8xUbwQKiEoSPy1int+vkbXMQMfmzt6yuvDEQclBQHTWpd/HJBqF+t4708= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A cleanup patch in linux-3.18 moved around some code in the ath9k driver and left some code to be indented in a misleading way, made worse by the addition of some new code for p2p mode, as discovered by a new gcc-6 warning: drivers/net/wireless/ath/ath9k/init.c: In function 'ath9k_set_hw_capab': drivers/net/wireless/ath/ath9k/init.c:851:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation] hw->wiphy->iface_combinations = if_comb; ^~ drivers/net/wireless/ath/ath9k/init.c:847:3: note: ...this 'if' clause, but it is not if (ath9k_is_chanctx_enabled()) ^~ The code is in fact correct, but the indentation is not, so I'm reformatting it as it should have been after the original cleanup. Signed-off-by: Arnd Bergmann Fixes: 499afaccf6f3 ("ath9k: Isolate ath9k_use_chanctx module parameter") Fixes: eb61f9f623f7 ("ath9k: advertise p2p dev support when chanctx") --- drivers/net/wireless/ath/ath9k/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.0 diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index d4e0ac946c3a..1c226d63bb03 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -848,8 +848,8 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_DEVICE); - hw->wiphy->iface_combinations = if_comb; - hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); + hw->wiphy->iface_combinations = if_comb; + hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); } hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; From patchwork Mon Mar 14 14:18:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102591 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp66652lbc; Mon, 14 Mar 2016 07:24:16 -0700 (PDT) X-Received: by 10.66.255.39 with SMTP id an7mr38297629pad.2.1457965455920; Mon, 14 Mar 2016 07:24:15 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ey9si1274027pab.123.2016.03.14.07.24.15; Mon, 14 Mar 2016 07:24:15 -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; 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 S934415AbcCNOYN (ORCPT + 31 others); Mon, 14 Mar 2016 10:24:13 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:52549 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934376AbcCNOYK (ORCPT ); Mon, 14 Mar 2016 10:24:10 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue102) with ESMTPA (Nemesis) id 0Lud28-1ZfhkV3I6y-00zr7O; Mon, 14 Mar 2016 15:19:03 +0100 From: Arnd Bergmann To: "David S. Miller" Cc: netdev@vger.kernel.org, Arnd Bergmann , Dmitry Tarnyagin , linux-kernel@vger.kernel.org Subject: [PATCH 5/5] net: caif: fix misleading indentation Date: Mon, 14 Mar 2016 15:18:38 +0100 Message-Id: <1457965120-3155420-6-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457965120-3155420-1-git-send-email-arnd@arndb.de> References: <1457965120-3155420-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:fyRpTBThvSrKNYDSVTEVdRYyGD7IYqFLmSrgaM7JIrAK0hHX6p3 rTW7W/pWyG3zQk9PaU7IKPM9IOPVsQ7JK4Mse+YuLgGjbDW0AthDGXB4hubE4iYyI1RB/E7 7+0c6fygc63GxNyvY5DOwCadFVJzsTWJqKHgwIw6vjE/vc0lv0AiqwsRHIABxsw+DKEhtU0 raKDkTtsZE585iWZ/Eo5Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:CPVurz1wH/0=:7MOOnxxBywNWzxA6fa6jNY 27j2uAiRyJaa5Vj1a7ENXE1YmdquBPHwzx7Vi7nP27W25VogdSSh+HG2kC6UX0973fwA0Bn1E nDoMUAXjW5dB7M3/Yb15PJmHfCZA92JFMNqB7JAvuH38G6jcV6suK1Hf5PuLlP6dObJKYP0YR ewDVMYW9GQ6kc2LifJu105uw20vOxW+Cfr/GkB/vPMJaiNXAefXJCCtFG4Qyug8Jh/K89qMkh pbqnJIAE2T/afB1b8qlXbXNxYMayuUqyQXmn6eU6vhP9aPdJtdgdep54sl0tahl1atAUz5VbI XSo+yd8fgjDM1u0r0i9QruA5+CUtKXTciMRy2X8Aw+GBUNwWimceyn6QKgTRiq5tkv9ZNTEt5 OuOeuM9xnugqVei1cR/gy1ir/OnuWhVxI3Gfe+YuU8Si3kOAAWs53LshJzboFOS2yYtSvQtpB M0wOl7NOulrGWsD7nz51Nc5MhWiutlbpdPe4A/HISYPnbIIAxybE8m69LOs4cBFr3Ab13r1+e WXOcr1VYMpuH72RQHaiskzOiKjidRqIAw24w33AchFrLH6WEtovnnsOtgOLI/eCEANCY2SCxs IJmzYHio2QvODSHB2Cm3Y243DFlEjaJxxthh5VyNgLJvvOf2Egzt/a926EmIgajQ+jecoC/sA NauZWcohgV0JZptx6boKJnRMBGKIOocPewPdKg2Nliuv2y3Pli6EP4ffSiW/6oPbOW4s= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org gcc points out code that is not indented the way it is interpreted: net/caif/cfpkt_skbuff.c: In function 'cfpkt_setlen': net/caif/cfpkt_skbuff.c:289:4: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation] return cfpkt_getlen(pkt); ^~~~~~ net/caif/cfpkt_skbuff.c:286:3: note: ...this 'else' clause, but it is not else ^~~~ It is clear from the context that not returning here would be a bug, as we'd end up passing a negative length into a function that takes a u16 length, so it is not missing curly braces here, and I'm assuming that the indentation is the only part that's wrong about it. Signed-off-by: Arnd Bergmann --- net/caif/cfpkt_skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/net/caif/cfpkt_skbuff.c b/net/caif/cfpkt_skbuff.c index f6c3b2137eea..59ce1fcc220c 100644 --- a/net/caif/cfpkt_skbuff.c +++ b/net/caif/cfpkt_skbuff.c @@ -286,7 +286,7 @@ int cfpkt_setlen(struct cfpkt *pkt, u16 len) else skb_trim(skb, len); - return cfpkt_getlen(pkt); + return cfpkt_getlen(pkt); } /* Need to expand SKB */