Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3741908imm; Mon, 2 Jul 2018 04:55:42 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf5jm7qxdpakFTqVXY16Ntrb0XBfb6a2OARJ1A10zm6qEXr2l0jBiN2k/1flPJuIUiunZOu X-Received: by 2002:a62:d842:: with SMTP id e63-v6mr3170396pfg.88.1530532542206; Mon, 02 Jul 2018 04:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530532542; cv=none; d=google.com; s=arc-20160816; b=OZBf6UdhjeutebsOFfeMF1agWTnl/F+1bytJ4q1Ga018t/mIhlL8IgsOK+8gOZAjkU fmoswMOKusyRe1szQfM5QKGCiqMbYS0xM6qHF4lYKGq2adadbkg48DzB1N7G9HDB0pGG eIC7rE1ULsCqB0xMcUADdQRsVmqmnnBUHXLCqy7Bg+fxEAifC0bF+ouUyv5vMC8loHur 8eVIaZHAw4T7d4OoWOpNbyznF8vanStPLVfhfxf5liTnnF04vJCMqFNY2AvuauY5WHQc jJKc9zlrEK2FN2I5Xpj49s3ALNZ8xQjljCYllZ9+qJ4XpCgnqhz526cCBLf8dTZnKniq GIdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :arc-authentication-results; bh=2owA1WbNRUV1aS/evVjaeLkQmjLf4pv7NEQS3/mQDtc=; b=QIXEJAO5GgJjtEwdV3e+/IlyyyiyoT+sDoqW5nXjUe2p8n34EJVAcK8rT62mx/B0gf MHhCyy/j0hg8TWuLrir2/kbRDSPokTRWU2nHOF1FBXa0iEu8w+m4oSbhw4AxU4j7ponC PKG8eMFc4iRJ7vJVk0QuvRQKOipaJARBb+MSL/uIGccIA/fII++jLcd5REBPwWg0uQb8 pqfzw73jRjxqKCX8RVl7XAKvpyixkyXdkya6ZsqOxPlqFTJNejXbe3j6DAnSnpdOM1ew M0c/We571a8+4dDLXt+N3wzFNC8KnrePt/MSRnSP9XPjKmQFeTvSYrrkTKpFuZKI0n8F f/Bw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1-v6si15763841plr.410.2018.07.02.04.55.21; Mon, 02 Jul 2018 04:55:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030552AbeGBLig (ORCPT + 99 others); Mon, 2 Jul 2018 07:38:36 -0400 Received: from vps-vb.mhejs.net ([37.28.154.113]:34064 "EHLO vps-vb.mhejs.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753356AbeGBLid (ORCPT ); Mon, 2 Jul 2018 07:38:33 -0400 Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1fZxA5-0005ht-Ih; Mon, 02 Jul 2018 13:38:29 +0200 Subject: Re: [RESEND][PATCH v6 3/6] cx25840: add pin to pad mapping and output format configuration To: Dan Carpenter , kbuild@01.org Cc: kbuild-all@01.org, Michael Krufky , Mauro Carvalho Chehab , Andy Walls , linux-kernel , linux-media@vger.kernel.org, Hans Verkuil References: <20180702055548.4puqbtjzgf2afyyb@mwanda> From: "Maciej S. Szmigiero" Openpgp: preference=signencrypt Autocrypt: addr=mail@maciej.szmigiero.name; prefer-encrypt=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9gOb7O+Ef143kM4JdwUCWka8IgIbDAUJ A8JnAAAKCRCEf143kM4Jd9nXD/9jstJU6L1MLyr/ydKOnY48pSlZYgII9rSnFyLUHzNcW2c/ qw9LPMlDcK13tiVRQgKT4W+RvsET/tZCQcap2OF3Z6vd1naTur7oJvgvVM5lVhUia2O60kEZ XNlMLFwLSmGXhaAXNBySpzN2xStSLCtbK58r7Vf9QS0mR0PGU2v68Cb8fFWcYu2Yzn3RXf0Y dIVWvaQG9whxZq5MdJm5dknfTcCG+MtmbP/DnpQpjAlgVmDgMgYTBW1W9etU36YW0pTqEYuv 6cmRgSAKEDaYHhFLTR1+lLJkp5fFo3Sjm7XqmXzfSv9JGJGMKzoFOMBoLYv+VFnMoLX5UJAs 0JyFqFY2YxGyLd4J103NI/ocqQeU0TVvOZGVkENPSxIESnbxPghsEC0MWEbGsvqA8FwvU7Xf GhZPYzTRf7CndDnezEA69EhwpZXKs4CvxbXo5PDTv0OWzVaAWqq8s8aTMJWWAhvobFozJ63z afYHkuEjMo0Xps3o3uvKg7coooH521nNsv4ci+KeBq3mgMCRAy0g/Ef+Ql7mt900RCBHu4tk tOhPc3J1ep/e2WAJ4ngUqJhilzyCJnzVJ4cT79VK/uPtlfUCZdUz+jTC88TmP1p5wlucS31k Thy/CV4cqDFB8yzEujTSiRzd7neG3sH0vcxBd69uvSxLZPLGID840k0v5sftPA== Message-ID: <80ad8df5-f826-67bf-8ec5-f30aa70cf426@maciej.szmigiero.name> Date: Mon, 2 Jul 2018 13:38:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180702055548.4puqbtjzgf2afyyb@mwanda> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, On 02.07.2018 07:55, Dan Carpenter wrote: > Hi Maciej, > > Thank you for the patch! Perhaps something to improve: > > url: https://github.com/0day-ci/linux/commits/Maciej-S-Szmigiero/Add-analog-mode-support-for-Medion-MD95700/20180630-050341 > base: git://linuxtv.org/media_tree.git master > > New smatch warnings: > drivers/media/i2c/cx25840/cx25840-core.c:468 cx25840_s_io_pin_config() warn: bitwise AND condition is false here > > Old smatch warnings: > drivers/media/i2c/cx25840/cx25840-core.c:497 cx25840_s_io_pin_config() warn: bitwise AND condition is false here > drivers/media/i2c/cx25840/cx25840-core.c:526 cx25840_s_io_pin_config() warn: bitwise AND condition is false here > > # https://github.com/0day-ci/linux/commit/64372f380e540a77b73d4628a585c9c92956a7fd > git remote add linux-review https://github.com/0day-ci/linux > git remote update linux-review > git checkout 64372f380e540a77b73d4628a585c9c92956a7fd > vim +468 drivers/media/i2c/cx25840/cx25840-core.c > > 64372f38 Maciej S. Szmigiero 2018-06-29 435 > 64372f38 Maciej S. Szmigiero 2018-06-29 436 static int cx25840_s_io_pin_config(struct v4l2_subdev *sd, size_t n, > 64372f38 Maciej S. Szmigiero 2018-06-29 437 struct v4l2_subdev_io_pin_config *p) > 64372f38 Maciej S. Szmigiero 2018-06-29 438 { > 64372f38 Maciej S. Szmigiero 2018-06-29 439 struct i2c_client *client = v4l2_get_subdevdata(sd); > 64372f38 Maciej S. Szmigiero 2018-06-29 440 unsigned int i; > 64372f38 Maciej S. Szmigiero 2018-06-29 441 u8 pinctrl[6], pinconf[10], voutctrl4; > 64372f38 Maciej S. Szmigiero 2018-06-29 442 > 64372f38 Maciej S. Szmigiero 2018-06-29 443 for (i = 0; i < 6; i++) > 64372f38 Maciej S. Szmigiero 2018-06-29 444 pinctrl[i] = cx25840_read(client, 0x114 + i); > 64372f38 Maciej S. Szmigiero 2018-06-29 445 > 64372f38 Maciej S. Szmigiero 2018-06-29 446 for (i = 0; i < 10; i++) > 64372f38 Maciej S. Szmigiero 2018-06-29 447 pinconf[i] = cx25840_read(client, 0x11c + i); > 64372f38 Maciej S. Szmigiero 2018-06-29 448 > 64372f38 Maciej S. Szmigiero 2018-06-29 449 voutctrl4 = cx25840_read(client, 0x407); > 64372f38 Maciej S. Szmigiero 2018-06-29 450 > 64372f38 Maciej S. Szmigiero 2018-06-29 451 for (i = 0; i < n; i++) { > 64372f38 Maciej S. Szmigiero 2018-06-29 452 u8 strength = p[i].strength; > 64372f38 Maciej S. Szmigiero 2018-06-29 453 > 64372f38 Maciej S. Szmigiero 2018-06-29 454 if (strength != CX25840_PIN_DRIVE_SLOW && > 64372f38 Maciej S. Szmigiero 2018-06-29 455 strength != CX25840_PIN_DRIVE_MEDIUM && > 64372f38 Maciej S. Szmigiero 2018-06-29 456 strength != CX25840_PIN_DRIVE_FAST) { > 64372f38 Maciej S. Szmigiero 2018-06-29 457 > 64372f38 Maciej S. Szmigiero 2018-06-29 458 v4l_err(client, > 64372f38 Maciej S. Szmigiero 2018-06-29 459 "invalid drive speed for pin %u (%u), assuming fast\n", > 64372f38 Maciej S. Szmigiero 2018-06-29 460 (unsigned int)p[i].pin, > 64372f38 Maciej S. Szmigiero 2018-06-29 461 (unsigned int)strength); > 64372f38 Maciej S. Szmigiero 2018-06-29 462 > 64372f38 Maciej S. Szmigiero 2018-06-29 463 strength = CX25840_PIN_DRIVE_FAST; > 64372f38 Maciej S. Szmigiero 2018-06-29 464 } > 64372f38 Maciej S. Szmigiero 2018-06-29 465 > 64372f38 Maciej S. Szmigiero 2018-06-29 466 switch (p[i].pin) { > 64372f38 Maciej S. Szmigiero 2018-06-29 467 case CX25840_PIN_DVALID_PRGM0: > 64372f38 Maciej S. Szmigiero 2018-06-29 @468 if (p[i].flags & V4L2_SUBDEV_IO_PIN_DISABLE) > > V4L2_SUBDEV_IO_PIN_DISABLE is zero. It's sometimes used as a bit zero > BIT(V4L2_SUBDEV_IO_PIN_DISABLE) and presumably that's what is intended > here. Good catch, thanks. Before commit 4eb2f55728abbe ("media: v4l2-subdev: better document IO pin configuration flags") these identifiers were bit masks, now they are bit numbers. This wasn't caught in testing since the cxusb driver always passes zero as flags anyway. Maciej