Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp183004pxj; Thu, 3 Jun 2021 04:13:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY3KWEupLbv5u3SAa1YxisMUO4jeS5xAXdghn4W05RmcaeI4fAAcfpf2ZBE0pKh91PHbSr X-Received: by 2002:a17:906:1814:: with SMTP id v20mr34426999eje.152.1622718783249; Thu, 03 Jun 2021 04:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622718783; cv=none; d=google.com; s=arc-20160816; b=jigSNJayeqx3mAZrjV5cH/jvBwvhcl1J4wzY0RVLsn0uKA0vQOcepf356E208ywDTE sYZQLbe4lNc2GxOzySWPv2UTbexqCMGAXJ2qW1q6neD+tT5rOE1eiw8BJe9p6ZH+dVPG x9JF+C2tzXlTC0z/M5rna56h8ve1d+gFhIHimql5VdT8GDgXVEuNLrf2yJ4b6sTHdnmy ojSLt0rhTuYOaBFWgfLN4ADE/3/Pu5/jXR8AL01BGCVQoD3KMa/AvIvWU5Yr07EUtJGc 3OdFQI8YXa4wirXQIKSQhvWsuQ8rRGsdSEVaeSOp5A5QPNa7J+42tk0B8aHvf+qoNW1Z eHpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:ironport-sdr :ironport-sdr; bh=2HXBm/nwPVXzvrPe+xYufTeXi2ljzz9YfZaVpuJ9+r8=; b=Y7qwdCwn896ARTwk+yxenwyq63pSNvP1qZzcnSu4y4HGTL52n9qJdfU+K8kSLbgw7W I3VmksRHtfrM8xvIQBBP6VaCgFVWh/o/Z17KbeRj2LaoPG2CGb4Is8eKYuqpdRJV5Yvi 6HYKxIZSVwz8nHAHZ9y4gFaEvcN0mk5CzBQdpBsE1Wo4FIKNbaa5rOz895j5enmyxep3 Wo83oBjWr5zp2cyiSr7P/rwk7kKSpBGlbQiw/wvxBSFpzQvbZ2nQ1mhiGc/aGAJ6FSVd wzFDwC8eF9QmlFrLsWC4PiUIMGJ4oiQqvY/rwQ0NlWY+v7vhshfq1xztX7rvye7VILCh ibFg== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s26si2047443ejm.620.2021.06.03.04.12.40; Thu, 03 Jun 2021 04:13:03 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229727AbhFCLNJ (ORCPT + 99 others); Thu, 3 Jun 2021 07:13:09 -0400 Received: from mga03.intel.com ([134.134.136.65]:26576 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229610AbhFCLNI (ORCPT ); Thu, 3 Jun 2021 07:13:08 -0400 IronPort-SDR: vNg28/ip/G43+6kh6UYUFXJKdJTDNNPcPcSFzN9bAT73JiUSTgsoDJcVBS1wN442HBPTp56PzP xPE35raec03w== X-IronPort-AV: E=McAfee;i="6200,9189,10003"; a="204047633" X-IronPort-AV: E=Sophos;i="5.83,244,1616482800"; d="scan'208";a="204047633" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2021 04:11:23 -0700 IronPort-SDR: PqLkvmgHoSQZTIMomFXawdAh4ehjRskKlmP28f9WI53WczWHVKVx8rIiQ/b1LkhhomsAXyyrN5 zvKaERFaAINw== X-IronPort-AV: E=Sophos;i="5.83,244,1616482800"; d="scan'208";a="400397127" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2021 04:11:20 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lolFs-00GvSf-QM; Thu, 03 Jun 2021 14:11:16 +0300 Date: Thu, 3 Jun 2021 14:11:16 +0300 From: Andy Shevchenko To: "tiantao (H)" Cc: Tian Tao , gregkh@linuxfoundation.org, rafael@kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, jonathan.cameron@huawei.com, song.bao.hua@hisilicon.com, Randy Dunlap , Stefano Brivio , Alexander Gordeev , "Ma, Jianpeng" , Yury Norov , Valentin Schneider , Peter Zijlstra , Daniel Bristot de Oliveira Subject: Re: [PATCH v3 1/3] lib: bitmap: introduce bitmap_print_to_buf Message-ID: References: <1622712162-7028-1-git-send-email-tiantao6@hisilicon.com> <1622712162-7028-2-git-send-email-tiantao6@hisilicon.com> <95f5e01d-79c1-28f3-f27b-bee4398308de@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <95f5e01d-79c1-28f3-f27b-bee4398308de@huawei.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 03, 2021 at 06:33:25PM +0800, tiantao (H) wrote: > 在 2021/6/3 17:50, Andy Shevchenko 写道: > > On Thu, Jun 03, 2021 at 05:22:40PM +0800, Tian Tao wrote: > > > New API bitmap_print_to_buf() with bin_attribute to avoid maskp > > > exceeding PAGE_SIZE. bitmap_print_to_pagebuf() is a special case > > > of bitmap_print_to_buf(), so in bitmap_print_to_pagebuf() call > > > bitmap_print_to_buf(). ... > > > + * @count: the maximum number of bytes to print > > > + size = memory_read_from_buffer(buf, count, &off, data, strlen(data) + 1); > > Are you sure you have put parameters in the correct order? > > yes, I already test it. > > ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, >                                 const void *from, size_t available) Have you read the meaning of count and available? Please, double check that they are filled with correct values. > > I guess you have to provide the test case(s). -- With Best Regards, Andy Shevchenko