Received: by 10.223.176.5 with SMTP id f5csp1991401wra; Wed, 31 Jan 2018 14:50:33 -0800 (PST) X-Google-Smtp-Source: AH8x226UlSwP3O+vffWmIwtOeqcDVQgXfrO3nW6Fg42IuwyYvSDNL/6ndq6y35yu+fehZr7bvlsN X-Received: by 10.99.189.82 with SMTP id d18mr25206028pgp.41.1517439033599; Wed, 31 Jan 2018 14:50:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517439033; cv=none; d=google.com; s=arc-20160816; b=S0uFbyuazQYXhvJ/LnlNE+IDTEo2lqjApRw7TbuYe85wal/lo9c1Mx53NlOR0pQ6KQ ehYEuI0fjms4loAC/KKS4YI1TXIewFnKGUHkzfQsqhvBNb9yqXcgJnOfldWXxBJGBZLi 3fuwP6cjPQUWDkiyergfmU9+2Htd/NgxLhFGOgF9ISrcGHWRDXLisCaTae6avZzww2Vp +sMobjyxBvgptBUm7rAu1rtiQXgS0wkHEYC1Quz6mB7Q5KyxHlKyjZ5obXp/gHg7BaYf g00QbXtpauZMUHs3WwzVT6iTsXARnGj2OfAucebBzbZmURb5a9Q32C6HgGHCi7FL2f4Y WyFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=bp9XW0FFXpbyxipO8ST8cPvFpLPLbjkjJKYt6vIgWXk=; b=hnkX+Sa+DOQT6J5O4RoYHYUiZ0C6RAOG7uUkerfXsGXLX2ja068j8EvfobCtFJ/caG Koi8fa58leah4cmHc3GxfcX7/NBJ794p5KSFwHLWs0F8xT7uAKIA2c/e4TeMDhDPGBjj I+3hCmOU8P+gbWP24PENPMdj/8BY1vOAefS1KzTMDAsFPCF45hgEWB8+Dl+7V6jvh9Vm sU6Cq/mAxw4+usnkZP7j5PeOC13MHEkTWICArc0++HRFZ+Wiag8uyuSh/WrRLUtdqaa1 W4MfLL7tQjJ8/gZLSMax87NC3BDY3VEhiw+1nQXk1yBYLTfHri7eQyllVEP7okw4GREQ k6Gg== 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 16si486657pfr.39.2018.01.31.14.50.19; Wed, 31 Jan 2018 14:50:33 -0800 (PST) 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 S1751914AbeAaWtx (ORCPT + 99 others); Wed, 31 Jan 2018 17:49:53 -0500 Received: from mga06.intel.com ([134.134.136.31]:58670 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751746AbeAaWtv (ORCPT ); Wed, 31 Jan 2018 17:49:51 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 14:49:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,441,1511856000"; d="scan'208";a="15997596" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga002.fm.intel.com with ESMTP; 31 Jan 2018 14:49:46 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1eh1IQ-000WBb-AE; Thu, 01 Feb 2018 06:56:02 +0800 Date: Thu, 1 Feb 2018 06:49:29 +0800 From: kbuild test robot To: Philipp Rossak Cc: kbuild-all@01.org, lee.jones@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@free-electrons.com, wens@csie.org, linux@armlinux.org.uk, jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, davem@davemloft.net, hans.verkuil@cisco.com, mchehab@kernel.org, rask@formelder.dk, clabbe.montjoie@gmail.com, sean@mess.org, krzk@kernel.org, quentin.schulz@free-electrons.com, icenowy@aosc.io, edu.molinas@gmail.com, singhalsimran0@gmail.com, linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: Re: [PATCH v2 07/16] iio: adc: sun4i-gpadc-iio: rework: support nvmem calibration data Message-ID: <201802010647.sYlui5vv%fengguang.wu@intel.com> References: <20180128232919.12639-8-embed3d@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180128232919.12639-8-embed3d@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Philipp, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on robh/for-next] [also build test WARNING on v4.15 next-20180126] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Philipp-Rossak/IIO-based-thermal-sensor-driver-for-Allwinner-H3-and-A83T-SoC/20180201-043415 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) >> drivers/iio/adc/sun4i-gpadc-iio.c:608:53: sparse: cast to restricted __be32 >> drivers/iio/adc/sun4i-gpadc-iio.c:608:53: sparse: cast to restricted __be32 >> drivers/iio/adc/sun4i-gpadc-iio.c:608:53: sparse: cast to restricted __be32 >> drivers/iio/adc/sun4i-gpadc-iio.c:608:53: sparse: cast to restricted __be32 >> drivers/iio/adc/sun4i-gpadc-iio.c:608:53: sparse: cast to restricted __be32 >> drivers/iio/adc/sun4i-gpadc-iio.c:608:53: sparse: cast to restricted __be32 drivers/iio/adc/sun4i-gpadc-iio.c:613:53: sparse: cast to restricted __be32 drivers/iio/adc/sun4i-gpadc-iio.c:613:53: sparse: cast to restricted __be32 drivers/iio/adc/sun4i-gpadc-iio.c:613:53: sparse: cast to restricted __be32 drivers/iio/adc/sun4i-gpadc-iio.c:613:53: sparse: cast to restricted __be32 drivers/iio/adc/sun4i-gpadc-iio.c:613:53: sparse: cast to restricted __be32 drivers/iio/adc/sun4i-gpadc-iio.c:613:53: sparse: cast to restricted __be32 vim +608 drivers/iio/adc/sun4i-gpadc-iio.c 564 565 static int sun4i_gpadc_probe_dt(struct platform_device *pdev, 566 struct iio_dev *indio_dev) 567 { 568 struct sun4i_gpadc_iio *info = iio_priv(indio_dev); 569 struct resource *mem; 570 void __iomem *base; 571 int ret; 572 struct nvmem_cell *cell; 573 ssize_t cell_size; 574 u64 *cell_data; 575 576 info->data = of_device_get_match_data(&pdev->dev); 577 if (!info->data) 578 return -ENODEV; 579 580 info->no_irq = true; 581 indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels); 582 indio_dev->channels = sun8i_a33_gpadc_channels; 583 584 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 585 base = devm_ioremap_resource(&pdev->dev, mem); 586 if (IS_ERR(base)) 587 return PTR_ERR(base); 588 589 info->has_calibration_data[0] = false; 590 info->has_calibration_data[1] = false; 591 592 if (!info->data->supports_nvmem) 593 goto no_nvmem; 594 595 cell = nvmem_cell_get(&pdev->dev, "calibration"); 596 if (IS_ERR(cell)) { 597 if (PTR_ERR(cell) == -EPROBE_DEFER) 598 return PTR_ERR(cell); 599 goto no_nvmem; 600 } 601 602 cell_data = (u64 *)nvmem_cell_read(cell, &cell_size); 603 nvmem_cell_put(cell); 604 switch (cell_size) { 605 case 8: 606 case 6: 607 info->has_calibration_data[1] = true; > 608 info->calibration_data[1] = be32_to_cpu( 609 upper_32_bits(cell_data[0])); 610 case 4: 611 case 2: 612 info->has_calibration_data[0] = true; 613 info->calibration_data[0] = be32_to_cpu( 614 lower_32_bits(cell_data[0])); 615 break; 616 default: 617 break; 618 } 619 620 no_nvmem: 621 622 info->regmap = devm_regmap_init_mmio(&pdev->dev, base, 623 &sun4i_gpadc_regmap_config); 624 if (IS_ERR(info->regmap)) { 625 ret = PTR_ERR(info->regmap); 626 dev_err(&pdev->dev, "failed to init regmap: %d\n", ret); 627 return ret; 628 } 629 630 if (info->data->has_bus_rst) { 631 info->reset = devm_reset_control_get(&pdev->dev, NULL); 632 if (IS_ERR(info->reset)) { 633 ret = PTR_ERR(info->reset); 634 return ret; 635 } 636 637 ret = reset_control_deassert(info->reset); 638 if (ret) 639 return ret; 640 } 641 642 if (info->data->has_bus_clk) { 643 info->bus_clk = devm_clk_get(&pdev->dev, "bus"); 644 if (IS_ERR(info->bus_clk)) { 645 ret = PTR_ERR(info->bus_clk); 646 goto assert_reset; 647 } 648 649 ret = clk_prepare_enable(info->bus_clk); 650 if (ret) 651 goto assert_reset; 652 } 653 654 if (info->data->has_mod_clk) { 655 info->mod_clk = devm_clk_get(&pdev->dev, "mod"); 656 if (IS_ERR(info->mod_clk)) { 657 ret = PTR_ERR(info->mod_clk); 658 goto disable_bus_clk; 659 } 660 661 /* Running at 6MHz */ 662 ret = clk_set_rate(info->mod_clk, 4000000); 663 if (ret) 664 goto disable_bus_clk; 665 666 ret = clk_prepare_enable(info->mod_clk); 667 if (ret) 668 goto disable_bus_clk; 669 } 670 671 if (IS_ENABLED(CONFIG_THERMAL_OF)) 672 info->sensor_device = &pdev->dev; 673 674 return 0; 675 676 disable_bus_clk: 677 clk_disable_unprepare(info->bus_clk); 678 679 assert_reset: 680 reset_control_assert(info->reset); 681 682 return ret; 683 } 684 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation