Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2198951imm; Sat, 16 Jun 2018 11:47:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ7mj2sEDWK+kS2wcE0hbatnjBf6Vtsok5FwlxhJ0CuhZjJtB8tzAUeDbe/ITTt+4FxyC49 X-Received: by 2002:a17:902:301:: with SMTP id 1-v6mr7464181pld.127.1529174859434; Sat, 16 Jun 2018 11:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529174859; cv=none; d=google.com; s=arc-20160816; b=Dfbu/vT1aeJYgVW0jcw3eoMAqy39smFyIli//4oFUPRGwg0jEWYFg/F3VmsKbfLRQQ M4KziW1v8viO/dpvhEB9Ugv+RazAPsNQ6Wky/JfSwzg4zgcnPTCdAWH3ErtDYwXTMaoj x+ogyYOHto3mxTS9qJdLYglb0n6sFcLFw/Se1O8tnMRAKNdz8HW5BM8RflvyB3PwjWg2 ofGSG+hVP2SKCEYscYomRzG52gKVwGbRWm1dBfOH4BoQ6KVLd8MxaL9jpHxbNCgQCU8I wWMjtnsi4rVNZyr4aHRcNxtHqeAWCXqt4nftIDCgcfYUO3qjwA9+woGLNbr9+Sm9Oyk6 hwKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=BZUQNSgyTknAdPpmJSnNpI1XMw395wDvZJTrQqGEI10=; b=nlRuLuZXrPRWjjBphuK7/yBNkmlyP7DGIBVFbD2z/ChQvX3d7BMIYhULOVdh34xp/7 7xJPQIJgQpkPOLJnmBbpDcEWCzgolLoaoYhZENGc2chgMM3bZiYmqXRpf+EKHi/8VdYv P9AC7BojSh6zkplnqEhXmRp6vudM8g+tlKovdHSK3LE9A5bLNLt5CqxE+eQwgCzn+XxD BVxxs3MC8HAXSiAaWUrZiqgNZ2M19R6I8LWbaZTXp7wtHgRSBgOqH8tQg6YsvH8dDKr4 ou/a7oMK+oq/y+bdFiB3SPS/u0H5g/aQ/n8wop/Uyi19TRmqEShP1rh6yDch5qTAnPpY gA8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DTXodPtl; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 89-v6si11353016plc.59.2018.06.16.11.47.24; Sat, 16 Jun 2018 11:47:39 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DTXodPtl; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932921AbeFPSpv (ORCPT + 99 others); Sat, 16 Jun 2018 14:45:51 -0400 Received: from mail-vk0-f67.google.com ([209.85.213.67]:37115 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932482AbeFPSpt (ORCPT ); Sat, 16 Jun 2018 14:45:49 -0400 Received: by mail-vk0-f67.google.com with SMTP id w8-v6so7441772vkh.4; Sat, 16 Jun 2018 11:45:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BZUQNSgyTknAdPpmJSnNpI1XMw395wDvZJTrQqGEI10=; b=DTXodPtlASjuXajB26X/BG567W2UeuNglUggVj7ipotwgVesO7v7YfqkBSSHepuZym YtWTCzA3ECcQ9Qomcq0RlxwY8tTlfkL2rj2ja+6KKWhE+gHu860VuMwciFGF/JNmzGaw IfEkgGyZU7nA02mwlzgzIEDYWWn2KDPw3v22TOlB8+VwdXzFrzc1z3UrincyHPDLtEjZ W5ijzCvUzhP7KZc/e+pgXgiqLumR89Z4TtwMXRifoUvKrY9mIBM2IUgtd9f3WVAmCe7a v/LUlJsnZ22O/nn4SkUYdgjjCQX7oljeZsmnBmMyDQLVVEIZrtkU1Xd1SBMaQgDRn+7G Ne/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BZUQNSgyTknAdPpmJSnNpI1XMw395wDvZJTrQqGEI10=; b=nUH0J7va1PfHESrO4vEHz+nwEd/epDhHYn7YXYcdr8N6PclUzD6vWRlBaKN86nR/ad JtW/P3G1nR7mv+SxCzOPWJzPFdoxqvunjOSE8tpN6S18uP8lHwmxQqOfSrT1+vrm2RP1 D4L649oEgF9QSfOYdUw40nJIKUmbss9NK/KoH2aF/gaReGBfUPUy/gbHCRRYX4iWlfRS oc4FziK80geLqbrzXpIhBhBBKSPO8Zuci3zK9idmnBA2xjCsjt4vnJjwFdKv5j5Ca3oD lpsNlxkXvoS7C3OT911yLCPPCaedYCbauOZlpvbClQnHYptR+MZ+BZA6PWLrzEeYqes+ o34g== X-Gm-Message-State: APt69E1I4X9Tm00tIpN6VqrrUqAxppBCRTWJoxnuB/b2hZraLgoLVvlm z89QAc6PnR+BPam+Gf5XCdMprbsqqflnKXICSL8= X-Received: by 2002:a1f:860b:: with SMTP id i11-v6mr3729552vkd.15.1529174748024; Sat, 16 Jun 2018 11:45:48 -0700 (PDT) MIME-Version: 1.0 References: <20180615132017.23889-1-andriy.shevchenko@linux.intel.com> <20180615132017.23889-6-andriy.shevchenko@linux.intel.com> <20180615214231.GA371@yury-thinkpad> In-Reply-To: <20180615214231.GA371@yury-thinkpad> From: Andy Shevchenko Date: Sat, 16 Jun 2018 21:45:37 +0300 Message-ID: Subject: Re: [PATCH v2 5/5] Input: evdev - Switch to bitmap_zalloc() To: Yury Norov Cc: Andy Shevchenko , agk@redhat.com, Mike Snitzer , dm-devel@redhat.com, shli@kernel.org, linux-raid@vger.kernel.org, Dmitry Torokhov , linux-input , Andrew Morton , Linux Kernel Mailing List , Mika Westerberg Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 16, 2018 at 12:46 AM Yury Norov wrote: > On Fri, Jun 15, 2018 at 04:20:17PM +0300, Andy Shevchenko wrote: > > Switch to bitmap_zalloc() to show clearly what we are allocating. > > Besides that it returns pointer of bitmap type instead of opaque void *. > > + mem = bitmap_alloc(maxbit, GFP_KERNEL); > > if (!mem) > > return -ENOMEM; > > But in commit message you say you switch to bitmap_zalloc(). IIUC > bitmap_alloc() is OK here. But could you please update comment to > avoid confusing. There are two places, one with alloc, another with zalloc. I will clarify this in commit message of next version. > > + mask = bitmap_zalloc(cnt, GFP_KERNEL); > > if (!mask) > > return -ENOMEM; > > > > error = bits_from_user(mask, cnt - 1, codes_size, codes, compat); > > If my understanding of bits_from_user() correct, here you can also use > bitmap_alloc(), true? While it might be true, it's a material for separate change. Original code uses zalloc version. -- With Best Regards, Andy Shevchenko