Received: by 10.213.65.68 with SMTP id h4csp112904imn; Mon, 12 Mar 2018 08:20:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELuP/fnPXzPdD0aUpRzi30cSumXkZUgwTigxeo+aV3bRf+EA11YNDByluVWM/idbCohapXOP X-Received: by 10.101.99.66 with SMTP id p2mr6737184pgv.384.1520868042778; Mon, 12 Mar 2018 08:20:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520868042; cv=none; d=google.com; s=arc-20160816; b=JUIsYTTASqrr+pRqbwkPDaTc5Qi0iFFqa7o3FZ9II9BoxlQfIM4KiTo870S+5DIra0 r0GoQ/+80UXXg56RJD+pH2h8J3UeHVk6mhWgoGClvcRfhUX2bgK3FgRGFOr38VeDpnvR ZY8M3xXi/gvMlCa9kyEi0ArQtINOv/unZ3tygzLe1Wl1Kx508WG1sCQIujcjjL9PJfsR KRd+O2nCScjCNkIebeu82Z8YRvlFnBlQZdW9gKPbF+IR2BeLTTj9XsXu+ZfVXk5g5EFm hjyiIEpQLSX9tclW5uMd5wpxObIAuoCPCLZy1eQFVF1beLTX0wCdCaLCuRuwS05eUnE0 5deA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=eXPpZzBXHv1b97CRz1n3PMNVYuGC8JlQyhdVfJFud8A=; b=u3f7uDm4OMUn9n9d3cOWSqQcCuJaKV4H4ETmCzt8yCRTm+t30Dk+sd/3p+kF5zE/qp kJsYX2agHcXuLuam+12aUcMsbWsbL9T6I9JJJ6ZeTylvg2FtGW8k5CpnRoxqAHUxvotb jK7Emcq53GIy1ftbR245T2H5c78bqrRSMPPmkrKpzn41rifUhOQRHv+i3wlqKtGCJYz5 e15MOtKzsVvY8NDGu+sWnB6y2hzeKha2vXktyNLByNZ6aSw/2EHfbnJfpHYe1/ToGooe JaQPoNCf6U07Jvs2KhtxTPr/KnCLP4xZEonZbyYT9U2Ns8O7mAeIzw9tKmSRCruiTcDF cgOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=VaLaTWhO; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1-v6si6360584pli.616.2018.03.12.08.20.27; Mon, 12 Mar 2018 08:20:42 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=VaLaTWhO; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932441AbeCLPRz (ORCPT + 99 others); Mon, 12 Mar 2018 11:17:55 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34340 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751502AbeCLPRy (ORCPT ); Mon, 12 Mar 2018 11:17:54 -0400 Received: by mail-pg0-f67.google.com with SMTP id m15so1636711pgc.1 for ; Mon, 12 Mar 2018 08:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eXPpZzBXHv1b97CRz1n3PMNVYuGC8JlQyhdVfJFud8A=; b=VaLaTWhO8jwkVkn2kKoLCMTDoRoSxDJjnUtkLJayU9a0vEB+0X+HBUdsTS9KBR8H4h DYWPQXkYVoh/g3g+EIwOQczd4vOzRraR+sfRa7kHi0lkSHvYoOcsHO0oZavdWayFmhvM vb12o3aK8ni+NbdtXDxYwUpb7Az8/qR/bmbGeBPfQAWUL0dxjM1XqFDrMP2NczSliPvX rgh72Bxhob+ifEcDsKB5f9I/4T0qpBmdopVRNdBs0pnjG6DREmei3rcuJmhnfssRVTWw qo37t/de130Lsg2zccaa63PZjUjhJHrzRlu0Sxq2b2aEN+yeebNSh8RmcCBJl/M1ICND ZewA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eXPpZzBXHv1b97CRz1n3PMNVYuGC8JlQyhdVfJFud8A=; b=suyJq9ZHyNk1cQgbQFqNNnCdljuCD2mWUgo0JUDlPMLrFapD1uBRLk+gAlUCY97tUh 0R6TUlNyY8wORfpRHsw9XPkSMLwT477ZWKk1PIuh5m/aeTHqmsuAzDzU0C6y0RTGq7ze 4h7yDR9N4qQqwqHuAajmnc5XI2jJXyL05hP0iyb38dbUfTD36akBFkyFlppn1G6sbZ+y sLKrMKqabUyLIqCotbrAGt831qh2F0rUoI0P5jzjDs7sqhwtEmO0pR0VIrLr7dX9ikXB 4HEDDwdVqzeHcBpGFDvLpmtKCjZdo/RppZQyi2bP4qcFhDvl/psyRgaoIfE4tttmpj9C ejXA== X-Gm-Message-State: AElRT7FTnmRoVuXsoBZxalYD2rvW4YGxPrXcKTkbZMsGdxKNTuwcHpA7 K4xBtd6QTG2mf63KF4/4MAzfyN8xvOW/LBdCVFYz7Q== X-Received: by 10.99.105.202 with SMTP id e193mr6765929pgc.84.1520867873321; Mon, 12 Mar 2018 08:17:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.141.12 with HTTP; Mon, 12 Mar 2018 08:17:32 -0700 (PDT) In-Reply-To: <201803122219.vHl3IwRo%fengguang.wu@intel.com> References: <201803122219.vHl3IwRo%fengguang.wu@intel.com> From: Dmitry Vyukov Date: Mon, 12 Mar 2018 18:17:32 +0300 Message-ID: Subject: Re: [tip:locking/core 9/11] include/asm-generic/atomic-instrumented.h:288:24: sparse: cast truncates bits from constant value (100 becomes 0) To: kbuild test robot Cc: kbuild-all@01.org, LKML , tipbuild@zytor.com, Ingo Molnar 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, Mar 12, 2018 at 5:52 PM, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core > head: ac605bee0bfab40fd5d11964705e907d2d5a32de > commit: 8bf705d130396e69c04cd8e6e010244ad2ce71f4 [9/11] locking/atomic/x86: Switch atomic.h to use atomic-instrumented.h > reproduce: > # apt-get install sparse > git checkout 8bf705d130396e69c04cd8e6e010244ad2ce71f4 > make ARCH=x86_64 allmodconfig > make C=1 CF=-D__CHECK_ENDIAN__ > > > sparse warnings: (new ones prefixed by >>) > > kernel/locking/qspinlock.c:418:22: sparse: incorrect type in assignment (different modifiers) @@ expected struct mcs_spinlock *prev @@ got struct struct mcs_spinlock *prev @@ > kernel/locking/qspinlock.c:418:22: expected struct mcs_spinlock *prev > kernel/locking/qspinlock.c:418:22: got struct mcs_spinlock [pure] * > kernel/locking/qspinlock_paravirt.h:519:1: sparse: symbol '__pv_queued_spin_unlock_slowpath' was not declared. Should it be static? > kernel/locking/qspinlock.c:418:22: sparse: incorrect type in assignment (different modifiers) @@ expected struct mcs_spinlock *prev @@ got struct struct mcs_spinlock *prev @@ > kernel/locking/qspinlock.c:418:22: expected struct mcs_spinlock *prev > kernel/locking/qspinlock.c:418:22: got struct mcs_spinlock [pure] * >>> include/asm-generic/atomic-instrumented.h:288:24: sparse: cast truncates bits from constant value (100 becomes 0) > > vim +288 include/asm-generic/atomic-instrumented.h > > b06ed71a6 Dmitry Vyukov 2018-01-29 282 > b06ed71a6 Dmitry Vyukov 2018-01-29 283 static __always_inline unsigned long > b06ed71a6 Dmitry Vyukov 2018-01-29 284 cmpxchg_size(volatile void *ptr, unsigned long old, unsigned long new, int size) > b06ed71a6 Dmitry Vyukov 2018-01-29 285 { > b06ed71a6 Dmitry Vyukov 2018-01-29 286 switch (size) { > b06ed71a6 Dmitry Vyukov 2018-01-29 287 case 1: > b06ed71a6 Dmitry Vyukov 2018-01-29 @288 return arch_cmpxchg((u8 *)ptr, (u8)old, (u8)new); > b06ed71a6 Dmitry Vyukov 2018-01-29 289 case 2: > b06ed71a6 Dmitry Vyukov 2018-01-29 290 return arch_cmpxchg((u16 *)ptr, (u16)old, (u16)new); > b06ed71a6 Dmitry Vyukov 2018-01-29 291 case 4: > b06ed71a6 Dmitry Vyukov 2018-01-29 292 return arch_cmpxchg((u32 *)ptr, (u32)old, (u32)new); > b06ed71a6 Dmitry Vyukov 2018-01-29 293 case 8: > b06ed71a6 Dmitry Vyukov 2018-01-29 294 BUILD_BUG_ON(sizeof(unsigned long) != 8); > b06ed71a6 Dmitry Vyukov 2018-01-29 295 return arch_cmpxchg((u64 *)ptr, (u64)old, (u64)new); > b06ed71a6 Dmitry Vyukov 2018-01-29 296 } > b06ed71a6 Dmitry Vyukov 2018-01-29 297 BUILD_BUG(); > b06ed71a6 Dmitry Vyukov 2018-01-29 298 return 0; > b06ed71a6 Dmitry Vyukov 2018-01-29 299 } > b06ed71a6 Dmitry Vyukov 2018-01-29 300 > > :::::: The code at line 288 was first introduced by commit > :::::: b06ed71a624ba088a3e3e3ac7d4185f48c7c1660 locking/atomic, asm-generic: Add asm-generic/atomic-instrumented.h > > :::::: TO: Dmitry Vyukov > :::::: CC: Ingo Molnar I will take a look tomorrow.