From patchwork Thu Oct 27 01:26:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emily Peri X-Patchwork-Id: 11515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp581422wru; Wed, 26 Oct 2022 18:37:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6MqA+BjG+mOJKXn+/Uwg/pQJoBTieU9eo85T6ZxUMcNZJzG/7jVfHb5OaVFlg7Csh4BRxc X-Received: by 2002:a17:90b:380b:b0:20d:7364:796f with SMTP id mq11-20020a17090b380b00b0020d7364796fmr7116513pjb.13.1666834640232; Wed, 26 Oct 2022 18:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666834640; cv=none; d=google.com; s=arc-20160816; b=LPI7GN8WCg6qFZQKwgtXdazcEXBgE+XxI9x1baYmrZKDiy0hqwYn3st+CvT8VNIG0S bGZIfKS3XcLtiUOv7AUv/LOWmllZgfH3vM8R5MquiqSPoXpMH7V+dLfIueeHW7Ymoa8t 7Cmy233jg4ruBO0UgGL1vhvDZF8BzJQqgWNL1KXa3+3SXYIWbWVpT28owSMea72/mLXH UkjPNAYiDvVRkMz/hOc5KaHpQDVdDZh8IrUKriKptBvMhwwpIfFwNIEkjb2K22dKJjYR V9n+krUMjO6EAEZKCvrYn5nT/aw5nN6Lxt98m02lysQWBZVyNTerTfIR+SOAOhfX6k2C jGRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date:dkim-signature; bh=GHA4PABhtEK1rXCzmMniG/pV1qITSZAaITYQ81bgOXc=; b=DZmf6GBC5p64JrOtR7XIfnfCiEdff4d4o7UiXkGa5KaqufuqvDKL7/lumzqRp6N0s4 5Jt9zMc+oWhA1+qedE8LFwzHCSsMdbgUVYK2qInKMja6U26+66W5cNQQfhVFKXNDOQH8 sMy+1N49Tphv9blAYueCMAQFivlJoPq6fNC10ojg2Ygyt21sVA3Int37Afk8GnqyV7CF YIvKS7DVJPb73YX3igUd6LkQpVxLbWVrfJaxZrsImDzQNpaTSvb9eUgFAMvFk9c/dw2+ Vawva7O357OUKbtd2j1MMci/1T2IY+bp1Th4Ezlthzy1H49eE3c7AClJRUGfFZ7Tg+X7 y5Xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oZtRdUiV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a63f644000000b0045fd05b2ce8si8980458pgj.239.2022.10.26.18.37.07; Wed, 26 Oct 2022 18:37:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oZtRdUiV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233487AbiJ0B1B (ORCPT + 99 others); Wed, 26 Oct 2022 21:27:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233244AbiJ0B06 (ORCPT ); Wed, 26 Oct 2022 21:26:58 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 574FA6B64B for ; Wed, 26 Oct 2022 18:26:58 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id t10-20020a17090a4e4a00b0020af4bcae10so20472pjl.3 for ; Wed, 26 Oct 2022 18:26:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=GHA4PABhtEK1rXCzmMniG/pV1qITSZAaITYQ81bgOXc=; b=oZtRdUiV4y1KcexeIjhm5ZaiRVBbr/CjhTTKej0NGu1CTmnwmXu37d0Y24JHY7HEKt 7s6XazoTKjYXoD0jedPfTjRl2jwpQHqzet7yg/RjpRRJyOjObRZXttCs4veLT3lIHD86 C29pmXUHUx7AHZgZH5G/JGnL39YQdSckDLNy5IN/45+EFgSeF/gHH88qdut8K6fQiXC3 VOaMOo5QbFS3Fnd0ntmFp1ZuMUUURgyHRHi4eJ3H+KC+toON1Pity1aBmGFLZBYVfxfX ymSxLypehov09orGq+EaXgAj54GIVn9L35j3wf2mY01wTIHVmKy+upRoqyPhG2h7uSUF FUiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GHA4PABhtEK1rXCzmMniG/pV1qITSZAaITYQ81bgOXc=; b=Mo/0192qbMNiIXIvZ98HLE2ds9Mvm4g/9yxS93Ex7r51ZLiieE/o49j0reRdJ9cBIx O8kUiXVIjUXGYgnsBWChlqvYykUHWbf+qXczYMRx2VItalwjeqHoLS3wkSsXGr18ac7X 8aYtiCAR+Zzk/7dQYiD1kNs27tu0o5Vp60F2Den2WNJjRlZvtQvfwRilHUBkuVl4Wcdb Od2N+xoP2L6ohxj/C912d77nJZx0HQhZYhAgozcIk1e0h1WL1aHwv7eU4QoQxpN4z+xT j4L7YdF69baep2mhlu7NPq7vY72EjBotsfp9kijWWTAOOi58CH72MrpeL+fH7Am5W16g 2fyA== X-Gm-Message-State: ACrzQf2ogqmkbu4GIrqU9qtPrzYsF6c7isBGxmQKJDgQ0vn2Hwx2sTQf 0kAMrpg5oXqlbtTiMQCk2pxbIg5So90XyA== X-Received: by 2002:a17:90a:b10b:b0:212:fbc3:e623 with SMTP id z11-20020a17090ab10b00b00212fbc3e623mr7386982pjq.5.1666834017847; Wed, 26 Oct 2022 18:26:57 -0700 (PDT) Received: from marshmallow (192-184-163-51.fiber.dynamic.sonic.net. [192.184.163.51]) by smtp.gmail.com with ESMTPSA id q6-20020a17090a178600b00210c84b8ae5sm7533pja.35.2022.10.26.18.26.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 18:26:57 -0700 (PDT) Date: Wed, 26 Oct 2022 18:26:54 -0700 From: Emily Peri To: gregkh@linuxfoundation.org, outreachy@lists.linux.dev, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] staging: rtl8723bs: Replace ternary statement with min function Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747802799551870966?= X-GMAIL-MSGID: =?utf-8?q?1747802799551870966?= Ternary statements that pick the min of two values can be replaced by the built-in min() function. This improves readability, since its quicker to understand min(x, y) than x < y ? x : y. Issue found by coccicheck. Signed-off-by: Emily Peri --- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 6aeb169c6ebf..0cf7d9f82b83 100644 --- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c @@ -1551,7 +1551,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel wps_ie = rtw_get_wps_ie(buf, ielen, NULL, &wps_ielen); if (wps_ie && wps_ielen > 0) { - padapter->securitypriv.wps_ie_len = wps_ielen < MAX_WPS_IE_LEN ? wps_ielen : MAX_WPS_IE_LEN; + padapter->securitypriv.wps_ie_len = min(wps_ielen, MAX_WPS_IE_LEN); memcpy(padapter->securitypriv.wps_ie, wps_ie, padapter->securitypriv.wps_ie_len); set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); } else {