From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC85A352C51 for ; Sat, 31 Jan 2026 14:43:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769870598; cv=none; b=CiibJDrPCom7ozsWZHphXJsQ1bPiFHXBs5rizQfxZMXKyYoMlaPpLv+gD3YRdSWwkpauKcgB1t70w6Chqaylrhr1yWATM+XyYtpNNSimEmZ15eaWK2z5EVitOC6CcGtSntwAGxptj/Q1p/YBg5nlxHhJFRDHhAvW9Bz62waE6E4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769870598; c=relaxed/simple; bh=/Rt+IcFCyzVgoj9SvGQ+m0RBp8PTq7bKfH7SGJXfpNI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OLkOvkz6H0u7ZJ8/kd4Csago6dFe9CmuimX1QMQkqneHwyZj3l7ZL3I0xRQuSs+6eZeYFLdT3mQ6LuW6L12D1OYCq8P5+qco1YclUS25JX7AV+YNo9wiMWDnXQJdPT9Dfj9v/bXwEmG5I3doYyOIwDx8h8YO7QNM6X5EIRSNQNc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SU1bqs9f; arc=none smtp.client-ip=209.85.167.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SU1bqs9f" Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-59b8466b4a8so2325329e87.1 for ; Sat, 31 Jan 2026 06:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769870595; x=1770475395; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dS+0HsF6BDP2SThx6C8mdBdmnYz1fXAGcAYrU9p1+NU=; b=SU1bqs9fqOCR3YQemkARjfPkgR26/HuNRFl6ql/knbwyc/XFUIS97QO22BykI7hmLk gXAvAHwfP9mMhfMqiyRoFn5VvsV5RGFd3foSOGCiB93uGjODcT5cKm//FTlZWNS+Mmgi oizf/RJlkYlZbl4gT6WVk3crVaU2AHRDl7alyi+lhU9yA+bTq/QXgufVsFdSMJf9E7/+ B9aeoBF/osJ+t6PjerQa0CCGFSAHhMyhT5x3kPfKNOApK2ZCAk7NWRdjJtMDjqZAPkp4 M/Tl9rXZkQvJEOcsU5CNweXmUj9etuVxse392PXVmZU2nHmgE8UyNjiZ1DTrKhVhqY4Z Qi1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769870595; x=1770475395; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dS+0HsF6BDP2SThx6C8mdBdmnYz1fXAGcAYrU9p1+NU=; b=CupdSHk3NTf0fU9tLzlWUrmg8f6/qcZpwys+//hOjMg++wCL++1t3n0+FBv+Le/f2B 5vakxpVlZv6+V2pYMzBWGuZsdsfNs2oE2fuIB4IPaG6QjsAn75JfZZl4+eEuE2+k1TNG dVUa/XUEwJHHKda6K+hXvPg5PFFPtJi13IBsLbvQ02l/U/P2iVeENkdnBMORCGtLtSlx I8M00YMOYftrGsRSJaIy0I2br2nQqIwKZ6yoqIjmWkLgIPv6NqU61BR89XxtwtP8Nttk ds+OeoNSUaFCX/ut3z2ASNXVW3NQ477gCjSt70N1F0GGlcEUJa/UiPpiMt/tIphsC14E p6Rg== X-Forwarded-Encrypted: i=1; AJvYcCW8Dvamhv40cBzNoxmQHoRXkIaaK8CtncngJbq+sFjIRtchPl59VdekCiu4zNm0ovmIZOQ6mR2MlFKgnyI=@vger.kernel.org X-Gm-Message-State: AOJu0YweUlvswIyHPdogLaLZdLKcTI4N2JWSDc7CuugvTWsIJXvJMWdA 5hbcmfODFsr1KcFsJkk2VAqfxVQ0egx6JHyCW6ESztAPUmHXPvDWZpQ1q/6itWwJyek= X-Gm-Gg: AZuq6aLsgTG2GEn3WD0RJWSj6JUXUs2AQofFhbkDR7PaMkUVp/SdSJztEbaZs8vSJKi R6XBgxYAd7BrTqfw+kfCuCIv7kA90wacN9mWHK8iHRiwHU7N3va70IpfXEISxLD6KUSdpCq3zdp /UG+mfQRbU5JHUMns6YubLOR124OIFFrZA9dH8QjD5groKDxduuFHE+JNTJ2aVICJ93bj3uvm3A BdogNgtqFmZtCUuSmJeZX0C5+q7wc+FG3L3ZI7rzmlFH8APCDVoDsfAkOH0+Qlasbyd+3XcWd9Z 1GlX87lOr+JMk5Fsb/KQkg/B1Uxk25X03sNDVJsEotncKYO8wIfFK1KWs0W2C/q7VWjirwYpAnx ye/PUJFRm8ShLMwCuYuA9nAfxT+UdMl0uFI1nYqHO19BMXOqRyCeGv0fGm+jHH06O6LWcevui5F dcaqY8mZY9NfOQIkStISaOhV8Cf5M= X-Received: by 2002:a05:6512:114d:b0:59e:479:917c with SMTP id 2adb3069b0e04-59e1644527fmr2358419e87.39.1769870594830; Sat, 31 Jan 2026 06:43:14 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59e074b70bdsm2358246e87.72.2026.01.31.06.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Jan 2026 06:43:14 -0800 (PST) Date: Sat, 31 Jan 2026 17:43:10 +0300 From: Dan Carpenter To: William Hansen-Baird Cc: gregkh@linuxfoundation.org, straube.linux@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: rtl8723bs: replace ternary comparison with min_t() Message-ID: References: <20260131133146.8174-1-william.hansen.baird@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260131133146.8174-1-william.hansen.baird@gmail.com> On Sat, Jan 31, 2026 at 08:31:46AM -0500, William Hansen-Baird wrote: > Replace ternary comparison for setting copy_len with the min_t() function > from linux/minmax.h. > Change is purely cosmetic, however makes the line > easier to read without having to reason about logic. > > --- > v2: > Drop unrelated style changes and fix style issues by running checkpatch. > Keep min_t() to make the signedness of the comparison explicit. > (copy_len is an integer, wpa_ie_len is an integer but sizeof yields > size_t) > This stuff is supposed to got after the --- cut off line. > Signed-off-by: William Hansen-Baird > --- ^^^ > drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > index 8e41eb61448f..d36f6c3bc9b4 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > @@ -4,6 +4,7 @@ > * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. > * > ******************************************************************************/ > +#include > #include > #include > #include These are supposed to go in alphabetical order, kind of. > @@ -1024,7 +1025,7 @@ static unsigned short rtw_parse_assoc_security_ies(struct adapter *padapter, > pstat->flags |= WLAN_STA_WPS; > copy_len = 0; > } else { > - copy_len = ((wpa_ie_len+2) > sizeof(pstat->wpa_ie)) ? (sizeof(pstat->wpa_ie)):(wpa_ie_len+2); > + copy_len = min_t(int, sizeof(pstat->wpa_ie), wpa_ie_len + 2); Use umin(). "int" is wrong because we don't want negative values stored in copy_len. regards, dan carpenter