Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3305109yba; Tue, 23 Apr 2019 01:09:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZ/Yfb6ftLyUeczVv/bTRbwF1NGFcQIv20d79Ow9ANAOpvb4dUaoGzgh8+ILM6dp20qlfp X-Received: by 2002:a17:902:20c9:: with SMTP id v9mr24725302plg.239.1556006956553; Tue, 23 Apr 2019 01:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556006956; cv=none; d=google.com; s=arc-20160816; b=UfnFyZZ5LXKx6fCYnCKF8wI+3A+hhQbmo0Q7aoZN7vqLdikU9nzaTl483mbY8s20Ws JFH0oa1XHSF05jxWwFAb4iaIUGv3/UkzkcscrEVkowb0O8yLLbs5SFUldy+08SRgV4lH 1lhpwmBY7yh5uVpvwVBW8EcN1+Fi6ORPxSi/esDQrDFpwDGbpwUsKXEiTh+2q3SqAkMS /OmzwGkaEHVMMqdCSdnrgrE2tM4SeL6ftqpkQnKiLU2kuZ4aF9soVuMvWh/8Z3pwMnyG UGfAhLddsbzxHx815HCnJYg2pNTKD5U8gvyf1g7Lo4rudq7ZD/KaQw40XNjMnRbi0SP3 Sw/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=tjdPQCnqQqU763ZbK7OggS7CEeR2gDfKdbMjF9AbiaE=; b=Bx1GuoipSIzjEmhfQxQENc7xgZvG9J5ayrS8GlgljXjO18atnkIJb1tFeTclxJViY4 d8T3u42v0/POkq4BnajkbiLCxpzpifevMGYE30XHJ14RyLfs7kUIceXVEltLxK6JHj4w pFK+vTZzNKQkZ3ZaGLaVgPfyKu3ZKCXYKQ5E7vHQLtWSNriMznMYhDJOy6XnwWZzXIwZ Gg7bZ056CpKuv2tAcVSgrMxdf7HX4frgTDqsKGuL3oDv4D9+1qwE9sEPUBtU6T0yUMoD aTI9lmFbvOK1PgSMoNXWP9XfIU3V5joqGMrD51DScInaeFABdGLhuP2wBhhvgSsl7Nf3 RMLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n7si15561553pff.190.2019.04.23.01.09.00; Tue, 23 Apr 2019 01:09:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbfDWIGM (ORCPT + 99 others); Tue, 23 Apr 2019 04:06:12 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:43970 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725888AbfDWIGL (ORCPT ); Tue, 23 Apr 2019 04:06:11 -0400 Received: by mail-lf1-f65.google.com with SMTP id i68so10990033lfi.10; Tue, 23 Apr 2019 01:06:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tjdPQCnqQqU763ZbK7OggS7CEeR2gDfKdbMjF9AbiaE=; b=SfXTk2fCnNq25gug/g/ylL8dqnsbUH0/zB8wxJK47z2KxEkuK+XqlHvQfoypKyaZC/ D4MxqDvzdmmLjvhXEA+yHzm4oAQLy/lUEvsP/9EOcRwpafgUk9Gf1CxnXWdcZ//81OWR PLffAWYjPGMluXKlSUIpEx021SEZc9NJa1U1AOwD3k6RK2Z644aZlfukken/Kw/UkK2S xCiIBGAajo48Vt7tAa/Obhcd/upRdcmqzb1uvKO4X8Gy6xo8DAic2tsv4yiQ2ki7cchJ T2dB2d52wVX9aQAm37vR9Hk2hfQ6dzlJ6v2zAMYgAfUfaBm++qrnNs/rZja00MbD+wuz txng== X-Gm-Message-State: APjAAAUfkwPM2WHkjUELfFjE+C80L5CwRFw4TamuoLfAf2vwCEDhT+q1 MRGMavhPc9stZu53hxqzSvtCtN6D5+OYZOkJNTM= X-Received: by 2002:a19:761a:: with SMTP id c26mr12859356lff.8.1556006769219; Tue, 23 Apr 2019 01:06:09 -0700 (PDT) MIME-Version: 1.0 References: <20190415083605.2560074-1-arnd@arndb.de> <20190415083605.2560074-4-arnd@arndb.de> In-Reply-To: From: Arnd Bergmann Date: Tue, 23 Apr 2019 10:05:50 +0200 Message-ID: Subject: Re: [PATCH v2 4/4] s390: fix clang -Wpointer-sign warnigns in boot code To: Nick Desaulniers Cc: Martin Schwidefsky , Heiko Carstens , clang-built-linux@googlegroups.com, Nathan Chancellor , linux-s390 , Vasily Gorbik , Christian Borntraeger , Janosch Frank , Collin Walling , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 22, 2019 at 7:52 PM 'Nick Desaulniers' via Clang Built Linux wrote: > > @@ -20,7 +20,7 @@ extern __u8 _ebc_tolower[256]; /* EBCDIC -> lowercase */ > > extern __u8 _ebc_toupper[256]; /* EBCDIC -> uppercase */ > > > > static inline void > > -codepage_convert(const __u8 *codepage, volatile __u8 * addr, unsigned long nr) > > +codepage_convert(const __u8 *codepage, volatile char* addr, unsigned long nr) > > { > > if (nr-- <= 0) > > return; > > There are many call sites of ASCEBC which is defined in terms of this > function. Do they all use `char*`? grep shows an explicit cast to > `unsigned char*` in drivers/s390/char/tape_std.c for example. Generally speaking, the kernel is full of Wpointer-sign warnings, that's why this warning is disabled in the top-level Makefile by default. My patch fixes the ones in the s390 boot code that is not built with those default flags, but I made no attempt to fix the rest of the kernel. Fun fact: on most architectures, 'char' is signed, but on s390 and 32-bit arm it is unsigned. The compiler treats 'char', 'unsigned char' and 'signed char' as three distinct types here for that reason. > > diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h > > index cc0947e08b6f..f3a637afd485 100644 > > --- a/arch/s390/include/asm/lowcore.h > > +++ b/arch/s390/include/asm/lowcore.h > > @@ -128,7 +128,7 @@ struct lowcore { > > /* SMP info area */ > > __u32 cpu_nr; /* 0x0398 */ > > __u32 softirq_pending; /* 0x039c */ > > - __u32 preempt_count; /* 0x03a0 */ > > + __s32 preempt_count; /* 0x03a0 */ > > This change is less obvious. Do you still have the warning for that > this hunk fixes? I can't find it now, but there are multiple users that would cause this, like: static inline void preempt_count_set(int pc) { int old, new; do { old = READ_ONCE(S390_lowcore.preempt_count); new = (old & PREEMPT_NEED_RESCHED) | (pc & ~PREEMPT_NEED_RESCHED); } while (__atomic_cmpxchg(&S390_lowcore.preempt_count, old, new) != old); } Arnd