From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754279AbaIAOOD (ORCPT ); Mon, 1 Sep 2014 10:14:03 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:46272 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754258AbaIAOOA (ORCPT ); Mon, 1 Sep 2014 10:14:00 -0400 MIME-Version: 1.0 In-Reply-To: <54047A96.1090900@codethink.co.uk> References: <54047A96.1090900@codethink.co.uk> Date: Mon, 1 Sep 2014 17:13:58 +0300 Message-ID: Subject: Re: [PATCH] fs: replace int param with size_t for seq_open_private() From: Alexey Dobriyan To: Rob Jones Cc: Linux Kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 1, 2014 at 4:54 PM, Rob Jones wrote: > > > On 01/09/14 14:43, Alexey Dobriyan wrote: >>> >>> void *__seq_open_private(struct file *f, const struct seq_operations >>> *ops, >>> - int psize) >>> + size_t psize) >> >> >> It should be "unsigned int" at most. >> As almost all in-kernel lengths. > I don't agree. Ultimately this parameter ends up as a parameter to > kmalloc where it is expected to be a size_t. Which is a mistake too because allocations are never that large. Save REX prefix, keep length unsigned int! Alexey