Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754123AbbFATJz (ORCPT ); Mon, 1 Jun 2015 15:09:55 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:61678 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753610AbbFATIc (ORCPT ); Mon, 1 Jun 2015 15:08:32 -0400 From: Arnd Bergmann To: Greg KH Cc: Rachel Kim , Dean Lee , Chris Park , devel@driverdev.osuosl.org, nicolas.ferre@atmel.com, Johnny Kim , linux-kernel@vger.kernel.org, Sudip Mukherjee , Arnd Bergmann Subject: [PATCH v2 05/12] staging: wilc1000: simplify semaphore wrapper Date: Mon, 1 Jun 2015 21:06:38 +0200 Message-Id: <1433185605-2492600-6-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.1.0.rc2 In-Reply-To: <1433185605-2492600-1-git-send-email-arnd@arndb.de> References: <1433185605-2492600-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:EWn/jzjyMtSKzGayQoAxi1dUVHKtumMG11skwL8UWta6PXmf+OS lkSKXR/Z7FCtaaZEu+Qh/5F6DqXn8s/83T0hkqfZZNcJH4/Wb6rBWKDnoDf4wwQXEc/sJbA XSwcUlPIfkuIXQIW21iYlZ/m8Ht7RCNxI3ADPRA3fzArEc9im4VBY3moqX/1mypUc+lfc2l Jzyd7qkiuqOXbqw4cZXkw== X-UI-Out-Filterresults: notjunk:1;V01:K0:k92aWhzapdQ=:jFgNzZePsscHninZ4JpyBP Dq6Rd28uXplYxKtiTCWy6HymFxLlpVod3NZwBJ+4tHgEIDQdnGppVGdEOxkM+zcJXEIknnDCi Az+P9iQeh0hqyswEjIzxEc5CTLJyT976uADAF3U9ENhBkkBfMc8J55Uz34tf2APJjfPXO6kIB SJWGPeYFMbCjMAeA/gfdiOY1xzHIWk0nklOVxD6Uc6Q9PZRhtfxQw1PdnzI7jtczn44vBvbk1 H7imdCCYNBfRePhe0yX/2EZEG53DtDqsjYmXOG+ciI18hy293BBBCSwq832M19CbuoyHuDGr2 vCAxw2ioE0P9lKc5u0ZsbgDweLjGLBr02P8RWfznEdeAxdT04OTL4TVGtwfncuYHuJiqCiQBk i/JbL765mSMMwGPWVuXuEjW9ZZXrS26JyyBRMNLsi/M9VNKzxV6PwT0IG4Fc73vnQy6Gq0caQ BFSOzTE1+5xC8FMoa0NozBsVUDwTWai2X5PvcsyUs+vIdt2h9l8sUdFPY5Nynx4qV2QKtY9TI GuTygv/AdmFly4/oy79yh9n6E+k1/k30mxPXDWXTR0JEkuVkeQvcsFWXrvq4qzZQsc+Vepiep +IK2UDf5jGezqjxKp9NIFGlN7GgZUnxxFiX48MXx8Ct2UxmjCm8NYvCX49TAAyUyKg0Xcm1Bv R956tzNs0eFl38+z4/a7hduOu Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3961 Lines: 129 The driver has its own API for semaphores. This should be replaced with mutexes and completions, but for the moment we can start by removing the obviously unused parts. Signed-off-by: Arnd Bergmann --- drivers/staging/wilc1000/wilc_osconfig.h | 1 - drivers/staging/wilc1000/wilc_oswrapper.h | 2 -- drivers/staging/wilc1000/wilc_semaphore.c | 14 -------------- drivers/staging/wilc1000/wilc_semaphore.h | 18 +----------------- 4 files changed, 1 insertion(+), 34 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_osconfig.h b/drivers/staging/wilc1000/wilc_osconfig.h index eec93b351f14..d0bf08f89906 100644 --- a/drivers/staging/wilc1000/wilc_osconfig.h +++ b/drivers/staging/wilc1000/wilc_osconfig.h @@ -10,7 +10,6 @@ /* OS features supported */ -#define CONFIG_WILC_SEMAPHORE_FEATURE 1 /* #define CONFIG_WILC_SEMAPHORE_TIMEOUT 1 */ #define CONFIG_WILC_SLEEP_FEATURE 1 #define CONFIG_WILC_SLEEP_HI_RES 1 diff --git a/drivers/staging/wilc1000/wilc_oswrapper.h b/drivers/staging/wilc1000/wilc_oswrapper.h index fd5dd3c6316e..32fe48a6034b 100644 --- a/drivers/staging/wilc1000/wilc_oswrapper.h +++ b/drivers/staging/wilc1000/wilc_oswrapper.h @@ -55,9 +55,7 @@ typedef WILC_Uint16 WILC_WideChar; #include "wilc_errorsupport.h" /* Semaphore support */ -#ifdef CONFIG_WILC_SEMAPHORE_FEATURE #include "wilc_semaphore.h" -#endif /* Sleep support */ #ifdef CONFIG_WILC_SLEEP_FEATURE diff --git a/drivers/staging/wilc1000/wilc_semaphore.c b/drivers/staging/wilc1000/wilc_semaphore.c index 637107bfb877..f09a88ca6ae4 100644 --- a/drivers/staging/wilc1000/wilc_semaphore.c +++ b/drivers/staging/wilc1000/wilc_semaphore.c @@ -1,7 +1,5 @@ #include "wilc_oswrapper.h" -#ifdef CONFIG_WILC_SEMAPHORE_FEATURE - WILC_ErrNo WILC_SemaphoreCreate(WILC_SemaphoreHandle *pHandle, tstrWILC_SemaphoreAttrs *pstrAttrs) @@ -33,19 +31,9 @@ WILC_ErrNo WILC_SemaphoreAcquire(WILC_SemaphoreHandle *pHandle, { WILC_ErrNo s32RetStatus = WILC_SUCCESS; - #ifndef CONFIG_WILC_SEMAPHORE_TIMEOUT while (down_interruptible(pHandle)) ; - #else - if (pstrAttrs == WILC_NULL) { - down(pHandle); - } else { - - s32RetStatus = down_timeout(pHandle, msecs_to_jiffies(pstrAttrs->u32TimeOut)); - } - #endif - if (s32RetStatus == 0) { return WILC_SUCCESS; } else if (s32RetStatus == -ETIME) { @@ -66,5 +54,3 @@ WILC_ErrNo WILC_SemaphoreRelease(WILC_SemaphoreHandle *pHandle, return WILC_SUCCESS; } - -#endif diff --git a/drivers/staging/wilc1000/wilc_semaphore.h b/drivers/staging/wilc1000/wilc_semaphore.h index 3006f9f20c4d..3c0ecc326fb3 100644 --- a/drivers/staging/wilc1000/wilc_semaphore.h +++ b/drivers/staging/wilc1000/wilc_semaphore.h @@ -10,11 +10,6 @@ * @version 1.0 */ - -#ifndef CONFIG_WILC_SEMAPHORE_FEATURE -#error the feature WILC_OS_FEATURE_SEMAPHORE must be supported to include this file -#endif - /*! * @struct WILC_SemaphoreAttrs * @brief Semaphore API options @@ -28,14 +23,6 @@ typedef struct { */ WILC_Uint32 u32InitCount; - #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT - /*!< - * Timeout for use with WILC_SemaphoreAcquire, 0 to return immediately and - * WILC_OS_INFINITY to wait forever. default is WILC_OS_INFINITY - */ - WILC_Uint32 u32TimeOut; - #endif - } tstrWILC_SemaphoreAttrs; @@ -47,12 +34,9 @@ typedef struct { * @date 10 Aug 2010 * @version 1.0 */ -static void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs) +static inline void WILC_SemaphoreFillDefault(tstrWILC_SemaphoreAttrs *pstrAttrs) { pstrAttrs->u32InitCount = 1; - #ifdef CONFIG_WILC_SEMAPHORE_TIMEOUT - pstrAttrs->u32TimeOut = WILC_OS_INFINITY; - #endif } /*! * @brief Creates a new Semaphore object -- 2.1.0.rc2 -- 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/