From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:58068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsLls-0001Vo-2W for qemu-devel@nongnu.org; Mon, 07 Jan 2013 18:06:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsLlp-000529-PV for qemu-devel@nongnu.org; Mon, 07 Jan 2013 18:06:20 -0500 Received: from mail-oa0-f42.google.com ([209.85.219.42]:39775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsLlp-00051A-JB for qemu-devel@nongnu.org; Mon, 07 Jan 2013 18:06:17 -0500 Received: by mail-oa0-f42.google.com with SMTP id j1so18898835oag.29 for ; Mon, 07 Jan 2013 15:06:17 -0800 (PST) Sender: Richard Henderson Message-ID: <50EB54E5.9040307@twiddle.net> Date: Mon, 07 Jan 2013 15:06:13 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1357597486-19395-1-git-send-email-laurent@vivier.eu> In-Reply-To: <1357597486-19395-1-git-send-email-laurent@vivier.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] linux-user, alpha: l_type of fcntl() flock differs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: Riku Voipio , qemu-devel@nongnu.org, dillona@dillona.com On 01/07/2013 02:24 PM, Laurent Vivier wrote: > +static short target_to_host_flock_type(short type) > +{ > + switch (type) { > + case TARGET_F_RDLCK: > + return F_RDLCK; > + case TARGET_F_WRLCK: > + return F_WRLCK; > + case TARGET_F_UNLCK: > + return F_UNLCK; > + case TARGET_F_EXLCK: > + return F_EXLCK; > + case TARGET_F_SHLCK: > + return F_SHLCK; > + default: > + return type; > + } > +} > + > +static short host_to_target_flock_type(short type) > +{ > + switch (type) { > + case F_RDLCK: > + return TARGET_F_RDLCK; > + case F_WRLCK: > + return TARGET_F_WRLCK; > + case F_UNLCK: > + return TARGET_F_UNLCK; > + case F_EXLCK: > + return TARGET_F_EXLCK; > + case F_SHLCK: > + return TARGET_F_SHLCK; > + default: > + return type; > + } > +} Any reason not to use the bitmask_transtbl method of translation? r~