Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2610257pxb; Mon, 6 Sep 2021 00:54:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLwHm9O2/EkmEGZseb2IczrLkct/2S/qzkflXA8c235ssWgRQOCAmo+tpwihuN73Devj5u X-Received: by 2002:a02:cc53:: with SMTP id i19mr9774112jaq.124.1630914889925; Mon, 06 Sep 2021 00:54:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1630914889; cv=pass; d=google.com; s=arc-20160816; b=sTVumyu4ywEKg9NZ6et+ZZIY6ybQMRpQ6ovMUKwPyAi+Ruku7UGdvkgKpj4xgPJrbR 5tvCGp8A05P2RJ5xKbo7kEXtuCc2j/zh7bDiefhURIE2r3Ahzebxg7/TXeov0fxicaHN 2NBCGnnAj7PeZV0o7x9apzwMcfehipXDFEG9QrmI0TFjr01nD8+qY5r5Cq6YTo7VOt15 5E8yulP04tG6r6tIVB7OtmcvS7AYhlvy0KRQao4ti+J9PfSEgJ0hp69dnqiQ9dLwWu8b OJoZU2cnCcLfNT8bxasApjvCYjFAsNK6HMSbLBBAaPUj1lqoFxn31FJMPlkUY3W3P5l4 Mx2A== ARC-Message-Signature: i=2; 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=dl04EcBEovB0z67bJJd0IcCsfjvcm4H5nKTPh9ieLzw=; b=k5V8i36n1VwLh6CcQYP7Tx8pgnZmHpccfpdVSbvi+VR6LKCVIvDO0HKNFN82yCLveO evB7jQbaEwa180ilsAQ2pXxMSfYETuxDOoX6TY1mYC6YwKpqsgZ5i09N4bWkmOcGXb+m j7BxdcxfIseriin7FeT3mHPySvZmft4SmEjqALKlXrMxmtUio83EV8DJcj/r6pRsmZ16 psve4GpqAETYAK4vZAYzrizDxLDlb40HG3lvcmxRxlZVacVansi0B3dGtgYPPbsenoF7 nleVZcgZEGDwl4i/CYmN9cNEL43V2LWA755fSzKq3MVE0ukbh47WDZbKzUfpf1X9gYtH cSPQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=YVLA4GBq; arc=pass (i=1); 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si6659729jab.66.2021.09.06.00.54.39; Mon, 06 Sep 2021 00:54:49 -0700 (PDT) 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=@iki.fi header.s=meesny header.b=YVLA4GBq; arc=pass (i=1); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240236AbhIFHyv (ORCPT + 99 others); Mon, 6 Sep 2021 03:54:51 -0400 Received: from meesny.iki.fi ([195.140.195.201]:43772 "EHLO meesny.iki.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240166AbhIFHyt (ORCPT ); Mon, 6 Sep 2021 03:54:49 -0400 Received: from hillosipuli.retiisi.eu (89-27-100-251.bb.dnainternet.fi [89.27.100.251]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sailus) by meesny.iki.fi (Postfix) with ESMTPSA id F16B1201A8; Mon, 6 Sep 2021 10:53:42 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1630914823; 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=dl04EcBEovB0z67bJJd0IcCsfjvcm4H5nKTPh9ieLzw=; b=YVLA4GBqSRyTSpUY7ume0bLAofYSq0800w/Lt0pEjYeNfSmbMcbGk6TdZGJGRSUI3d1v38 isEKy+BWyjSm6p5DhTyWdBD9MSt96n5PGl1NWELeHYlDIlHiCwaVxgcH9XKNszIAW3irX8 etqy8qtMTKBrG0NexfciOOoi17gNN4A= Received: from valkosipuli.retiisi.eu (valkosipuli.localdomain [192.168.4.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.eu (Postfix) with ESMTPS id 4134D634C8D; Mon, 6 Sep 2021 10:53:42 +0300 (EEST) Date: Mon, 6 Sep 2021 10:53:41 +0300 From: Sakari Ailus To: Pavel Machek Cc: Martin Kepplinger , devicetree@vger.kernel.org, kernel@puri.sm, krzysztof.kozlowski@canonical.com, laurent.pinchart@ideasonboard.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, mchehab@kernel.org, paul.kocialkowski@bootlin.com, phone-devel@vger.kernel.org, robh@kernel.org, shawnx.tu@intel.com Subject: Re: [PATCH v8 3/4] media: i2c: add driver for the SK Hynix Hi-846 8M pixel camera Message-ID: References: <20210831134344.1673318-1-martin.kepplinger@puri.sm> <20210831134344.1673318-4-martin.kepplinger@puri.sm> <20210903161742.GD2209@bug> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210903161742.GD2209@bug> ARC-Seal: i=1; s=meesny; d=iki.fi; t=1630914823; a=rsa-sha256; cv=none; b=ognmFP0waEVCmTO3zE3mhMVI1xR6yBzs6GkZToIu68SkGCCqI4EblTDAeKo2Ga4HJMSO36 h9MX/Q2zbLq6tL8GTNkA71+9fVg+Wxi+6ZKDonYwx1Er+DsCG9pMvXdTAS+Ul0FyYcqz/0 dpPGDXLiU+PpdHQPeflU0AR+IA7C6Ac= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=sailus smtp.mailfrom=sakari.ailus@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1630914823; 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=dl04EcBEovB0z67bJJd0IcCsfjvcm4H5nKTPh9ieLzw=; b=k3UT4FMT+0+VuZr74rUWguYh8Csfl8zq+ll+Hs4vOoBMhatglEeti+kpc9Nx5d14J+tCea JglDzfh8fFmBlf0w2ZgLt1v02wcqU2ACeQNfywDBXolfiOdqlJee5nocPyRSKznh06nWfD OOeBg6+nwJ406Nfsc3ud09Ort9i7UWQ= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, Martin, On Fri, Sep 03, 2021 at 06:17:43PM +0200, Pavel Machek wrote: > > +static void hi846_write_reg_16(struct hi846 *hi846, u16 reg, u16 val, int *err) > > +{ > > + struct i2c_client *client = v4l2_get_subdevdata(&hi846->sd); > > + u8 buf[6]; > > + int ret; > > + > > + if (*err < 0) > > + return; > > + > > + put_unaligned_be16(reg, buf); > > + put_unaligned_be32(val << 8 * 2, buf + 2); > > Is that obfuscated way of saying put_unaligned_be16(val, buf+2); buf[3] = 0; buf[4] = 0; ? Good catch. The buf should be only four u8's long, and you should use 16-bit variant here, too. Also the transfer should be done on sizeof(buf), not 4 (which indeed is the same, but cleaner). -- Regards, Sakari Ailus