From patchwork Wed Jul 7 12:41:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 471093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F748C07E95 for ; Wed, 7 Jul 2021 12:41:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBB5E61CB9 for ; Wed, 7 Jul 2021 12:41:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231585AbhGGMoL (ORCPT ); Wed, 7 Jul 2021 08:44:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231550AbhGGMoJ (ORCPT ); Wed, 7 Jul 2021 08:44:09 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C20FC061760 for ; Wed, 7 Jul 2021 05:41:28 -0700 (PDT) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m16re-00024g-Mi; Wed, 07 Jul 2021 14:41:18 +0200 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1m16rd-0005Dz-0i; Wed, 07 Jul 2021 14:41:17 +0200 From: Oleksij Rempel To: Dmitry Torokhov , Alexandru Ardelean , Mark Brown Cc: Oleksij Rempel , kernel test robot , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-spi@vger.kernel.org, David Jander Subject: [PATCH v1] Input: ads7846: ads7846_get_value - fix unaligned pointer value warning Date: Wed, 7 Jul 2021 14:41:15 +0200 Message-Id: <20210707124115.20028-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-spi@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Fix warning reported by the kernel test robot: drivers/input/touchscreen/ads7846.c:705:24: warning: taking address of packed member 'data' of class or structure 'ads7846_buf' may result in an unaligned pointer value [-Waddress-of-packed-member] Fixes: 6965eece2a89 ("Input: ads7846 - convert to one message") Reported-by: kernel test robot Signed-off-by: Oleksij Rempel --- drivers/input/touchscreen/ads7846.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index adb4c2230c31..1987dedac94f 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -702,7 +702,7 @@ static int ads7846_get_value(struct ads7846_buf *buf) { int value; - value = be16_to_cpup(&buf->data); + value = get_unaligned_be16(&buf->data); /* enforce ADC output is 12 bits width */ return (value >> 3) & 0xfff;