Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2299144imd; Fri, 2 Nov 2018 09:04:32 -0700 (PDT) X-Google-Smtp-Source: AJdET5d7S5cznkavsEJBFBgMyVACJ0pRgrsRJraqHdxIhjNxdy2jHJd1/WZDdpPMoLqb4mKgUHd+ X-Received: by 2002:a62:20d8:: with SMTP id m85-v6mr12166326pfj.152.1541174672726; Fri, 02 Nov 2018 09:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541174672; cv=none; d=google.com; s=arc-20160816; b=o53dV8ZZSodcKz5eXUByWNeqd++5pv651fkZF1gmLig87EYcFG5G1230NC63e3FYP+ ZinEQUzA1cg7jf604wpVlixi6+ALZfh2Dq2J1FtMJL2yv80wNvWEPtbshg4uwD/Ac7+N zCx0sFtycrx2sm9yCsGh6BZdGZ/WsJakB+s07joNs/s45EgKw+OaI0kBep2FG9jW4UzG /CnhY9b6lylcpdXdtxbsCBDC0hKrLTPeyGEg39iIdIqYsuWmJ/5Gj9bEnMLO2Wo4ZaRI f+zXPxgR+PAz2QViT9Q5popx9KbTXXIraNsS1EEcegBsyuKbEHOrFl01I1rRf4/JY/Tg nOmQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ROBixuan8tnqx9dAzL8/JfeXApMAHx6cbcI+th8Gfx4=; b=qfWOQ8ktcpT0eE3/ctcHUA/nbVH22lMUM787G8KgEVeSy7LzI/O/qcrD2DTrNe/6hN qLEL7spVKnog7mi6gc9bkN6hvxost6kY7B3eXIm0WHvXxMXjwY1UZ4aeKZIz53SfUV21 5/6Tqu7cMJGg2Mw/UgSdNwAoAf58brhlU+AArdRz4VrZqGNO82V7CGgltNBw22Pkmpnx uwwwKWj/wH3KpBYy9+FLDgcTspLqT4qLRMIwuYSCAMWz1Ww49GXrtbxNG/PyPxJAF2rn I3z2dRfahPw8ZN+HmzuFjOxM9fT/SE+6gHHFwOV8Zu523UUPU5LfONvd6UUU5J3so40W KyrQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t69si4213198pgb.365.2018.11.02.09.04.16; Fri, 02 Nov 2018 09:04:32 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727847AbeKCBKO (ORCPT + 99 others); Fri, 2 Nov 2018 21:10:14 -0400 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:51420 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726260AbeKCBKO (ORCPT ); Fri, 2 Nov 2018 21:10:14 -0400 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.23/8.16.0.23) with SMTP id wA2FwhTr012021; Fri, 2 Nov 2018 11:01:42 -0500 Authentication-Results: ppops.net; spf=none smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from mail1.cirrus.com (mail1.cirrus.com [141.131.3.20]) by mx0a-001ae601.pphosted.com with ESMTP id 2ncne2yp33-1; Fri, 02 Nov 2018 11:01:42 -0500 Received: from EX17.ad.cirrus.com (unknown [172.20.9.81]) by mail1.cirrus.com (Postfix) with ESMTP id 9C796611E128; Fri, 2 Nov 2018 11:01:41 -0500 (CDT) Received: from imbe.wolfsonmicro.main (198.61.95.81) by EX17.ad.cirrus.com (172.20.9.81) with Microsoft SMTP Server id 14.3.408.0; Fri, 2 Nov 2018 16:01:40 +0000 Received: from imbe.wolfsonmicro.main (imbe.wolfsonmicro.main [198.61.95.81]) by imbe.wolfsonmicro.main (8.14.4/8.14.4) with ESMTP id wA2G1dqv029031; Fri, 2 Nov 2018 16:01:39 GMT Date: Fri, 2 Nov 2018 16:01:39 +0000 From: Charles Keepax To: Arnd Bergmann CC: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , "Robert Jarzmik" , Kuninori Morimoto , Marcel Ziswiler , Fabio Estevam , , , Subject: Re: [PATCH] [v2] ASoC: wm97xx: fix uninitialized regmap pointer problem Message-ID: <20181102160139.GQ16508@imbe.wolfsonmicro.main> References: <20181102151922.889131-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20181102151922.889131-1-arnd@arndb.de> User-Agent: Mutt/1.5.20 (2009-12-10) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=813 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811020143 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Nov 02, 2018 at 04:18:21PM +0100, Arnd Bergmann wrote: > gcc notices that without either the ac97 bus or the pdata, we never > initialize the regmap pointer, which leads to an uninitialized variable > access: > > sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe': > sound/soc/codecs/wm9712.c:666:2: error: 'regmap' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > Since that configuration is invalid, it's better to return an error > here. I tried to avoid adding complexity to the conditions, and turned > the #ifdef into a regular if(IS_ENABLED()) check for readability. > This in turn requires moving some header file declarations out of > an #ifdef. > > The same code is used in three drivers, all of which I'm changing > the same way. > > Fixes: 2ed1a8e0ce8d ("ASoC: wm9712: add ac97 new bus support") > Signed-off-by: Arnd Bergmann > --- Acked-by: Charles Keepax Thanks, Charles