Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E65927EA for ; Mon, 24 Apr 2023 14:56:59 +0000 (UTC) Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-5067736607fso7869633a12.0 for ; Mon, 24 Apr 2023 07:56:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682348218; x=1684940218; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TyC3Am9x5MDVCnozv7oRC741HUNVYU534Al0Yoe0eTc=; b=IIPTUf5IBUBU+Edya4d4mMv5fiLcs2rvu6zqLp9FGrq7ekNjKOLsialN5g5YCi7iaW GnBXBGOXMXv9ltzpNUfXrp1uII7kbw/K79oIQHHvv8swu5gQRo7ZtbIt658QY1doi6iH AzWU2/3ltjC/lZgMN+KplAU2Kg+IMos8XGzfNx2oNyacC+orYuJ24VXEa+U+T3KAiVp0 inkAZyS1niNOmGKFY1ccfqDu8ALNIrGx9Ba6lK0QrlBF6WUm5pQP1vu791nGg7WONFgI bK0lpYgaE9Va73Pn7JfQcjGjjuCtAn9LgCBXpQAy0pk+/GnK6/JDSKtDAll17IX1lgQG eO6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682348218; x=1684940218; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TyC3Am9x5MDVCnozv7oRC741HUNVYU534Al0Yoe0eTc=; b=dNzZIrF31PVKOmX2vepKKMW0C4lmZxlAS/OdmuIn/KGjNkewrte0ti4hdLFw4+6gVX qj1gkENEb6hCJ4wgBKxd5Nie64waSIjcY7GmxjAuUQKQkWdBDE/F8tHhkT0Gb5Cplj/e 9onKI0t/2i+FZozVZ4DAev9J+va5tb3Kzugqa2p6PY5XNsYfmdcFrB/CA0YqDhDkx6nG UngZHTTZbCBzvEg0TMiyscXpfzBfwYZjzaEaZgU7zETjRfUWxIO/jxhvqrmW8l7mZWea DZVQC1M2ZZkftvlneRFsuH8jlPpUgk3jHPu/ObCezaixhckTYkfJGlg5sAgXENL0X4Kl K2Dw== X-Gm-Message-State: AAQBX9ce86GWkgCY5B7XdDjrlgVkEQKqSc9ZLV6h27YmonFdZp0D5ESm 7Wz05YlL+pt4aMQFm+TUd+Z6HAkaCDU= X-Google-Smtp-Source: AKy350a/LImqzZ6R1/1wrYIpJ7JiPYKyuWkBcDJnveIXXJw7GmdTiya9frX0wCcxKxk1BCOyxIdfmw== X-Received: by 2002:aa7:c902:0:b0:506:c20c:6de8 with SMTP id b2-20020aa7c902000000b00506c20c6de8mr11983389edt.17.1682348218038; Mon, 24 Apr 2023 07:56:58 -0700 (PDT) Received: from carbian ([2a02:8109:aa3f:ead8::5908]) by smtp.gmail.com with ESMTPSA id p19-20020a05640210d300b005067d089aafsm4698705edu.11.2023.04.24.07.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 07:56:57 -0700 (PDT) Date: Mon, 24 Apr 2023 16:56:55 +0200 From: Mehdi Djait To: Andy Shevchenko Cc: kernel test robot , jic23@kernel.org, mazziesaccount@gmail.com, oe-kbuild-all@lists.linux.dev, krzysztof.kozlowski+dt@linaro.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 5/5] iio: accel: Add support for Kionix/ROHM KX132-1211 accelerometer Message-ID: References: <202304220729.FCofPRvH-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hello again, On Sun, Apr 23, 2023 at 10:57:00PM +0200, Mehdi Djait wrote: > Hello Andy, > > thank you for the review. > > On Sat, Apr 22, 2023 at 07:09:12PM +0300, Andy Shevchenko wrote: > > On Sat, Apr 22, 2023 at 07:19:44AM +0800, kernel test robot wrote: > > > Hi Mehdi, > > > > > > kernel test robot noticed the following build warnings: > > > > I believe it's not just a warning, it's a full functional error in the code. > > > > > 686 { > > > 687 struct device *dev = regmap_get_device(data->regmap); > > > 688 __le16 buf_status; > > > 689 int ret, fifo_bytes; > > > 690 > > > 691 ret = regmap_bulk_read(data->regmap, data->chip_info->buf_status1, > > > 692 &buf_status, sizeof(buf_status)); > > > 693 if (ret) { > > > 694 dev_err(dev, "Error reading buffer status\n"); > > > 695 return ret; > > > 696 } > > > 697 > > > > 698 buf_status &= data->chip_info->buf_smp_lvl_mask; > > > 699 fifo_bytes = le16_to_cpu(buf_status); > > > > You need to mask in the same endianess space, i.o.w. either on CPU or device side. > > > > I believe you wanted to have fifo_bytes to be masked, but I'm not sure. > > I wanted to read the registers buf_status_1 and buf_status_2 --> 16 bits > and mask the result of the read to get the bits 0..9 which is the > buf_status: the number of bytes in the buffer > > This is due to my lack of experience, but I have a question: > If I don't get any warnings when testing, how should I go about this ? I > will obviously fix this, but this is for the future. just ignore this question. I installed sparse and I am using it now when building. -- Kind Regards Mehdi Djait