Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752611Ab3GAGTf (ORCPT ); Mon, 1 Jul 2013 02:19:35 -0400 Received: from mail.parknet.co.jp ([210.171.160.6]:49246 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752446Ab3GAGTe (ORCPT ); Mon, 1 Jul 2013 02:19:34 -0400 From: OGAWA Hirofumi To: bintian.wang@linaro.org Cc: linux-kernel@vger.kernel.org, Mike Lockwood , dmitry pervushin , Colin Cross , Android Kernel Team , Andrew Morton , John Stultz Subject: Re: [PATCH RFC] Add FAT_IOCTL_GET_VOLUME_ID References: <1372646398-4204-1-git-send-email-bintian.wang@linaro.org> <87wqpakdvd.fsf@devron.myhome.or.jp> Date: Mon, 01 Jul 2013 15:19:31 +0900 In-Reply-To: <87wqpakdvd.fsf@devron.myhome.or.jp> (OGAWA Hirofumi's message of "Mon, 01 Jul 2013 15:12:22 +0900") Message-ID: <87sizykdjg.fsf@devron.myhome.or.jp> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1052 Lines: 29 OGAWA Hirofumi writes: >> + case FAT_IOCTL_GET_VOLUME_ID: >> + id = fat_ioctl_volume_id(inode); >> + return copy_to_user((unsigned int *)arg, &id, sizeof(id)); > >> + case FAT_IOCTL_GET_VOLUME_ID: >> + id = fat_ioctl_volume_id(inode); >> + return copy_to_user((unsigned int *)arg, &id, sizeof(id)); > > This pattern seems to from put_user(). > > Unnecessary cast of 1st arg. And copy_to_user() returns remaining bytes > when fail (not error code). Ah, actually, this needs cast, but it is to annotate for sparse. Well, is there any reason to restrict this only on the directory? For now, fat_generic_ioctl() looks easier way to do this. (fat_generic_ioctl() should work for the both of compat code and dir/file) Thanks. -- OGAWA Hirofumi -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/