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 882F9C32774 for ; Wed, 24 Aug 2022 03:20:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233130AbiHXDUQ (ORCPT ); Tue, 23 Aug 2022 23:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231311AbiHXDUL (ORCPT ); Tue, 23 Aug 2022 23:20:11 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D9225006B for ; Tue, 23 Aug 2022 20:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=DXkUL0lTzcYhM1i/H/AeEilwAfKbgCrix6DGQiR8Bxo=; b=rjYP9EQGlOZZRNzLa52ScLzVHU 7IBJLINQwn5JiKKIXHKtetyjBem940cu29ZjwnYxy6hlGqosMVSRpXS9jjEKNMbZtzTlwsJE0ZZM8 I6qUnAA1jw2m+auAjUPGJvaJFPp0CWXzI68LnqglFYGTCVePXqydvrTnJ1SfY1JRR29g/D1oT+8eV mnAJndSS+wHc71lUYIjGejh0lxlns7nv8pgXICWUsH1B3FYdjjbmFMgERvzpA3MUy6/htAlnI8hF9 BhC6tWgZFFLwF8TlJ2e5c22cRZddIqVsqeNQn1AhWEhw9YyPF3NAdTGJ3PfXficiRRe1WiVVw4xXX FdtqglyA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oQgw0-007d7D-KS; Wed, 24 Aug 2022 03:20:04 +0000 Date: Wed, 24 Aug 2022 04:20:04 +0100 From: Al Viro To: Linus Torvalds Cc: Bart Van Assche , Rasmus Villemoes , Steven Rostedt , linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Christoph Hellwig , Luc Van Oostenryck , Jens Axboe Subject: Re: [for-linus][PATCH 01/10] tracing: Suppress sparse warnings triggered by is_signed_type() Message-ID: References: <20220821000844.510643400@goodmis.org> <5700ac75-f6a9-877e-4011-9b314f12b5ab@acm.org> <02daa3d6-2847-d7e0-e23e-411076c6d4db@rasmusvillemoes.dk> <0163b361-14bf-7b4c-751a-14f1a004b1a9@acm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 24, 2022 at 04:10:25AM +0100, Al Viro wrote: > *IF* you want to go that way, I would suggest a new return value for > restricted_binop() ("comparison with magical value"), with > something like > switch (restricted_binop(op, ctype)) { > case 1: > .... > > default: > break; > case 4: > // comparison with magic value: > // quietly go for underlying type, if not fouled > // if fouled, just return NULL and let the caller > // deal with that - loudly. > if (!(lclass & rclass & TYPE_FOULED)) if (!((lclass | rclass) & TYPE_FOULED)) that is - we don't need both of them being fouled to trigger a warning; either one should suffice.