From patchwork Sun Oct 30 08:10:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Straube X-Patchwork-Id: 12966 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1694288wru; Sun, 30 Oct 2022 01:15:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4JzIUNeRhhcvDOrw87a9cgqEY7iLF3anI1lXeLWKLj0K6AxwhcOVhtjX8DgkZCcMCiF1bg X-Received: by 2002:a17:902:db09:b0:185:5440:1ea0 with SMTP id m9-20020a170902db0900b0018554401ea0mr8473258plx.113.1667117740318; Sun, 30 Oct 2022 01:15:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667117740; cv=none; d=google.com; s=arc-20160816; b=0lf1UNnsSckcnGWdE6k2CCLXPP/OUFgRFsQdv6tiyY5PjDh1xDUAiXhcdRWBmnLZzo OtM+pg0K0Y/edgizWxO/FhTdMCTbR4e3Ifz+vjO+ycl3DXzBVlkxamqI31rAcerDG8Ha pV4X1uB2iecQUEj7HqQ3rP+iRfjhZFOtW92dv6v46v7STHNirRW6eGUzWiCCp0QQt1+k qcBNaLPjBhW3omyQKkzql3ewiBkfPsq7v4LkRTRPH6wGNpOhtZcnqgcjaDDFla7sBdlM DJ4mWcXGucSAD0gc3RkqPd5W2QIxexyaeQe5r/s34fo1xl1nDa3tihDKli5jgsVTbIhF n4vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=PQ7i0JvA6S2JuLGZoRuDp03Ajf9dqeVkCmxRUIqVwsg=; b=DD57y7zNcXpwy/mwxmi3NUmJUvCtv2EC7xYyKjo/CvzTEx5nmz4ekrRMgAUfr3MDc3 ZHerBpxFrWNkVgmFYQu7/Ko7wF9fCyNHDs3Zy/7hKo/EGy/OAHmX3E2Col2G3/S0VIiW 4EciGNrlt75RBRdBXJOTV6Lno0dKbtFEmmO4NxQ+X8mR1FN7nX1Qzl1Yo5DGqHWTrgh4 sa6odc/mlI3hDwLwdtcWMFJ6P2Ktdvzff8JPA9ZXYR9xLy1Oza+xDXLW2g1tdLdZX4k2 7p2Pn6O8Lu3vTvryojKJBdQyGdMxgSzeZSd/EdvizLKmgOtiZ8yoIRFTlNzErvU2FvbH 5ERg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UyCPntXN; 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 p13-20020a170902e74d00b00176a116a20csi5058374plf.567.2022.10.30.01.15.28; Sun, 30 Oct 2022 01:15:40 -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=UyCPntXN; 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 S229738AbiJ3IKg (ORCPT + 99 others); Sun, 30 Oct 2022 04:10:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229636AbiJ3IKe (ORCPT ); Sun, 30 Oct 2022 04:10:34 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5478B879 for ; Sun, 30 Oct 2022 01:10:33 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id u24so4282432edd.13 for ; Sun, 30 Oct 2022 01:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PQ7i0JvA6S2JuLGZoRuDp03Ajf9dqeVkCmxRUIqVwsg=; b=UyCPntXNQ0ukh7YFw3calkwPkRS6ybko2jmJT21uHy39lfS76EE/6yKfl66uzOddhh TBu4dJscMNXjtTkG8SI6S5jMUV9z1672YCsOhjpCwnu37hvrE7aNh0Dv1yaxc2mhfaay XgcWt3MY3JCZTSVsoEPUMZrCsgiA25+8m6wAEQYd6bDimx+pHhOEsaIj6H/IkXX9DzaY +qnfqddVI4nABEHIvQdyZ9TPDGqNA/z73MrdVFyifBTSfQ1kUuC05IITq82iLnOptscN ptgpv09V8SZ8afUijdzJWSJUZ4vyOnrGCdWIZlaTxIKQXSocvztozYl67bMgrfLqluj6 G0cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PQ7i0JvA6S2JuLGZoRuDp03Ajf9dqeVkCmxRUIqVwsg=; b=Ie7PCIXde85tRW0QRfmb1H/0RqgZQqqIg/JR+PwS/jAD8YNRQORoNw9iX7QH6nauDL vCnEW7o7etAWw8BaD27Rp0pkKiLMidRFb3mdXMYYDsiLLLLv/ub9frMn5AxEc0POAJgP SlUC91Q47At1eE95UPal2sGY9XwmvLWUDcsB8XFOMEeL51hbXBH32cR3K0wLyt97LyMl ZW8sw28ZQCzkbgHLM6IWOcCTVuGbTgrmD4c6n+OxcHpqOWx5xlmIWo04sXoibvG6igCd qCCMCIS9u+C/sAytDiPfYOE1Rbs13E2NOe6YEtKKQiFpLmp8dZkz9aSwWK6xAcgOb5xC KZpg== X-Gm-Message-State: ACrzQf0x4FKGQfLuKj0tL5uoBUsVpSWzJ9FYXDRYSjq/5ns0hV/MotD+ ziG4RBPwoHkeefUYTfBVr1CuTINtwA8= X-Received: by 2002:a05:6402:33c5:b0:447:e4a3:c930 with SMTP id a5-20020a05640233c500b00447e4a3c930mr7690017edc.401.1667117432262; Sun, 30 Oct 2022 01:10:32 -0700 (PDT) Received: from localhost.localdomain (ip5f5abb7e.dynamic.kabel-deutschland.de. [95.90.187.126]) by smtp.gmail.com with ESMTPSA id la10-20020a170907780a00b0079dbf06d558sm1567299ejc.184.2022.10.30.01.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 01:10:31 -0700 (PDT) From: Michael Straube To: gregkh@linuxfoundation.org Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Straube Subject: [PATCH] staging: r8188eu: use min() instead of ternary operator Date: Sun, 30 Oct 2022 09:10:20 +0100 Message-Id: <20221030081020.8533-1-straube.linux@gmail.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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?1748099651526454958?= X-GMAIL-MSGID: =?utf-8?q?1748099651526454958?= Replace a ternary operator usage with the min() macro to improve readability. Signed-off-by: Michael Straube Tested-by: Philipp Hortmann # Edimax N150 --- drivers/staging/r8188eu/os_dep/ioctl_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/os_dep/ioctl_linux.c b/drivers/staging/r8188eu/os_dep/ioctl_linux.c index 8516e253bb03..22aab3f986b4 100644 --- a/drivers/staging/r8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/r8188eu/os_dep/ioctl_linux.c @@ -3568,7 +3568,7 @@ static int rtw_wx_set_priv(struct net_device *dev, if ((_VENDOR_SPECIFIC_IE_ == probereq_wpsie[0]) && (!memcmp(&probereq_wpsie[2], wps_oui, 4))) { - cp_sz = probereq_wpsie_len > MAX_WPS_IE_LEN ? MAX_WPS_IE_LEN : probereq_wpsie_len; + cp_sz = min(probereq_wpsie_len, MAX_WPS_IE_LEN); pmlmepriv->wps_probe_req_ie_len = 0; kfree(pmlmepriv->wps_probe_req_ie);