From patchwork Sun Dec 27 16:58:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Safonov X-Patchwork-Id: 7923911 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DF5119F318 for ; Sun, 27 Dec 2015 16:57:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 09FAD20270 for ; Sun, 27 Dec 2015 16:57:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3CF820274 for ; Sun, 27 Dec 2015 16:57:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752281AbbL0Q47 (ORCPT ); Sun, 27 Dec 2015 11:56:59 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:35029 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751765AbbL0Q45 (ORCPT ); Sun, 27 Dec 2015 11:56:57 -0500 Received: by mail-lb0-f174.google.com with SMTP id bc4so83185376lbc.2; Sun, 27 Dec 2015 08:56:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=LgWLMZuq4t9bqaxpnleGQ3dmRkk70qmg7AAm021x8eM=; b=LpPxFHmF0dBL5qkNbBbu05gx9ORYusufofzg8kLe3CfYPAjSNYSgopntdmMkd1X/zc jAPcgD03GqYfNJiBaDa19Cs9x4edOs9sv7i4R9K5oPp/7bGy0Oi0L7Fj5oef79Td62tq uJvisyQQqALQ3LfKPTJBB1ywbgCaICC5OHgKEbX0tjZi3yoU6w+t8Bf8tYiTu/YV1AT0 TkYcX5kCq2AHHoiJkIH0eLVdw3trAUpE8kjPGf7GuyveCqzeCGjT7h2o9ZpRTANNyHE1 eHRfW1MdI6ooxgHg1Bp5BQECgjXHaOMPLkh7b92J6GwK6YNtl9DTRVZ/mkP3Vk2O/Fol VUOw== X-Received: by 10.112.180.35 with SMTP id dl3mr17512864lbc.27.1451235415750; Sun, 27 Dec 2015 08:56:55 -0800 (PST) Received: from alpha ([193.218.138.55]) by smtp.gmail.com with ESMTPSA id m21sm3097805lfe.29.2015.12.27.08.56.53 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 27 Dec 2015 08:56:55 -0800 (PST) Received: (nullmailer pid 22271 invoked by uid 1000); Sun, 27 Dec 2015 16:58:53 -0000 Date: Sun, 27 Dec 2015 23:58:53 +0700 From: Ivan Safonov To: Johnny Kim Cc: Austin Shin , Chris Park , Tony Cho , Glen Lee , Leo Kim , Greg Kroah-Hartman , linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] staging: wilc1000: min_t macro instead of ternary condition operator used Message-ID: <20151227165853.GA22264@alpha.sfu-kras.ru> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP min_t macro bit shorter then ?: operator. Signed-off-by: Ivan Safonov --- drivers/staging/wilc1000/host_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 8c77520..5a770bb 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -4570,7 +4570,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo) pNewJoinBssParam->rsn_grp_policy = pu8IEs[rsnIndex]; rsnIndex++; jumpOffset = pu8IEs[rsnIndex] * 4; - pcipherCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex]; + pcipherCount = min_t(u8, pu8IEs[rsnIndex], 3); rsnIndex += 2; for (i = pcipherTotalCount, j = 0; i < pcipherCount + pcipherTotalCount && i < 3; i++, j++) @@ -4581,7 +4581,7 @@ static void *host_int_ParseJoinBssParam(tstrNetworkInfo *ptstrNetworkInfo) jumpOffset = pu8IEs[rsnIndex] * 4; - authCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex]; + authCount = min_t(u8, pu8IEs[rsnIndex], 3); rsnIndex += 2; for (i = authTotalCount, j = 0; i < authTotalCount + authCount; i++, j++)