From patchwork Sun Oct 17 16:03:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Cameron X-Patchwork-Id: 12564395 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 017A1C433EF for ; Sun, 17 Oct 2021 15:58:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFF2961054 for ; Sun, 17 Oct 2021 15:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241634AbhJQQBH (ORCPT ); Sun, 17 Oct 2021 12:01:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:36906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237507AbhJQQBH (ORCPT ); Sun, 17 Oct 2021 12:01:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2E77661040; Sun, 17 Oct 2021 15:58:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634486337; bh=ogb2FpJKMZfPnp21xeZREjE7NG2W6B7oCI0E7ScgD4I=; h=From:To:Cc:Subject:Date:From; b=S05ekInNMnKqBYHrokxocf+kCOXaubSdiGm6zzCUUfCG3T3oUlCVW/Pq7mapiZtpU I46Y2DtnkTb5Ee0Or28NXt11mOf8hhZm7uiD8lJWrmgW5PcqmgkV++C9Rbr1elLW2J xIJkJzeKf0yjam3lvf3GjOUZlgKM6C7MzJomQ/+Q9in2VyVW3kl0/YhUrI+lQFgj8F WKjeSjf3Mceq/sJOFSY4qATcbO72svhyIvb62cWZatxtP3qN8OVKiWfdPa6XSWs1Wk oxCjHF2hig5W+pOWr7clzDZDTRmqdNOP0xvZotGyPiTidiQiKPIyn8TlGFm+DLNLrh LYfoVE67BtM7A== From: Jonathan Cameron To: linux-iio@vger.kernel.org Cc: Lars-Peter Clausen , Jonathan Cameron , Dan Carpenter Subject: [PATCH v2] iio: accel: sca3000: Use sign_extend32() instead of opencoding sign extension. Date: Sun, 17 Oct 2021 17:03:03 +0100 Message-Id: <20211017160303.72441-1-jic23@kernel.org> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org From: Jonathan Cameron Whilst nice to get rid of this non obvious code, this also clears a static checker warning: drivers/iio/accel/sca3000.c:734 sca3000_read_raw() warn: no-op. '((*val) << 19) >> 19' Reported-by: Dan Carpenter Signed-off-by: Jonathan Cameron Reviewed-by: Lars-Peter Clausen rx) >> 3) & 0x1FFF; - *val = ((*val) << (sizeof(*val) * 8 - 13)) >> - (sizeof(*val) * 8 - 13); + *val = sign_extend32(*val, 12); } else { /* get the temperature when available */ ret = sca3000_read_data_short(st,