From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 832FEC43217 for ; Tue, 18 Oct 2022 21:07:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230243AbiJRVHk (ORCPT ); Tue, 18 Oct 2022 17:07:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbiJRVHi (ORCPT ); Tue, 18 Oct 2022 17:07:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06B259A2BB; Tue, 18 Oct 2022 14:07:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B414AB81F7E; Tue, 18 Oct 2022 21:07:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21656C433C1; Tue, 18 Oct 2022 21:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1666127255; bh=CorCX6DieBaXhdOzHd++PB5+KL7ocIsH9Ly8VhaxxSo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vZtdYqeIzAWR2B3VzuHo2suJBQU3yEdzhupDah4HWp3WYMMo+EYJg4siZlVVyNe8w hjNeHHnyQJNsA4otYsaOCob9EvtXCjnvAVHdASXDtc/oSZmhjW9EWIKbWhAVZI/2D9 fTVMoEkZgFmGoGkUCIuSPkJRr4EHroYpSEdOS8oU= Date: Tue, 18 Oct 2022 14:07:34 -0700 From: Andrew Morton To: "Jason A. Donenfeld" Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko , Stanislaw Gruszka , Helmut Schaa , Kalle Valo Subject: Re: [PATCH] wifi: rt2x00: use explicitly signed type for clamping Message-Id: <20221018140734.b4e012a5c3133c025c1e1e92@linux-foundation.org> In-Reply-To: <20221018202734.140489-1-Jason@zx2c4.com> References: <202210190108.ESC3pc3D-lkp@intel.com> <20221018202734.140489-1-Jason@zx2c4.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 18 Oct 2022 14:27:34 -0600 "Jason A. Donenfeld" wrote: > On some platforms, `char` is unsigned, which makes casting -7 to char > overflow, which in turn makes the clamping operation bogus. Instead, > deal with an explicit `s8` type, so that the comparison is always > signed, and return an s8 result from the function as well. Note that > this function's result is assigned to a `short`, which is always signed. Thanks. I'll grab this for now to make -next happier. Stephen will tell us when the patch (or one like it) appears via the wireless tree.