All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: linux-next: Tree for Feb 8 (objtool: warnings: 5)
Date: Tue, 9 Feb 2021 16:59:59 -0600	[thread overview]
Message-ID: <20210209225959.vobnut7nsneiujyl@treble> (raw)
In-Reply-To: <9fd03d53-8001-b76f-feea-179c13633a8b@infradead.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 <jpoimboe@redhat.com>
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 <rdunlap@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
---
 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


  reply	other threads:[~2021-02-10  1:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 12:52 linux-next: Tree for Feb 8 Stephen Rothwell
2021-02-08 19:30 ` linux-next: Tree for Feb 8 (objtool: warnings: 5) Randy Dunlap
2021-02-08 21:21   ` Josh Poimboeuf
2021-02-08 21:39     ` Randy Dunlap
2021-02-09 22:59       ` Josh Poimboeuf [this message]
2021-02-10  0:16         ` Randy Dunlap
2021-02-09  8:06     ` Peter Zijlstra
2021-02-09 23:23       ` [PATCH] ubsan: remove overflow checks Andrey Ryabinin
2021-02-10  0:19         ` Kees Cook
2021-02-10  7:50           ` Peter Zijlstra
2021-02-10 11:55           ` Andrey Rybainin
2021-02-09  8:34   ` [PATCH] lockdep: Noinstr annotate warn_bogus_irq_restore() Peter Zijlstra
2021-02-09 13:24     ` Mark Rutland
2021-02-09 16:03       ` Peter Zijlstra
2021-02-09 16:13         ` Mark Rutland
2021-02-09 18:28         ` Randy Dunlap
2021-02-10 13:59         ` [tip: locking/core] " tip-bot2 for Peter Zijlstra
2021-02-09  3:33 ` linux-next: Tree for Feb 8 (Warning at arch/x86/kernel/irq.c:390) Randy Dunlap
2021-02-09 10:17   ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210209225959.vobnut7nsneiujyl@treble \
    --to=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rdunlap@infradead.org \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.