Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1403521ybm; Thu, 23 May 2019 00:00:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw3+/d5V7NW3mhjr3agAP80x3uReKBbZVUQx+n5+A6yTQi+ZNH7HyO1s1l7SycpsC5rNRig X-Received: by 2002:a62:e10f:: with SMTP id q15mr8414991pfh.56.1558594803344; Thu, 23 May 2019 00:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558594803; cv=none; d=google.com; s=arc-20160816; b=dcWtACh6xF3JKEBFMwz4OMt3gOCU5VDzFMSLAzarZAC7ADMVbnA/lgdBaFHkfwhJqh o4FqzU8u+r73ExreXREXmE1OEY+GZETZbhZvRomOS3zg0fEK/LdqafzX8JfD6IEIqfup Eq506SkwoAcDQvtivwCJhhBlRXno+YHCrKPa8rUmywo8Tc1XoDGHau1jXkXbI6Hgko4n TMmP3Rhsgc/so+wSB1ESAEleew9NH/OM4t0HCSxxm3l99JN4q9GGcu5ts0EcMFK+9fLp KVO0NZOdXyXlp7sd8NhKVh2blRWZ8JN/7L58I+w17JJQlfTfjRHp9N7mPQVsACVb8hdz uihA== 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:dkim-signature; bh=MKO+DbOAmUO3UBihlXAri8/RQt56WDZm5zJVnszm8uU=; b=ASw+mmCQiRf0Z2/DLRrdnG4J3y9UKmsr7LGl1bAF8Bdhqd+/w6/NgF3AYBhkhwmY6m Olj61plxBadDBIBBkfCg+oclxzo2ZTX94rgUYmoXRwmRy4mlWhbxlW2YaH2YVNEdMgFJ MG8vCKTW3GtbjSYGULvpiSQgKV+OZHyivRqHtmLRX2ylbZhEiOtxxw1X83DIUIkUqBk9 EvGKt0g5S1+/O7N4pBOznvooiVcWyAhdaiYDPImmLM9ZTFEW3xjLQ+Yy33Ma7yprmqgi 6wSmZd6fddIdK7bcNBbpd6qo1NYWqO1b6Od+Lny2TIi2tE1PaZzojMdqLjMYvziTX5kp J7OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=RlctLp6c; 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 t25si13662552pgk.442.2019.05.22.23.59.48; Thu, 23 May 2019 00:00:03 -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=RlctLp6c; 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 S1727919AbfEWG60 (ORCPT + 99 others); Thu, 23 May 2019 02:58:26 -0400 Received: from mail-ed1-f65.google.com ([209.85.208.65]:37605 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbfEWG60 (ORCPT ); Thu, 23 May 2019 02:58:26 -0400 Received: by mail-ed1-f65.google.com with SMTP id w37so7679162edw.4 for ; Wed, 22 May 2019 23:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MKO+DbOAmUO3UBihlXAri8/RQt56WDZm5zJVnszm8uU=; b=RlctLp6cuIItdscVbhYypMHPj+Ma4ehi4/3P5Fh1Y+zPTk1rgIfMjbBUvMFI2WIT1c OFAS3xr7hd0hi7kMK4HcQl18M2h8IDOSywX7q3QOLnTFrH4Ik2YLQKcwV1N6QbsCUMsz hcrHwTRaETP0KVZ9DUKJoK3WD3dKNtRTnw727dAp6EXfZ56HM4V+jGSfZ7lbqCX3m/o1 WTAAOXPXHZwrVW5hiQS9WcO8JZuXQoNpigomXx0plq1pJ+EUD7S2OwtWTStKnBF/HuL3 ZqHSI3TFNawJbIQ0SNaHAIxByF4RCrKqFnrvLzTA0uYMuPiuhRw8uKWB59H8OgF5+rYs Re8Q== 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=MKO+DbOAmUO3UBihlXAri8/RQt56WDZm5zJVnszm8uU=; b=O74tUSmwfQkF3avSdMPkBXTFWXcn+KpQgeDSn9BrpZVsEIJRgI6x6HHzgEU6jhs1AE OXIhC44iObB3VqbZITMdTov+p33EK4GW/tdRFKaTbfFHKrevyMtFjdaeuqijp5vTqqlq 6xcwftZrOhoh8te8V3Hl1ER0Mu/BrsGAaVqfvAK0SBGot8eKgD7xWeWnfZpzCd5U89IH cLKuMPI34vH51ATbBfR1vwuCqjYl5YI8SFUfr7mw7MgUBqitb8ql/4psLUi3gUZ8KPOs +yFOemqteOpW2M9yaxPZdkl9R8hBZGH8w4zPB6xhliJaDTf7d2r8qEW6DP5J7O/Uiv68 UreA== X-Gm-Message-State: APjAAAXbHrW3ZYO/OauOKW99cALzFfgbe9lopyq6etrLYHK7Qx+E3uDj sGJZ3n8Vkx9NuDQ8HtXsKF00CxpCCMik0UGpkeGeAA== X-Received: by 2002:a50:a3dc:: with SMTP id t28mr93416040edb.256.1558594703849; Wed, 22 May 2019 23:58:23 -0700 (PDT) MIME-Version: 1.0 References: <20190503033340.GA7980@archlinux-i9> <20190523015639.GB17819@archlinux-epyc> <20190523055258.GC22946@kroah.com> In-Reply-To: <20190523055258.GC22946@kroah.com> From: Stephen Hines Date: Wed, 22 May 2019 23:58:12 -0700 Message-ID: Subject: Re: -Wuninitialized warning in drivers/misc/sgi-xp/xpc_partition.c To: Greg Kroah-Hartman Cc: Nathan Chancellor , Cliff Whickman , Robin Holt , Arnd Bergmann , linux-kernel@vger.kernel.org, Nick Desaulniers , clang-built-linux@googlegroups.com 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 Hi Nathan, Since this kind of self-initialization is considered undefined behavior, the simplest fix here is to just initialize to NULL. It's a reasonable interpretation of what is currently written, and will at least make the existing code more deterministic. Thanks, Steve On Wed, May 22, 2019 at 10:53 PM Greg Kroah-Hartman wrote: > > On Wed, May 22, 2019 at 06:56:39PM -0700, Nathan Chancellor wrote: > > On Thu, May 02, 2019 at 08:33:40PM -0700, Nathan Chancellor wrote: > > > Hi all, > > > > > > When building with -Wuninitialized, Clang warns: > > > > > > drivers/misc/sgi-xp/xpc_partition.c:73:14: warning: variable 'buf' is uninitialized when used within its own initialization [-Wuninitialized] > > > void *buf = buf; > > > ~~~ ^~~ > > > 1 warning generated. > > > > > > I am not really sure how to properly initialize buf in this instance. > > > I would assume it would involve xpc_kmalloc_cacheline_aligned like > > > further down in the function but maybe not, this function isn't entirely > > > clear. Could we get your input, this is one of the last warnings I see > > > in a few allyesconfig builds. > > > > > > Thanks, > > > Nathan > > > > Hi all, > > > > Friendly ping for comments/input. This is one of a few remaining > > warnings I see, it'd be nice to get it fixed up so we can turn it on for > > the whole kernel. > > Patches are gladly welcome :) > > thanks, > > greg k-h > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To post to this group, send email to clang-built-linux@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20190523055258.GC22946%40kroah.com. > For more options, visit https://groups.google.com/d/optout.