Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4463763ioa; Wed, 27 Apr 2022 04:33:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz77vKhU+skqWKQU7KXAjUZG7uq3nJpB/56gOKzykYWDB0racS+3fGMr4LTOMQLsCZYbvaV X-Received: by 2002:aa7:962e:0:b0:50d:5ed8:aa23 with SMTP id r14-20020aa7962e000000b0050d5ed8aa23mr7383549pfg.43.1651059229345; Wed, 27 Apr 2022 04:33:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651059229; cv=none; d=google.com; s=arc-20160816; b=R4WbY8AnccbGM2ZVdaP/JZ1w+5SwFE9nTl2xaUQAUGs4CjdEYa0s0LhiSz5pem1Onc PkjUN6TNmXf3eflkK0my6VD7UP9xtVC2Uc9xD9/3tFUeH7hJKTvlGtWG4OPIsIe4GPw8 cYiwDi3LxFoHW8s2pSwz6L1ZFqGM1JnpWIHBjOsE6JRlnAe+L+hgQFGsSvumyGAWC6ON wfnx0WOqU1wMoPEoeSTeVySqpAm310sfMvZaDk3Cxm2id+PHdId5BiGyaDFxGtheXjV3 sVyhn8JEa5EPUKPEDNArR/aVHevBvqJtfkicLFAraZAMYYGfeDrw9nWSGW6iDjjeWol0 7I5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YFRxO/r5+25A3ri2yhfDFSr+8xdRCcRJYthCA85JqcQ=; b=zgGO8DS2iDDU0eBdzvydfJzntRC2IPHIfYjOC9on7MIz14zG0HgV6UIPGadCS3U9gA Wjj0lgZiDq/y+pm5WGwFyIlZwbTnBDUN1tehHIcovgdhc733vUuQR8SrMXCjd2K/6pW+ 8OcHeOrpG6NZjZQzk4llRVGA3CRdG+6b9y3RYVI8l4tKMt71eeeWCbqk9zqfDE0upyJR FtXVOprnCaY//4KDn5PhVLUzWs1OPFizDyeMlfPLJq226dN82U0A9UHBJa0npnQI5HJf GYKZWXcgKA4Ke25/2YSYCaXxgMwmKvr4UZ/JX9ddnCp6uY9JNEARVlrEciBYvpUfU/SF TgRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="K1Q2UxF/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nu8-20020a17090b1b0800b001d92f594d3bsi1792502pjb.86.2022.04.27.04.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 04:33:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="K1Q2UxF/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0897848AA62; Wed, 27 Apr 2022 03:22:02 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357340AbiD0DEi (ORCPT + 99 others); Tue, 26 Apr 2022 23:04:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357339AbiD0DEg (ORCPT ); Tue, 26 Apr 2022 23:04:36 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6289635A85; Tue, 26 Apr 2022 20:01:26 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id e24so325869pjt.2; Tue, 26 Apr 2022 20:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YFRxO/r5+25A3ri2yhfDFSr+8xdRCcRJYthCA85JqcQ=; b=K1Q2UxF/3GoOvh7IcM7PMhrYYxuk/fttGjz5MOklYiQT+XKXcUyvBefte56ClIFBvB 74qaaxun4xBECJrwYtU+rpfozcIaiW7K3sm0s/3rcmqItySScz4mV/dK8Z1dbfIQJK03 6qB7v2jvah5TcSa/70kLVzHACv4IoabG3Pt2rRJikhLkym9iSGtba5v5TmhadOTHQuXH d/1Fk3XEWrMsAw+l6Yofn3wrWdc/JeIUtw77a7woKYJ3+PS75DxlaHlerviDpHEbfA1S VkxSoKe2bls6tV8OumP9a+Wh2Icp3Xp0olQ+531BAGdifF+IyLmuqU9tq3cA3fh/EWJj ybMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=YFRxO/r5+25A3ri2yhfDFSr+8xdRCcRJYthCA85JqcQ=; b=5l4SZiTPkU2u22+mM9uyHfDrCCWR9i69OoiLypgnrQIdhoOFpISYHTys2UtcUT6oiF 2jePV4ZmA++IogHYhgaF51rYWDuf5lVYwZ5r7tJFyvgyo3uqyO6Xu5fW4Jv5z4sdnkbn DX8NEP/Czlx5eRNSOHPxgZt3J2meO/rLYOboBE/R+MytrugbEtfCHF/fJ/hw2AFBCDt0 vKe9Qwl+FmL0bkpjB0sA6MzkWuAeG9rY3WJED9c8uyR+Slqx0b4Z2tAAUGsXmlNutGlo P1IMUrDNzjJVFi9fqNTWF9fzmNdzWWJcz+95YqpKnMAnwGCJ3HyeyoSn5WYS8TtsWRrd IHiQ== X-Gm-Message-State: AOAM532E4MSLu30LmcUdgD/ahIjWLseky5Rj2d4n4vBSeKof5XqfAEQ5 h+ekGiAde+leDdDnIzbWXZA= X-Received: by 2002:a17:902:8547:b0:15c:f02f:cd0b with SMTP id d7-20020a170902854700b0015cf02fcd0bmr18672461plo.117.1651028485671; Tue, 26 Apr 2022 20:01:25 -0700 (PDT) Received: from jagath-PC ([27.7.30.122]) by smtp.gmail.com with ESMTPSA id g15-20020a056a0023cf00b004e17e11cb17sm18438245pfc.111.2022.04.26.20.01.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Apr 2022 20:01:25 -0700 (PDT) Date: Wed, 27 Apr 2022 08:31:21 +0530 From: Jagath Jog J To: Jonathan Cameron Cc: kernel test robot , dan@dlrobertson.com, andy.shevchenko@gmail.com, llvm@lists.linux.dev, kbuild-all@lists.01.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 9/9] iio: accel: bma400: Add support for activity and inactivity events Message-ID: <20220427030119.GA31584@jagath-PC> References: <20220420211105.14654-10-jagathjog1996@gmail.com> <202204211211.febbJ6fy-lkp@intel.com> <20220424172002.7dd48dfa@jic23-huawei> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220424172002.7dd48dfa@jic23-huawei> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no 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 Hello Jonathan, On Sun, Apr 24, 2022 at 05:20:02PM +0100, Jonathan Cameron wrote: > On Thu, 21 Apr 2022 14:45:05 +0800 > kernel test robot wrote: > > > Hi Jagath, > > > > Thank you for the patch! Perhaps something to improve: > > > > [auto build test WARNING on jic23-iio/togreg] > > [also build test WARNING on linus/master v5.18-rc3 next-20220420] > > [cannot apply to linux/master] > > [If your patch is applied to the wrong git tree, kindly drop us a note. > > And when submitting patch, we suggest to use '--base' as documented in > > https://git-scm.com/docs/git-format-patch] > > > > url: https://github.com/intel-lab-lkp/linux/commits/Jagath-Jog-J/iio-accel-bma400-Add-buffer-step-and-activity-inactivity/20220421-051244 > > base: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git togreg > > config: mips-randconfig-r031-20220420 (https://download.01.org/0day-ci/archive/20220421/202204211211.febbJ6fy-lkp@intel.com/config) > > compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project bac6cd5bf85669e3376610cfc4c4f9ca015e7b9b) > > reproduce (this is a W=1 build): > > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # install mips cross compiling tool for clang build > > # apt-get install binutils-mips-linux-gnu > > # https://github.com/intel-lab-lkp/linux/commit/b33d9910aa7588ec8db7c1694dbc03c3ed200ebb > > git remote add linux-review https://github.com/intel-lab-lkp/linux > > git fetch --no-tags linux-review Jagath-Jog-J/iio-accel-bma400-Add-buffer-step-and-activity-inactivity/20220421-051244 > > git checkout b33d9910aa7588ec8db7c1694dbc03c3ed200ebb > > # save the config file > > mkdir build_dir && cp config build_dir/.config > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/iio/accel/ > > > > If you fix the issue, kindly add following tag as appropriate > > Reported-by: kernel test robot > > > > All warnings (new ones prefixed by >>): > > > > >> drivers/iio/accel/bma400_core.c:1047:17: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((msk), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsigned short)0, short: (unsigned short)0, unsigned int: (unsigned int)0, int: (unsigned int)0, unsigned long: (unsigned long)0, long: (unsigned long)0, unsigned long long: (unsigned long long)0, long long: (unsigned long long)0, default: (msk)))' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare] > > field_value = FIELD_PREP(msk, state); > > ^~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:114:3: note: expanded from macro 'FIELD_PREP' > > __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:71:53: note: expanded from macro '__BF_FIELD_CHECK' > > BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \ > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ > > include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG' > > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ > > include/linux/compiler_types.h:352:22: note: expanded from macro 'compiletime_assert' > > _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > > ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler_types.h:340:23: note: expanded from macro '_compiletime_assert' > > __compiletime_assert(condition, msg, prefix, suffix) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler_types.h:332:9: note: expanded from macro '__compiletime_assert' > > if (!(condition)) \ > > ^~~~~~~~~ > > drivers/iio/accel/bma400_core.c:1053:17: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((msk), char: (unsigned char)0, unsigned char: (unsigned char)0, signed char: (unsigned char)0, unsigned short: (unsigned short)0, short: (unsigned short)0, unsigned int: (unsigned int)0, int: (unsigned int)0, unsigned long: (unsigned long)0, long: (unsigned long)0, unsigned long long: (unsigned long long)0, long long: (unsigned long long)0, default: (msk)))' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare] > > field_value = FIELD_PREP(msk, state); > > ^~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:114:3: note: expanded from macro 'FIELD_PREP' > > __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ > > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/bitfield.h:71:53: note: expanded from macro '__BF_FIELD_CHECK' > > BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \ > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ > > include/linux/build_bug.h:39:58: note: expanded from macro 'BUILD_BUG_ON_MSG' > > #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ > > include/linux/compiler_types.h:352:22: note: expanded from macro 'compiletime_assert' > > _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) > > ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler_types.h:340:23: note: expanded from macro '_compiletime_assert' > > __compiletime_assert(condition, msg, prefix, suffix) > > ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > include/linux/compiler_types.h:332:9: note: expanded from macro '__compiletime_assert' > > if (!(condition)) \ > > ^~~~~~~~~ > > 2 warnings generated. > > > > > > vim +1047 drivers/iio/accel/bma400_core.c > > > > 1035 > > 1036 static int bma400_activity_event_en(struct bma400_data *data, > > 1037 enum iio_event_direction dir, > > 1038 int state) > > 1039 { > > 1040 int ret, reg, msk, value, field_value; > > 1041 > > 1042 switch (dir) { > > 1043 case IIO_EV_DIR_RISING: > > 1044 reg = BMA400_GEN1INT_CONFIG0; > > 1045 msk = BMA400_INT_GEN1_MSK; > > 1046 value = 2; > > > 1047 field_value = FIELD_PREP(msk, state); > > Ah. Will need to clamp state to 0/1 > > field_value = FIELD_PREP(msk, state ? 1 : 0); > perhaps? For this also compiler shows warning. To compile for mips I used COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash drivers/iio/accel/ ../drivers/iio/accel/bma400_core.c:1047:17: warning: result of comparison of constant 18446744073709551615 with expression of type 'typeof (_Generic((msk)... field_value = FIELD_PREP(msk, state ? 1 : 0); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../include/linux/bitfield.h:114:3: note: expanded from macro 'FIELD_PREP' __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ To avoid warning can I do like this field_value = FIELD_PREP(BMA400_INT_GEN1_MSK, state); > > > 1048 break; > > 1049 case IIO_EV_DIR_FALLING: > > 1050 reg = BMA400_GEN2INT_CONFIG0; > > 1051 msk = BMA400_INT_GEN2_MSK; > > 1052 value = 0; > > 1053 field_value = FIELD_PREP(msk, state); > > 1054 break; > > 1055 default: > > 1056 return -EINVAL; > > 1057 } > > 1058 > > 1059 /* Enabling all axis for interrupt evaluation */ > > 1060 ret = regmap_write(data->regmap, reg, 0xF8); > > 1061 if (ret) > > 1062 return ret; > > 1063 > > 1064 /* OR combination of all axis for interrupt evaluation */ > > 1065 ret = regmap_write(data->regmap, reg + BMA400_GEN_CONFIG1_OFF, value); > > 1066 if (ret) > > 1067 return ret; > > 1068 > > 1069 /* Initial value to avoid interrupts while enabling*/ > > 1070 ret = regmap_write(data->regmap, reg + BMA400_GEN_CONFIG2_OFF, 0x0A); > > 1071 if (ret) > > 1072 return ret; > > 1073 > > 1074 /* Initial duration value to avoid interrupts while enabling*/ > > 1075 ret = regmap_write(data->regmap, reg + BMA400_GEN_CONFIG31_OFF, 0x0F); > > 1076 if (ret) > > 1077 return ret; > > 1078 > > 1079 ret = regmap_update_bits(data->regmap, BMA400_INT1_MAP_REG, msk, > > 1080 field_value); > > 1081 if (ret) > > 1082 return ret; > > 1083 > > 1084 ret = regmap_update_bits(data->regmap, BMA400_INT_CONFIG0_REG, msk, > > 1085 field_value); > > 1086 if (ret) > > 1087 return ret; > > 1088 > > 1089 set_mask_bits(&data->generic_event_en, msk, field_value); > > 1090 return 0; > > 1091 } > > 1092 > > > Thank you, Jagath