Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5406664ybi; Wed, 12 Jun 2019 01:54:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwv4oE0VSlUKgmcQAzLGUlIEwdS/Noo7RVnhmZIeKho15kRu5vv6/35J9SxiJPLVh9CtRxZ X-Received: by 2002:a62:5303:: with SMTP id h3mr4284768pfb.58.1560329665279; Wed, 12 Jun 2019 01:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560329665; cv=none; d=google.com; s=arc-20160816; b=URarDglr4qq8pxGYk7EUAwEDJ+oE3hNjl0xCQeF69pXhZNVqdbmXuKJ5zZRTqNKO08 oByA4eARdejc2yCQY9Hef1/iJtOsdF0z0EPGn82pvG7wCP2lFTY8i8iXpswDZtkFxqBn yfdqlAA4u3xgjvUUqAD6EEgKs0tK59lmsRMtUkeDX3G9bd9zthF8w0RJ4JOdCcRx4GNv PoznHm6QKcgRHP/HOjWR3rgApe9/xWfbCo/p7UM3QHbjwWNuFQjSXX3b/KZGaHsGBkH0 Z//3uaRxMBtRoxxqmLVFoblaLs4l1Qss0R5NXCP0ENbq/dP1gGwh9oJNLzygCcBHAJrs LZgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=r3SzJwXrLD2vEcjZT750WK8cKLEa+W6WNKJTcM8KNjU=; b=ODPzf9Fb1GQBxRN4GNfjB2BOPC0x3km0LHcej+zCVljnJbv+I73dSm2Tr6eSyOfBJc CFkkghWzY+9fkcZ7FBLrevKLbjQ5XoQvS6jzUDp3/yljeGhlegrwTAyeBTPKGk4q2fNw koKJej5E7ciQWaN9KVXzlOS8ptHnzOyO+Fx+2sZLUH7Nv/Z2d9fpuwWAj3uA/0fQVhOT yFsHKK0dr96lNGyUDo0hsJuYpw7+oQybxC+uhvyrdGkNHXvUnvNXgYoVV0aNje2uCrnx cCt/rT+ig58kzClyJHZn8omdvspq6/RTOAmugv6MHXis0859RSCvKlRjijGQIKCJCnTv AzbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AV7toiB2; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si5004577pjq.100.2019.06.12.01.54.09; Wed, 12 Jun 2019 01:54:25 -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=@linaro.org header.s=google header.b=AV7toiB2; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437156AbfFLIbo (ORCPT + 99 others); Wed, 12 Jun 2019 04:31:44 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55672 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726977AbfFLIbn (ORCPT ); Wed, 12 Jun 2019 04:31:43 -0400 Received: by mail-wm1-f66.google.com with SMTP id a15so5579763wmj.5 for ; Wed, 12 Jun 2019 01:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=r3SzJwXrLD2vEcjZT750WK8cKLEa+W6WNKJTcM8KNjU=; b=AV7toiB2kM1Sr4N+o3ge48VkF43YiDVmDUu7Ys8JDTPCam5aohC0dr02fDL0SOEVPM LLEnggLz23ta0tKDH3Fp+7VYrGcCz73Lr9Tk0xNwjYNVGrSIj6SMvyn5/S5vJuorig3W cyDw6Q49330DAu75YGVDw+q25aMAqbmjCTF30GzanQwNNKLDq3QtGMs2HBLiLz4qrHMh Kc/cyeP6e1p2aUqCQKaEUjdSBLhuc1dB4ot3ufw5d7FHby1/2Veo+ZN6MoQhg6qjPUNc ITClCkeJ0Y3XW8LB4WzVYddGcP1Jh/DsXAoisV6AFv/WjoHeCcEwewFxodHUufY9NtWF 6PmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=r3SzJwXrLD2vEcjZT750WK8cKLEa+W6WNKJTcM8KNjU=; b=PhaxyVP/ZaIPPwOq6CtfMaMtdgP2uyC4m0hiFsaZd7Cd1V/MPoZurVz4eN6Y+lKI8/ +tjSCt4ugu1lwuX5udlkCarsow0+LY7NEGDuMpXm1Di42U5rTkIxzbMs4vuuNG+krt3z mGptiSzStPt2spgxx10fG8G5g9OkrkxObjg6pyWOc0cve/jGz0V3LTU5AHFZ76X4WsHy +H/vr5uyKwDrH3Re+3Y4i+ovPXoPPtFIjxi38coHQrFziZfUpoT2TBxdVbe9RaadV731 PKtTntFWPZN3QK6Ka2fRAgXfb5JmK5/vonvHku4aFIXZCWD4V+JuSaaDwY/oI8MTiV2n piGg== X-Gm-Message-State: APjAAAX4bNq///ys33u90EBcKeELbq2bF0nN5MPdJbThFodq/OmsW6D/ BBy128SdefYPkCdm4K4XCLJBlg== X-Received: by 2002:a1c:1bc1:: with SMTP id b184mr22630124wmb.42.1560328301436; Wed, 12 Jun 2019 01:31:41 -0700 (PDT) Received: from dell ([2a01:4c8:f:9687:619a:bb91:d243:fc8b]) by smtp.gmail.com with ESMTPSA id t140sm1662995wmt.0.2019.06.12.01.31.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Jun 2019 01:31:40 -0700 (PDT) Date: Wed, 12 Jun 2019 09:31:38 +0100 From: Lee Jones To: Charles Keepax Cc: arnd@arndb.de, natechancellor@gmail.com, ottosabart@seberm.com, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com Subject: Re: [PATCH 1/4 RESEND] mfd: arizona: fix undefined behavior Message-ID: <20190612083138.GT4797@dell> References: <20190520090628.29061-1-ckeepax@opensource.cirrus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190520090628.29061-1-ckeepax@opensource.cirrus.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 May 2019, Charles Keepax wrote: > From: Arnd Bergmann > > When the driver is used with a subdevice that is disabled in the > kernel configuration, clang gets a little confused about the > control flow and fails to notice that n_subdevs is only > uninitialized when subdevs is NULL, and we check for that, > leading to a false-positive warning: > > drivers/mfd/arizona-core.c:1423:19: error: variable 'n_subdevs' is uninitialized when used here > [-Werror,-Wuninitialized] > subdevs, n_subdevs, NULL, 0, NULL); > ^~~~~~~~~ > drivers/mfd/arizona-core.c:999:15: note: initialize the variable 'n_subdevs' to silence this warning > int n_subdevs, ret, i; > ^ > = 0 > > Ideally, we would rearrange the code to avoid all those early > initializations and have an explicit exit in each disabled case, > but it's much easier to chicken out and add one more initialization > here to shut up the warning. > > Signed-off-by: Arnd Bergmann > Reviewed-by: Nathan Chancellor > Signed-off-by: Charles Keepax > --- > drivers/mfd/arizona-core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog