From patchwork Fri Apr 12 11:04:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Gautam X-Patchwork-Id: 16085 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EB7C126EB0 for ; Fri, 12 Apr 2013 11:07:45 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 1sf4428860qee.11 for ; Fri, 12 Apr 2013 04:07:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-auditid:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-brightmail-tracker:x-brightmail-tracker :dlp-filter:x-mtr:x-cfilter-loop:x-gm-message-state :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-google-group-id:list-post:list-help :list-archive:list-unsubscribe; bh=RvtRk9Dc2W6d17xzeagM23BQkIJAT3cmKiyMz64LH/A=; b=WsxR/ORPUZj+vwr8rfFuyLVCMJ6jSJebJnhpBtyCABGb3QVzP68Wo8HPCz+SnC7gTx S1HrUNqc2YVuQBuDRtqkEe+TmKTO5jm/+g0TUFSCKdIK+s5sYBoG/TokPGfWBsiFtrea alsoa1MbNdMJH/58fOEGUVa8ArH9eGboK48dylRDVa3F6qkAAZEpcRgjI4yPIUFh658o /PJGFeokURppbsDbpNiV6HpRKG9DNHLNX3cAx86lA39+4AI4v8BXIBc1dsawd6O2iQ6f b5Nx+W8UIP/mzkb5Dv6Cvfs+oHEcG3tatJA8d9s+9RSCQ712ET4OqOppSaTwFxsytKbY XoIQ== X-Received: by 10.236.134.201 with SMTP id s49mr5002596yhi.39.1365764842556; Fri, 12 Apr 2013 04:07:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.226 with SMTP id f2ls1239339qeo.13.gmail; Fri, 12 Apr 2013 04:07:22 -0700 (PDT) X-Received: by 10.220.209.135 with SMTP id gg7mr207921vcb.28.1365764842411; Fri, 12 Apr 2013 04:07:22 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id n2si6156952vcj.91.2013.04.12.04.07.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Apr 2013 04:07:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id ib11so2061942vcb.6 for ; Fri, 12 Apr 2013 04:07:22 -0700 (PDT) X-Received: by 10.58.84.164 with SMTP id a4mr8108210vez.9.1365764842200; Fri, 12 Apr 2013 04:07:22 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp60900veb; Fri, 12 Apr 2013 04:07:21 -0700 (PDT) X-Received: by 10.66.147.38 with SMTP id th6mr14611420pab.56.1365764841122; Fri, 12 Apr 2013 04:07:21 -0700 (PDT) Received: from mailout1.samsung.com (mailout1.samsung.com. [203.254.224.24]) by mx.google.com with ESMTP id hg4si8355021pbb.232.2013.04.12.04.07.20; Fri, 12 Apr 2013 04:07:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of gautam.vivek@samsung.com designates 203.254.224.24 as permitted sender) client-ip=203.254.224.24; Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ML500AVJ2W7MX60@mailout1.samsung.com> for patches@linaro.org; Fri, 12 Apr 2013 20:07:19 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.125]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id AB.1D.12250.7EAE7615; Fri, 12 Apr 2013 20:07:19 +0900 (KST) X-AuditID: cbfee691-b7f5f6d000002fda-8a-5167eae7f74e Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 41.39.13494.7EAE7615; Fri, 12 Apr 2013 20:07:19 +0900 (KST) Received: from vivekkumarg-linuxpc.sisodomain.com ([107.108.214.169]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0ML500IF52UIWD90@mmp2.samsung.com>; Fri, 12 Apr 2013 20:07:19 +0900 (KST) From: Vivek Gautam To: u-boot@lists.denx.de Cc: u-boot-review@google.com, patches@linaro.org, marex@denx.de, rajeshwari.s@samsung.com, sjg@chromium.org, vikas.sajjan@samsung.com, amarendra.xt@samsung.com, vipin.kumar@st.com, gautam.vivek@samsung.com Subject: [PATCH v3 8/8] usb: common: Use a global macro for 'min3' Date: Fri, 12 Apr 2013 16:34:40 +0530 Message-id: <1365764680-10917-9-git-send-email-gautam.vivek@samsung.com> X-Mailer: git-send-email 1.7.6.5 In-reply-to: <1365764680-10917-1-git-send-email-gautam.vivek@samsung.com> References: <1365764680-10917-1-git-send-email-gautam.vivek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRmVeSWpSXmKPExsWyRsSkVvf5q/RAgyeT1C2+LOhkt2i7cpDd 4k1bI6PFlMNfWCxa1h5gtfi2ZRujxfLXG9kt3u4FKrn5bDuTxb9L11gduDxmN1xk8Zg36wSL x4JNpR53ru1h8zh7ZwejR9+WVYweT3/sZQ5gj+KySUnNySxLLdK3S+DKaD81nbXgDmfFoZc7 WRoYL7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Sb28+YQWxOAU+J80vfgl0kBFSzsn83ywRG3gWMDKsY RVMLkguKk9JzjfSKE3OLS/PS9ZLzczcxgiPvmfQOxlUNFocYBTgYlXh4XwinBwqxJpYVV+Ye YpTgYFYS4Y3ZmxYoxJuSWFmVWpQfX1Sak1p8iDEZ6KqJzFKiyfnApJBXEm9obGJuamxqaWJh YmZJmrCSOO/BVutAIYH0xJLU7NTUgtQimC1MHJxSDYyz9Za7Sxxe05HI1ZU5bZvp7cxp7xao NsoceS+5VFD0efWlwjezjdYa3fzX8PV24TaOs6ILm/Zu8C77XnKVz+Am39VDupxXbRy+5t6a f2H135NdZtynZkk7RZZyX1f3tJy9yK9WmGGdRehJntXCO7f3TrgoemCJg9f873lHiyw/8/8L N+QUl76vxFKckWioxVxUnAgAOo/viQADAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Gm-Message-State: ALoCoQmR0Lq0F+PavSTQyvRB5nPsmYrerrb11CBtNP0/3qEtqmPFMSshhk/UMXpMUg+aN/NIiiwx X-Original-Sender: gautam.vivek@samsung.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.175 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We can use a common global macro for calculating minimum of 3 numbers. Put the same in 'common header' and let 'ehci' use it. Signed-off-by: Vivek Gautam --- This patch added in V3(current-version) of this patch-series. drivers/usb/host/ehci-hcd.c | 10 ---------- include/common.h | 2 ++ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index c816878..bcecae3 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -587,16 +587,6 @@ fail: return -1; } -static inline int min3(int a, int b, int c) -{ - - if (b < a) - a = b; - if (c < a) - a = c; - return a; -} - int ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer, int length, struct devrequest *req) diff --git a/include/common.h b/include/common.h index d41aeb4..37269c7 100644 --- a/include/common.h +++ b/include/common.h @@ -211,6 +211,8 @@ typedef void (interrupt_handler_t)(void *); #define MIN(x, y) min(x, y) #define MAX(x, y) max(x, y) +#define min3(a, b, c) min(min(a, b), c) + /* * Return the absolute value of a number. *