Received: by 10.213.65.68 with SMTP id h4csp1820927imn; Sun, 1 Apr 2018 16:12:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx48SipTk4dSqaAUBRYVBPpbDYorVhrsECa5JX+KEYoc9uohd7ZfBi71zczsUp5aHO721rJBK X-Received: by 10.99.121.73 with SMTP id u70mr4962668pgc.232.1522624333519; Sun, 01 Apr 2018 16:12:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522624333; cv=none; d=google.com; s=arc-20160816; b=T9sWQlle637CfpDIkNB5VMkzcOeWh9hyLLJWj9fbva2DtLKcFz95FOUC4DtGkZxjeb L5Y6+1xRiz3Q3DBw7qePPrt398wrax+oONardkhLZtRPZXFjqtppaR9ZtGhTspVda2Cb H+jQ9HoCTxHg8i6nD1hMmICD8uBJYxPjq34kAZqXGkZu1En7xZkQpXVMPe5oJZcW2DvT eQI+KaAkjtj180RWG3+SGJYKTxRBhtLLsyDH8cVjKj9JSG6k7Q3Fsh5dQ05EGoFTQkdL 591ZZfdKdB+grCN4GiI3SUqLHuq7Zs+kvXs2eG6c5E6tA81DvPel8AplfqnHxGtfUFDL KKHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature :arc-authentication-results; bh=0C0AKen1OTsgrT1kvOtXuqrqk8X8InSUcrWM0UfLYi0=; b=rVYsmHhmkfQOQeYbzAnAv2QWC9KLy+fRNZi3knIOpo7MPZza2W6dmfcevDTKfsoUyZ M+ThN4kYP8A93oYaPw8RcZVe1IUE6CS9igoMJVEfakyhpv/YDJYlKm7dfPh/7UKK4mq6 6W1+CpoZ511CQpH3K8SQ7zuGMD4wypudcUueVXzvmDVmb4PkpeBJQ//SPQHB/GAAh+YQ SPNBc2SnFraLG7IB+BMNz37uf4tfwVHnb0dtohWVut56Ib4Kami/oiEMMRAdv7rOI2Ns pzECpML+spb1kMR5r0ozB/qja6Ei69WoHf4WF4tbCCtYJ01jCUaXJdyXZWiG3UAsX4gQ VcBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qr1XI7iI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 196si8982321pgb.674.2018.04.01.16.11.59; Sun, 01 Apr 2018 16:12:13 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=qr1XI7iI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753983AbeDAXKy (ORCPT + 99 others); Sun, 1 Apr 2018 19:10:54 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:45498 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753915AbeDAXKx (ORCPT ); Sun, 1 Apr 2018 19:10:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:To: Subject:Sender:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=0C0AKen1OTsgrT1kvOtXuqrqk8X8InSUcrWM0UfLYi0=; b=qr1XI7iIU8hZw7/6EbM6O5SFr z9Vz0nGa5+grHIvQkrbVssHgdSX3u1qa+9Sfy0k+mPzL+/rJqNBJPA/ALNyBAlSdONaIYQ4KOWxXY oME5dphXLe2Ed1vA2d0fG9JLVzaM41GCdSNFqOIGYTfvItPji7hyd4IsiIvRbrUsnO5FCmJ9hOuaq EVS1KjcKJz+4R1qkl3G6wsZ7XJKFGUHv3hUPI3PbNMp48NrFWlylpo4lgdqIb93dQxzK53KMwRlTq fh49aHgDrGFgPIYmYWJhNKWU/dDL8KDvY8rOMNlXJA8g3wimfly9jpxXcuJplkntpKr3WvgTYO1HM 291LnNjKg==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1f2m7h-00026j-0K; Sun, 01 Apr 2018 23:10:53 +0000 Subject: Re: [PATCH 38/45] C++: mutex_trylock_recursive_enum() int->enum To: David Howells , linux-kernel@vger.kernel.org References: <152261521484.30503.16131389653845029164.stgit@warthog.procyon.org.uk> <152261544366.30503.65430592511529554.stgit@warthog.procyon.org.uk> From: Randy Dunlap Message-ID: <100fd0de-2c7c-cbec-ac99-ea3a4aff383b@infradead.org> Date: Sun, 1 Apr 2018 16:10:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <152261544366.30503.65430592511529554.stgit@warthog.procyon.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/01/2018 01:44 PM, David Howells wrote: > Make mutex_trylock_recursive_enum() cast the int it derives to the enum > return type. > > Signed-off-by: David Howells > --- > > include/linux/mutex.h | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/include/linux/mutex.h b/include/linux/mutex.h > index cb3bbed4e633..2bacc5065980 100644 > --- a/include/linux/mutex.h > +++ b/include/linux/mutex.h > @@ -224,13 +224,14 @@ enum mutex_trylock_recursive_enum { > * - MUTEX_TRYLOCK_SUCCESS - lock acquired, > * - MUTEX_TRYLOCK_RECURSIVE - we already owned the lock. > */ > -static inline /* __deprecated */ __must_check enum mutex_trylock_recursive_enum > +static inline /* __deprecated */ __must_check > +enum mutex_trylock_recursive_enum nak that change from 1 to 2 lines. It's only 79 characters. > mutex_trylock_recursive(struct mutex *lock) > { > if (unlikely(__mutex_owner(lock) == current)) > return MUTEX_TRYLOCK_RECURSIVE; > > - return mutex_trylock(lock); > + return (enum mutex_trylock_recursive_enum)mutex_trylock(lock); > } > > #endif /* __LINUX_MUTEX_H */ > -- ~Randy