Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2130660rwi; Thu, 20 Oct 2022 23:29:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Z+75+NAcZ3Wp47mYk8aXhUvx6U1RomSoQZJlRXfsfTa679Uony4sCtzB2bRwIP+naF1WB X-Received: by 2002:a17:907:d90:b0:78d:48b1:496d with SMTP id go16-20020a1709070d9000b0078d48b1496dmr14561641ejc.665.1666333777242; Thu, 20 Oct 2022 23:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666333777; cv=none; d=google.com; s=arc-20160816; b=ZPlJ++dYYpL+IbDnPZfhkSTAYfk+0LNAiLIugb7g04/Ci/lrhjoXFFiC0pjbT1zEvm PUhXJLKwjvrYndenrGSvlS7XktqRGaxRHjrrtEMNoreaEWzdH+0prgpPJEf7Qk0h2Dyb 0G6uguMj5H0fhBJqN/cOlHGO18WoFrBCXhhhM1IUq1PP0ZI4lvEXqwffnsphlxfy6i/h CVrIWyOhetReIGoWIcqmKRlyuvrPsSz2+AuTFmceatPwLn66+NQlrC8p/rAWoIoussO/ 35+CnRt06Uz7lCN7svx29OGFsr0pFExY21C2m3hth1+5eV6Cb8AK3zo/7pClfjeGC4Pk 1PaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YEiLrINto3OfhATRDo7il8OOpbEVODXHzBub1SpWzxo=; b=gt8XN6CSA8v8h6voUPEfTh41o2ijpDHhf2JHV3iDQqwbg08vP8oighLWDxLo6xMMKP P/XNxAucWFqMQNPv1wcDeEfwVb72YH9irZVxotQx2V4aTUgP8fR1xW1S0Qb48uKWieYV 5kMKKIu0mokXpdr6Wp6C9QX834VJVfLWwFbSUB+nyCm4tTcl4WOsEVlIlv2MBLcSe2KH uZVrzsCvsU6Z18LHgRTJekLbmRmxFO0YQC60vD9BbLMzE5SpSH2dlFLE2n4x/Nng6TnH 5lqQzUvFv6k5wImk7gNQcNbY/bhMVfMOIy8TM2cKNcFH6rzkipuIocvAYZElIi+iFLCE DYhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dU82oX6E; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q2-20020a170906678200b00780488c11bbsi16093124ejp.388.2022.10.20.23.29.11; Thu, 20 Oct 2022 23:29:37 -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=dU82oX6E; 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 S229679AbiJUF7u (ORCPT + 99 others); Fri, 21 Oct 2022 01:59:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbiJUF7s (ORCPT ); Fri, 21 Oct 2022 01:59:48 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855EB4E40F; Thu, 20 Oct 2022 22:59:43 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id w18so4554824ejq.11; Thu, 20 Oct 2022 22:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=YEiLrINto3OfhATRDo7il8OOpbEVODXHzBub1SpWzxo=; b=dU82oX6EYusd5s+JqKnuaoZGuHlZ8VZ7kNohRINYDKTsWw3YUFTKBOFn2Vp/t+57L8 zcN1xjdnldwKfhfkmbhyYf3df/fT6TtzZv6nbws89fcoBJt7AzYD8yB7G9rkdBVtagZN IjaUQ1PIgxiyeBK2xO2+wxR7aX0+M4lCQ9R2wQEJ8vjKj8fuxYWs7FqdxybKHpE7TOJZ eq9xLxKjv4dwiEC9b9vrkJobNZVfXDNCgoWKvfJdt9Hb988Q8IuaUwcHMs8odK3ZtySZ QRzzjyHUkosgZnnnUytA2IzT+lbacPpELiCJwcDAyUpY7IjPaZD2cY7WeEYe3QqBSP/s rsnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=YEiLrINto3OfhATRDo7il8OOpbEVODXHzBub1SpWzxo=; b=3Lwk7HGafpGM+7rfVpiYrDYWe+a/sXpSYHzlz2wMmMeduGp9Qsu5fXnegoVBRPvjD7 NCDdWEwTG9MAqOUUvfZxNVcnxgUoRYPioJ0NNbfMnDJv1jyrQkuFSlR3xQFwJQKQ3mra EpJ/s6XFAAS8lTFJk0/1OWrAE4AA8C5spZqeE87VabdRhxgjagE+I+uNYS/xLbu99hRm lX5isPcyvCZubx5B10G1Pg6ohUQtFsmCPH7NuCot8FTwcjeZjqV9JLzcMcwSVz7M3D8P XRl1hrEwpPKE+WKNIm1ndWUjzcrkz6qxbCt/Gzb2IRuqjOuKgWgRVGysTyTx1ucAFUvN fl6A== X-Gm-Message-State: ACrzQf3mBQf0X+gzXQuunVooj8LPB7B66Ic6YVPpc+eZuafkW5Ex7DKX HDQXE70j6n0p76K7BJCL5g== X-Received: by 2002:a17:907:16a7:b0:78d:f586:e446 with SMTP id hc39-20020a17090716a700b0078df586e446mr14040167ejc.252.1666331981460; Thu, 20 Oct 2022 22:59:41 -0700 (PDT) Received: from localhost.localdomain ([46.53.249.171]) by smtp.gmail.com with ESMTPSA id c22-20020a170906155600b007081282cbd8sm11140994ejd.76.2022.10.20.22.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 22:59:41 -0700 (PDT) Date: Fri, 21 Oct 2022 08:59:39 +0300 From: Alexey Dobriyan To: Linus Torvalds Cc: "Jason A. Donenfeld" , akpm@linux-foundation.org, linux-kernel@vger.kernel.org, mm-commits@vger.kernel.org, masahiroy@kernel.org, keescook@chromium.org, gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com Subject: Re: [PATCH -mm] -funsigned-char, x86: make struct p4_event_bind::cntr signed array Message-ID: References: <20221020000356.177CDC433C1@smtp.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 On Thu, Oct 20, 2022 at 10:14:54AM -0700, Linus Torvalds wrote: > On Thu, Oct 20, 2022 at 9:28 AM Jason A. Donenfeld wrote: > > > > Nice catch. > > > > Reviewed-by: Jason A. Donenfeld > > Can we please try to collect these all in one place? > > I see that Andrew picked up the original one for -mm, but I think it > would be better if we had one specific place for all of this (one > branch) to collect it all. > > I'm actually trying to do a "make allyesconfig" build on x86-64 with > both signed and unsigned char, and trying to see if I can script > something sane to show differences. It is very entertaining, i've given up and started patching sparse but it needs more because char constants are ints: diff --git a/evaluate.c b/evaluate.c index 61f59ee3..ab607581 100644 --- a/evaluate.c +++ b/evaluate.c @@ -321,6 +321,10 @@ static struct expression * cast_to(struct expression *old, struct symbol *type) if (old->ctype != &null_ctype && is_same_type(old, type)) return old; + if (is_char_type(old->ctype)) { + sparse_error(old->pos, "XXX char"); + } + expr = alloc_expression(old->pos, EXPR_IMPLIED_CAST); expr->ctype = type; expr->cast_type = type; diff --git a/symbol.h b/symbol.h index 5270fcd7..8e62aca2 100644 --- a/symbol.h +++ b/symbol.h @@ -455,6 +455,14 @@ static inline int is_byte_type(struct symbol *type) return type->bit_size == bits_in_char && type->type != SYM_BITFIELD; } +static inline int is_char_type(const struct symbol *type) +{ + if (type->type == SYM_NODE) { + type = type->ctype.base_type; + } + return type == &char_ctype; +} + static inline int is_wchar_type(struct symbol *type) { if (type->type == SYM_NODE)