Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9023491rwd; Wed, 21 Jun 2023 01:50:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zUk3axwlYfd7vbmiuLDbHZDDwDhS/Gyt5xwTamrfozRtXEygSD3S8MK2ASi/0jXymYtbd X-Received: by 2002:a17:902:aa05:b0:1b6:82a5:13d5 with SMTP id be5-20020a170902aa0500b001b682a513d5mr3450900plb.9.1687337437462; Wed, 21 Jun 2023 01:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687337437; cv=none; d=google.com; s=arc-20160816; b=fC5d+xCVKTwbJ2N9k0USriyZvlAxU31F5tMkk1jFDAPBrZqGAT+w4ZUy8rZuYMz/lN 6kglG7qk2sFg3blJHacVLFR0hL6kFlakrX3KB+g8jJs84XXK22bury11m8CDOHaIwunY P6iSJIdvImfFjtqtroG5zOGwg5ggS6bmC+CDNRADPmkgTvwKOab5AYvlzXvc9TiK5FW+ 9XIkwkz1pw5PG7TZaXd+Pf29HoTAfnjnJ2VjtJLtS9Gkx3NZrCi/tVfD38voS8Ks0QGv gpO7xRJbyLrwcdGwHbEs6UfYY1Jg51KIivB9tI6PeET2fVio/rUSs8SKhhkpwUT3mjqD Lzpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=4jBRz0LRg2B0m25eW+Tt+1nFooZyySe4sAZwfGusRF0=; b=h27LzZW0fD0jhDOGZKl+23mRowNowgYr/uyuKLqiywWOUFDaqr7xMhllLixeV3CwUL 7tNHs6cwsfZhRrNVrQjfCf29bVwiCv/Cp/b5xMzSDFeb+k4YB2ZYZd6+nCCHYmwGIIox xvrScwHO72zBfwF5iwrmM3J71XEuXkiC6ysa/7ymg91yUeq7savV7flVwh3VNFb/Viyw w48+Pi3HwF7NwRzVq7C4XIzSZBiLxOegBuwVLHrLyW8/dKCqwoIdS9PjhPVi4ORA596m 3+H83yEMaBtqT+7nWtmdNOtklbQAylG7bNDMAlCRe/oDoJgzo6ePn8Ivfe85Rb4oiIYS 5FTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=WkOBwnyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l9-20020a170903120900b001aaf1734d1dsi4074030plh.241.2023.06.21.01.50.23; Wed, 21 Jun 2023 01:50:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=WkOBwnyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231394AbjFUIV6 (ORCPT + 99 others); Wed, 21 Jun 2023 04:21:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbjFUIV4 (ORCPT ); Wed, 21 Jun 2023 04:21:56 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C133EDD; Wed, 21 Jun 2023 01:21:55 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5149aafef44so6674589a12.0; Wed, 21 Jun 2023 01:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687335714; x=1689927714; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4jBRz0LRg2B0m25eW+Tt+1nFooZyySe4sAZwfGusRF0=; b=WkOBwnyhVMeHdjv01ZldJEa+yVR6LiekbLDbZLW1R5TvMV0n+6h68f19tE2f9nILs1 fKcMH0bPB91NbFjdrpNvQYwgTzVriIR6TXjPS80e3nbpeWKzhxdeoC5uIbZIATwvieW8 fPhTjy8tKuy7sLPj99+c1ne1Hm5tfm2nO/Oj6nQnT5cgwy6XWg3TV3Ji5lMkJYOE4p0B BCIZ04JUBr3Ut+VLcUIYqBmElziueUczruSOONBFcvEcucoSkH/wWVE1hDQcKSnfP7cW YDD5sp91grBQU/yVEwo5KtCMeA8d6oWgkCWak1Mgp0+tB5taBmmOFVHbHxBiNWN0BFJO etPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687335714; x=1689927714; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4jBRz0LRg2B0m25eW+Tt+1nFooZyySe4sAZwfGusRF0=; b=M6vkdVGKqnKxI2GgPdvnaMHKlqWrBdGehdmNt9gEp5rjY/f+U7pPiAdWXZrG6i/rFe 5wIk3u0EmdkB2HxTBl3O+RAwE4OcNgUyQros5HAuaohsO+OfZBQbWQ1lvytKR/+FRu8C Hefl4VldLkW5Ua/f9B0cPr41+uiI7NTlbrYfyj/c9X+o72JWbDuYDE2fhwg6lba3Gko7 3BVfOofc2aUjCmF6XDKFSZWNeUFfv7UxshrDlR8ekKkyspH//Ddjaq1WUpxYUm9PX0Y9 +hy49whFUcb0TcYxlfr4BkLOvYbeOzicJKi2fIKUwVciL7/JtQHEXSNyhyFSFOsAqV4i ZHBA== X-Gm-Message-State: AC+VfDw/XHm6r1VekkdqjWTmM9UNQ7P2GYzx72EiJwm2lbloepKlHe1Z ps5ajoV+5zg3E1NvFBMiqCPM9rUKxPeeKDIoSx0= X-Received: by 2002:aa7:c1d9:0:b0:51b:c714:a296 with SMTP id d25-20020aa7c1d9000000b0051bc714a296mr3604912edp.13.1687335713981; Wed, 21 Jun 2023 01:21:53 -0700 (PDT) MIME-Version: 1.0 References: <20230620132641.256307-1-kimseer.paller@analog.com> <20230620132641.256307-2-kimseer.paller@analog.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 21 Jun 2023 11:21:17 +0300 Message-ID: Subject: Re: [PATCH v7 2/2] iio: adc: max14001: New driver To: "Paller, Kim Seer" Cc: "jic23@kernel.org" , "lars@metafoo.de" , "lgirdwood@gmail.com" , "broonie@kernel.org" , "Hennerich, Michael" , "robh@kernel.org" , "krzysztof.kozlowski@linaro.org" , "conor+dt@kernel.org" , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 21, 2023 at 3:38=E2=80=AFAM Paller, Kim Seer wrote: > > From: Andy Shevchenko > > Sent: Tuesday, June 20, 2023 11:15 PM > > On Tue, Jun 20, 2023 at 4:27=E2=80=AFPM Kim Seer Paller > > wrote: ... > > > + /* > > > + * Align received data from the receive buffer, reversing and= reordering > > > + * it to match the expected MSB-first format. > > > + */ > > > + *data =3D (__force u16)(be16_to_cpu(bitrev16(st->spi_rx_buffe= r))) & > > > + MAX14001_DATA= _MASK; > > > > Using __force in the C files is somehow stinky. ... > > > + /* > > > + * Convert transmit buffer to big-endian format and reverse t= ransmit > > > + * buffer to align with the LSB-first input on SDI port. > > > + */ > > > + st->spi_tx_buffer =3D (__force u16)(cpu_to_be16(bitrev16( > > > > You have a different type of spi_tx_buffer than u16, don't you? > > I have the same type of spi_tx_buffer as u16. And you should have __be16. > Other than using force cast, is there any way to resolve the endian warni= ng? I have > actually swapped the order of bitrev16() and cpu_to_be16/be16_to_cpu() fu= nctions. > I have tested and they also work fine. You really have to get it correct on both LE and BE architectures. --=20 With Best Regards, Andy Shevchenko