| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * PS3 gelic network driver. |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2007 Sony Computer Entertainment Inc. |
|---|
| 5 | 6 | * Copyright 2007 Sony Corporation |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License version 2 |
|---|
| 9 | | - * as published by the Free Software Foundation. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, write to the Free Software |
|---|
| 18 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 19 | 7 | */ |
|---|
| 20 | 8 | #undef DEBUG |
|---|
| 21 | 9 | |
|---|
| .. | .. |
|---|
| 889 | 877 | case IW_AUTH_KEY_MGMT: |
|---|
| 890 | 878 | if (param->value & IW_AUTH_KEY_MGMT_PSK) |
|---|
| 891 | 879 | break; |
|---|
| 892 | | - /* intentionally fall through */ |
|---|
| 880 | + fallthrough; |
|---|
| 893 | 881 | default: |
|---|
| 894 | 882 | ret = -EOPNOTSUPP; |
|---|
| 895 | 883 | break; |
|---|
| .. | .. |
|---|
| 1094 | 1082 | struct gelic_wl_info *wl = port_wl(netdev_priv(netdev)); |
|---|
| 1095 | 1083 | struct iw_point *enc = &data->encoding; |
|---|
| 1096 | 1084 | unsigned long irqflag; |
|---|
| 1097 | | - unsigned int key_index, index_specified; |
|---|
| 1085 | + unsigned int key_index; |
|---|
| 1098 | 1086 | int ret = 0; |
|---|
| 1099 | 1087 | |
|---|
| 1100 | 1088 | pr_debug("%s: <-\n", __func__); |
|---|
| .. | .. |
|---|
| 1105 | 1093 | return -EINVAL; |
|---|
| 1106 | 1094 | |
|---|
| 1107 | 1095 | spin_lock_irqsave(&wl->lock, irqflag); |
|---|
| 1108 | | - if (key_index) { |
|---|
| 1109 | | - index_specified = 1; |
|---|
| 1096 | + if (key_index) |
|---|
| 1110 | 1097 | key_index--; |
|---|
| 1111 | | - } else { |
|---|
| 1112 | | - index_specified = 0; |
|---|
| 1098 | + else |
|---|
| 1113 | 1099 | key_index = wl->current_key; |
|---|
| 1114 | | - } |
|---|
| 1115 | 1100 | |
|---|
| 1116 | 1101 | if (wl->group_cipher_method == GELIC_WL_CIPHER_WEP) { |
|---|
| 1117 | 1102 | switch (wl->auth_method) { |
|---|