Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp940840pxb; Tue, 9 Feb 2021 17:25:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyejD9WzlEeHosH7ss6mgPfJhXaOgtPHNQ6Y3pd53mapqWdalY1jg5/n0cHEufWmIvIWHCK X-Received: by 2002:a17:906:cc49:: with SMTP id mm9mr502075ejb.450.1612920304971; Tue, 09 Feb 2021 17:25:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612920304; cv=none; d=google.com; s=arc-20160816; b=W6tiSS18V8u6ZIjKS1mYxnZFFDWdLJwHITYWnq4W2AGQrUJAznKicdc4aI9NMQ7yZF hrAi7NB/9awRK+M/VNjVdndraXHCqAlT7BcB1FbNtG07kUTopwlBFCmOYaJ7KJtW97tA x0Pzp0e9Bs8sCjCsL5wh8poJ9j+6ZrnP6ym/RdfcSPI/tlLo+oPl8ewx79UP7prfnsyY kdE5zDJSGikoxZWDGOFIjGEsFznD8ROyE30DTDtCrg0Sv7nMC9M058Xc/Q+yWBIDGAih D5aSf5LgnWROnZ2cUKc1ugqESXqfuEdnlg6+S//+H112hQtkG5+jG0cUbPgJreB/Ija2 mH5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SA6kakV1SOYYbDyoyq9jrgTtNWutLHHtwS4+AwSyzGU=; b=0dPvCyNwJ2S4ez0Cz35UtdHPnDYmrdrxE9PPnefOKTMbowrxBoLaKQQo0RuAnLcdV2 bQgtnXuZ1QktpTbXE47FjCWyTfav8mFodRTq4OL+4D5fDNGvlflSlWm8LIQLUU67CboI gkbtUkJfSaVDevD2VRWMZXwxO3kYFdhtcKBUFCcm4gVHr70q0lzQ702WucgCMXNGI8nV s7kb+k8tKAf8R+9GftIVK9zCBoh8oXiHeqX1xwRgmWFjrBGto+LLPzs4D4jNg7Fv/ZEL ghLSytInzzOlwlePpQOoKH0eNZatR13SlcJVAobyOM6uBn5sdtmaboMtQy8NKDvCrpFw 7b4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OxXjOHxD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si304547edw.152.2021.02.09.17.24.41; Tue, 09 Feb 2021 17:25:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OxXjOHxD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233968AbhBJBX6 (ORCPT + 99 others); Tue, 9 Feb 2021 20:23:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59136 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234698AbhBIXCb (ORCPT ); Tue, 9 Feb 2021 18:02:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612911605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SA6kakV1SOYYbDyoyq9jrgTtNWutLHHtwS4+AwSyzGU=; b=OxXjOHxDFJhVYjYnhhelyZrhhKtL1sOejMLBogrl2kvbC9heqBblnDRW7USVWngfCmoRsc hfU4mppGruGEsrN69VcMfNk1yjcgETKoD3DGfFSfE/fMRmwwmK+tmlpMcSkJ+Vs3p1EStV CXFHAmT+LKy0T5eIlsRmHtgOZswD8yA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-570-0TmmCEr3MIGW_LddZcYDrA-1; Tue, 09 Feb 2021 18:00:03 -0500 X-MC-Unique: 0TmmCEr3MIGW_LddZcYDrA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 38BFB18829C1; Tue, 9 Feb 2021 23:00:02 +0000 (UTC) Received: from treble (ovpn-120-169.rdu2.redhat.com [10.10.120.169]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4BF225D9CD; Tue, 9 Feb 2021 23:00:01 +0000 (UTC) Date: Tue, 9 Feb 2021 16:59:59 -0600 From: Josh Poimboeuf To: Randy Dunlap Cc: Stephen Rothwell , Linux Next Mailing List , Linux Kernel Mailing List , Peter Zijlstra Subject: Re: linux-next: Tree for Feb 8 (objtool: warnings: 5) Message-ID: <20210209225959.vobnut7nsneiujyl@treble> References: <20210208235246.01cb4daf@canb.auug.org.au> <2000eae0-89f4-a88f-a113-7fa47f16def7@infradead.org> <20210208212153.vs2v7k2c55a3syvo@treble> <9fd03d53-8001-b76f-feea-179c13633a8b@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9fd03d53-8001-b76f-feea-179c13633a8b@infradead.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 08, 2021 at 01:39:03PM -0800, Randy Dunlap wrote: > On 2/8/21 1:21 PM, Josh Poimboeuf wrote: > > On Mon, Feb 08, 2021 at 11:30:59AM -0800, Randy Dunlap wrote: > >> On 2/8/21 4:52 AM, Stephen Rothwell wrote: > >>> Hi all, > >>> > >>> Changes since 20210205: > >>> > >> > >> on x86_64: > >> > >> objtool warnings: (from 3 different randconfig builds) > >> > >> drivers/input/touchscreen/elants_i2c.o: warning: objtool: elants_i2c_initialize() falls through to next function elants_i2c_resume() > > > > Randy, can you share the .o? (you may need to gzip it, still waiting on > > corporate IT to allow me to receive .o files) > > Sure, no problem. It's attached. Does this fix? From: Josh Poimboeuf Subject: [PATCH] input/elants_i2c: Detect enum overflow If an enum value were to get added without updating this switch statement, the unreachable() annotation would trigger undefined behavior, causing execution to fall through the end of the function, into the next one. Make the error handling more robust for an unexpected enum value, by doing BUG() instead of unreachable(). Fixes the following objtool warning: drivers/input/touchscreen/elants_i2c.o: warning: objtool: elants_i2c_initialize() falls through to next function elants_i2c_resume() Reported-by: Randy Dunlap Signed-off-by: Josh Poimboeuf --- drivers/input/touchscreen/elants_i2c.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index 6f57ec579f00..4c2b579f6c8b 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -656,8 +656,7 @@ static int elants_i2c_initialize(struct elants_data *ts) error = elants_i2c_query_ts_info_ektf(ts); break; default: - unreachable(); - break; + BUG(); } if (error) -- 2.29.2